限制用户名注册

This commit is contained in:
jysperm
2014-05-18 05:52:00 +08:00
parent 1376a8aa12
commit 24c44b94dd
3 changed files with 11 additions and 1 deletions

View File

@@ -6,11 +6,13 @@
apt-get update
apt-get upgrade
apt-get install nodejs git mongodb memcached nginx postfix
apt-get install python g++ make screen git wget zip unzip iftop unrar-free axel vim emacs subversion subversion-tools curl tmux mercurial
apt-get install ntp quota quotatool
vi /etc/hostname
vi /etc/hosts
adduser rpadmin
usermod -G rpadmin -a www-data
su rpadmin

View File

@@ -22,6 +22,9 @@ module.exports =
unless req.body.passwd or not /^.+$/.test req.body.passwd
return res.json 400, error: 'invalid_passwd'
if req.body.username in config.account.invalid_username
return res.json 400, error: 'username_exist'
mAccount.byUsername req.body.username, (account) ->
if account
return res.json 400, error: 'username_exist'

View File

@@ -6,6 +6,11 @@ module.exports =
username: ['jysperm']
account:
invalid_username: [
'root', 'daemon', 'bin', 'sys', 'sync', 'games', 'man', 'lp', 'mail', 'colord', 'nobody',
'news', 'uucp', 'proxy', 'www-data', 'backup', 'list', 'irc', 'gnats', 'messagebus',
'syslog', 'sshd', 'ntp', 'memcache', 'mongodb', 'rpadmin', 'postfix', 'libuuid'
]
cookie_time: 30 * 24 * 3600 * 1000
i18n: