|
|
|
@ -261,7 +261,7 @@ class UserController extends AdminController
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function add($username = '', $password = '', $repassword = '', $email = '', $second_pwd = '')
|
|
|
|
|
public function add($username = '', $real_name='', $password = '', $repassword = '', $email = '', $second_pwd = '')
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (IS_POST) {
|
|
|
|
@ -269,6 +269,9 @@ class UserController extends AdminController
|
|
|
|
|
if (empty($username)) {
|
|
|
|
|
$this->error('管理员账号不能为空!');
|
|
|
|
|
}
|
|
|
|
|
if (empty($real_name)) {
|
|
|
|
|
$this->error('真实姓名不能为空!');
|
|
|
|
|
}
|
|
|
|
|
/* 检测密码 */
|
|
|
|
|
if ($password != $repassword) {
|
|
|
|
|
$this->error('管理员密码和确认密码不一致!');
|
|
|
|
@ -285,7 +288,7 @@ class UserController extends AdminController
|
|
|
|
|
$User = new UserApi;
|
|
|
|
|
$uid = $User->register($username, $password, $email, $second_pwd);
|
|
|
|
|
if (0 < $uid) { //注册成功
|
|
|
|
|
$user = array('uid' => $uid, 'nickname' => $username, 'status' => 1,"birthday"=>date('Y-m-d',time()));
|
|
|
|
|
$user = array('uid' => $uid,'realname'=>$real_name, 'nickname' => $username, 'status' => 1,"birthday"=>date('Y-m-d',time()));
|
|
|
|
|
$data['uid'] = $uid;
|
|
|
|
|
$data['group_id'] = I('auth');
|
|
|
|
|
M('auth_group_access')->data($data)->add();
|
|
|
|
@ -343,6 +346,9 @@ class UserController extends AdminController
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (empty($_POST['real_name'])) {
|
|
|
|
|
$this->error('真实姓名不能为空!');
|
|
|
|
|
}
|
|
|
|
|
if ($_POST['auth'] == '' && $id != 1) {
|
|
|
|
|
$this->error('请选择用户权限!');
|
|
|
|
|
}
|
|
|
|
@ -389,6 +395,7 @@ class UserController extends AdminController
|
|
|
|
|
$maps['uid'] = $id;
|
|
|
|
|
$info['username'] = $_POST['username'];
|
|
|
|
|
$in['nickname'] = $_POST['username'];
|
|
|
|
|
$in['real_name'] = $_POST['real_name'];
|
|
|
|
|
$pwd = $this->think_ucenter_md5($_POST['password'], UC_AUTH_KEY);
|
|
|
|
|
$spwd = $this->think_ucenter_md5($_POST['second_pwd'], UC_AUTH_KEY);
|
|
|
|
|
$rpwd = $Member->where(array('id' => $id))->find();
|
|
|
|
|