Application des patches crans.
darcs-hash:20070601130217-68412-6031a22f65c4203b17066a69c164031db0110c19.gz
This commit is contained in:
parent
329eea2862
commit
d294a22d41
3 changed files with 68 additions and 2 deletions
|
@ -10,6 +10,7 @@ import string, time, re
|
|||
from MoinMoin import user, util, wikiutil
|
||||
from MoinMoin.util import web, mail, timefuncs
|
||||
from MoinMoin.widget import html
|
||||
from MoinMoin.PageEditor import PageEditor
|
||||
|
||||
_debug = 0
|
||||
|
||||
|
@ -102,6 +103,12 @@ Contact the owner of the wiki, who can enable email.""")
|
|||
except KeyError:
|
||||
return _("Empty user name. Please enter a user name.")
|
||||
|
||||
#### HACK CRANS : oblige les utilistaeurs a créer un WikiNom valide
|
||||
if not wikiutil.isStrictWikiname(theuser.name):
|
||||
return (u"""Nom d'utilisateur invalide {{{'%s'}}}.
|
||||
Le login doit être de la forme WikiNom, WikiPseudo, PrenomNom... (voir ci dessous pour plus d'informations).""" % wikiutil.escape(theuser.name))
|
||||
#### FIN HACK
|
||||
|
||||
# Don't allow users with invalid names
|
||||
if not user.isValidName(self.request, theuser.name):
|
||||
return _("""Invalid user name {{{'%s'}}}.
|
||||
|
@ -117,6 +124,15 @@ space between words. Group page name is not allowed.""") % wikiutil.escape(theus
|
|||
else:
|
||||
newuser = 0
|
||||
|
||||
#### HACK SAUVAGE
|
||||
if newuser and not self.cfg.ip_autorised_create_account(self.request.remote_addr):
|
||||
return _(u"""Création de compte impossible.
|
||||
Pour des raisons de sécurité, la fonction de création d'un compte n'est
|
||||
possible que depuis la zone CRANS.
|
||||
Si vous possédez un compte sur zamok, vous pouvez y exécuter
|
||||
creer_compte_wiki.""")
|
||||
#### FIN DU HACK
|
||||
|
||||
# try to get the password and pw repeat
|
||||
password = form.get('password', [''])[0]
|
||||
password2 = form.get('password2',[''])[0]
|
||||
|
@ -175,6 +191,15 @@ space between words. Group page name is not allowed.""") % wikiutil.escape(theus
|
|||
from MoinMoin import auth
|
||||
auth.setCookie(self.request, theuser)
|
||||
self.request.user = theuser
|
||||
|
||||
#### HACK : création de la page WikiNom
|
||||
try:
|
||||
p = PageEditor(self.request, theuser.name)
|
||||
p.saveText( 'Décrire ici %s' % theuser.name, 0)
|
||||
except:
|
||||
pass
|
||||
#### FIN DU HACK
|
||||
|
||||
return _("Use UserPreferences to change settings of the selected user account")
|
||||
else:
|
||||
return _("Use UserPreferences to change your settings or create an account.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue