From bfd1df473233ee19b052e445ca0c243c20a972a6 Mon Sep 17 00:00:00 2001 From: Michel Blockelet Date: Sun, 3 Jun 2012 15:48:19 +0200 Subject: [PATCH] [wiki/patches] Ajout patch pour la creation des comptes Ignore-this: 4fd5274c0099b6bf07ff376b7628e6f5 Elle n'est autorisee que depuis le reseau du Cr@ns, ou zamok (Je n'ai pas retrouve de trace des anciennes modifications, qui ont ete ecrasees lors de la maj ...) darcs-hash:20120603134819-ddb99-9d668467924cbd8adfa4a71b1e3abb0ee5ad1899.gz --- wiki/patches/moin1.9.3-newaccount.patch | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 wiki/patches/moin1.9.3-newaccount.patch 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...') +