diff --git a/wiki/patches/moin1.9.3-newaccount.patch b/wiki/patches/moin1.9.3-newaccount.patch new file mode 100644 index 00000000..7e380071 --- /dev/null +++ b/wiki/patches/moin1.9.3-newaccount.patch @@ -0,0 +1,30 @@ +--- a/MoinMoin/action/newaccount.py 2012-06-03 15:34:20.000000000 +0200 ++++ b/MoinMoin/action/newaccount.py 2012-06-03 15:39:43.000000000 +0200 +@@ -12,6 +12,11 @@ + from MoinMoin.security.textcha import TextCha + from MoinMoin.auth import MoinAuth + ++### HACK SAUVAGE 1/2 ++import sys ++sys.path.append('/usr/scripts/gestion/') ++from iptools import is_crans ++### FIN HACK 1/2 + + def _create_user(request): + _ = request.getText +@@ -23,6 +28,15 @@ + if not wikiutil.checkTicket(request, form.get('ticket', '')): + return + ++ ### HACK SAUVAGE 2/2 ++ try: ++ if not is_crans(request.remote_addr): ++ return _("La création de comptes n'est autorisée" ++ " que depuis le réseau du Cr@ns ou sur zamok.") ++ except: ++ pass ++ ### FIN HACK 2/2 ++ + if not TextCha(request).check_answer_from_form(): + return _('TextCha: Wrong answer! Go back and try again...') +