|
|
|
@ -184,13 +184,19 @@ def is_banned(user_id): |
|
|
|
def playable_required(f): |
|
|
|
@wraps(f) |
|
|
|
def decorated_function(*args, **kwargs): |
|
|
|
user = get_player_from_ip(get_ip()) |
|
|
|
ip=get_ip() |
|
|
|
user = get_player_from_ip(ip) |
|
|
|
|
|
|
|
if not session['ip']: |
|
|
|
# On enregistre l'ip afin d'éviter les problèmes lors du déplacement des user (rez <-> Supelec) |
|
|
|
session['ip'] = ip |
|
|
|
|
|
|
|
# Attention : un utilisateur inscrit ne peut pas être forcé à être |
|
|
|
# désinscrit s'il n'enlève pas son cookie de session. On évite la |
|
|
|
# réexécution de la requête. |
|
|
|
if 'subscribed' not in session or not session['subscribed']: |
|
|
|
if 'subscribed' not in session or not session['subscribed'] or session['ip'] != ip: |
|
|
|
session['subscribed'] = user is not None |
|
|
|
session['ip'] = ip |
|
|
|
if not session['subscribed']: |
|
|
|
return render_template('not_subscribed.html') |
|
|
|
|
|
|
|
@ -309,7 +315,7 @@ def banned(): |
|
|
|
def banned_ip(): |
|
|
|
# Liste des ip pour récupération par babel et plop |
|
|
|
if not DEBUG: |
|
|
|
if get_ip() not in ['10.7.0.39', '10.7.0.254' ,'10.13.0.1', '10.69.8.5' ,'10.69.2.219']: |
|
|
|
if get_ip() not in ['10.7.0.254']: |
|
|
|
abort(403) |
|
|
|
|
|
|
|
con = connect_sqlite() |
|
|
|
|