Skip to content

Commit

Permalink
Check for valid email on #register
Browse files Browse the repository at this point in the history
  • Loading branch information
greghaynes committed Nov 8, 2009
1 parent 60605a8 commit ad5a130
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pyscripts/UserManager/usermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from xsbs.ui import info, error
from xsbs.players import player
from xsbs.settings import PluginConfig
import re

config = PluginConfig('usermanager')
usertable = config.getOption('Config', 'users_tablename', 'usermanager_users')
Expand Down Expand Up @@ -66,6 +67,12 @@ def userAuth(email, password):
return False
return user

def isValidEmail(email):
if len(email) > 7:
if re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$", email) != None:
return 1
return 0

def onRegisterCommand(cn, args):
'''@description Register account with server
@usage <email> <password>
Expand Down

0 comments on commit ad5a130

Please sign in to comment.