Skip to content

Commit

Permalink
安装时管理员姓名改为用户名
Browse files Browse the repository at this point in the history
  • Loading branch information
zyx0814 committed Mar 27, 2018
1 parent d600d88 commit 1c83b24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions install/include/install_var.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,9 @@
'admininfo' => array
(
'email' => array('type' => 'text', 'required' => 1, 'reg' => '/@/', 'value' => array('type' => 'var', 'var' => 'adminemail')),
'nickname' => array('type' => 'text', 'required' => 0, 'reg' => '/^.*$/'),
'username' => array('type' => 'text', 'required' => 1, 'reg' => '/^.*$/', 'value' => array('type' => 'constant', 'var' => 'admin')),
'password' => array('type' => 'password', 'required' => 1, 'reg' => '/^.*$/'),
'password2' => array('type' => 'password', 'required' => 1, 'reg' => '/^.*$/'),
'username' => array('type' => 'text', 'required' => 1, 'reg' => '/^.*$/', 'value' => array('type' => 'constant', 'var' => 'admin')),

)
);
Expand Down
6 changes: 2 additions & 4 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,7 @@
}else {
show_msg('admininfo_invalid', '', 0);
}
if($nickname && (strlen($nickname) > 30 || preg_match("/^$|^c:\\con\\con$| |[,\"\s\t\<\>&]|^Guest/is", $username))) {
show_msg('admin_nickname_invalid', $nickname, 0);
}

$uid = 1 ;

$onlineip = $_SERVER['REMOTE_ADDR'];
Expand All @@ -381,7 +379,7 @@
$dbuser = $_config['db'][1]['dbuser'];
$tablepre = $_config['db'][1]['tablepre'];
$db->connect($dbhost, $dbuser, $dbpw, $dbname, DBCHARSET);
$db->query("REPLACE INTO {$tablepre}user (uid, username,nickname, password, adminid, groupid, email, regdate,salt,authstr) VALUES ('$uid', '$username', '$nickname','$password', '1', '1', '$email', '".time()."','$salt','');");
$db->query("REPLACE INTO {$tablepre}user (uid, username,nickname, password, adminid, groupid, email, regdate,salt,authstr) VALUES ('$uid', '$username', '','$password', '1', '1', '$email', '".time()."','$salt','');");
$db->query("update {$tablepre}folder set `uid`=$uid,`username`='$username' where `fid` = 1");
$db->query("REPLACE INTO {$tablepre}user_status (uid, regip,lastip, lastvisit, lastactivity, lastsendmail, invisible, profileprogress) VALUES ('$uid', '', '','$timestamp', '$timestamp', '0', '0', '0');");
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}user");
Expand Down
6 changes: 3 additions & 3 deletions install/language/zh-cn/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@
'dbinfo_dbpw_invalid' => '数据库密码为空,或者格式错误,请检查',
'dbinfo_adminemail_invalid' => '系统邮箱为空,或者格式错误,请检查',
'dbinfo_tablepre_invalid' => '数据表前缀为空,或者格式错误,请检查',
'admininfo_username_invalid' => '管理员姓名为空,或者格式错误,请检查',
'admininfo_username_invalid' => '管理员用户名为空,或者格式错误,请检查',
'admininfo_nickname_invalid' => '管理员用户名为空,或者格式错误,请检查',
'admininfo_email_invalid' => '管理员Email为空,或者格式错误,请检查',
'admininfo_password_invalid' => '管理员密码为空,请填写',
'username' => '管理员姓名',
'username' => '管理员用户名',
'email' => '管理员登录邮箱',
'nickname' => '管理员登录用户名',
'password' => '管理员密码',
Expand All @@ -114,7 +114,7 @@
'admininfo_invalid' => '管理员信息不完整,请检查管理员姓名,密码,邮箱',
'dbname_invalid' => '数据库名为空,请填写数据库名称',
'tablepre_invalid' => '数据表前缀为空,或者格式错误,请检查',
'admin_username_invalid' => '非法姓名,姓名长度不应当超过 30 个英文字符,且不能包含特殊字符,一般是中文,字母或者数字',
'admin_username_invalid' => '非法用户名,姓名长度不应当超过 30 个英文字符,且不能包含特殊字符,一般是中文,字母或者数字',
'admin_nicname_invalid' => '非法用户名,用户名长度不应当超过 30 个英文字符,且不能包含特殊字符,一般是中文,字母或者数字',
'admin_password_invalid' => '密码和上面不一致,请重新输入',
'admin_email_invalid' => 'Email 地址错误,此邮件地址已经被使用或者格式无效,请更换为其他地址',
Expand Down

0 comments on commit 1c83b24

Please sign in to comment.