$setarr = array('uid' => $uid, 'username' => $_POST['username']); } else { show_msg('输入的用户名无法注册,请重新确认'); } $setarr['dateline'] = $_SGLOBAL['timestamp']; $setarr['updatetime'] = $_SGLOBAL['timestamp']; $setarr['lastlogin'] = $_SGLOBAL['timestamp']; $setarr['ip'] = $_SGLOBAL['onlineip']; $setarr['password'] = md5("{$setarr['uid']}|{$_SGLOBAL['timestamp']}"); //本地密码随机生成 $setarr['groupid'] = 1; //管理员 //更新本地用户库 inserttable('members', $setarr, 0, true); //反馈受保护 $result = uc_user_addprotected($_POST['username'], $_POST['username']); //设置cookie ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), 2592000); //写log if (@($fp = fopen($lockfile, 'w'))) { fwrite($fp, 'SupeSite'); fclose($fp); } show_msg('<font color="red">恭喜! SupeSite安装全部完成!</font> <br>为了您的数据安全,请登录ftp,删除本安装文件<br><br> 您的管理员身份已经成功确认。接下来,您可以:<br> <br><a href="../admincp.php" target="_blank">进入站点管理平台</a> <br>以管理员身份对站点参数进行设置 <br><a href="../index.php" target="_blank">访问站点首页</a> <br>立即访问自己的站点首页', 999); }
function check_adminuser($username, $password, $email) { include ROOT_PATH . CONFIG_UC; include ROOT_PATH . './uc_client/client.php'; $error = ''; $ucresult = uc_user_login($username, $password); list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult); $ucresult = $tmp; if ($ucresult['uid'] <= 0) { $uid = uc_user_register($username, $password, $email); if ($uid == -1 || $uid == -2) { $error = 'admin_username_invalid'; } elseif ($uid == -4 || $uid == -5 || $uid == -6) { $error = 'admin_email_invalid'; } elseif ($uid == -3) { $error = 'admin_exist_password_error'; } } else { $uid = $ucresult['uid']; $email = $ucresult['email']; $password = $ucresult['password']; } if (!$error && $uid > 0) { $password = md5($password); uc_user_addprotected($username, ''); } else { $uid = 0; $error = empty($error) ? 'error_unknow_type' : $error; } return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error); }
function check_adminuser($username, $password, $email) { @(include ROOT_PATH . './config.inc.php'); include ROOT_PATH . './uc_client/client.php'; $error = ''; $uid = uc_user_register($username, $password, $email); /* -1 : 用户名不合法 -2 : 包含不允许注册的词语 -3 : 用户名已经存在 -4 : email 格式有误 -5 : email 不允许注册 -6 : 该 email 已经被注册 >1 : 表示成功,数值为 UID */ if ($uid == -1 || $uid == -2) { $error = 'admin_username_invalid'; } elseif ($uid == -4 || $uid == -5 || $uid == -6) { $error = 'admin_email_invalid'; } elseif ($uid == -3) { $ucresult = uc_user_login($username, $password); list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult); $ucresult = $tmp; if ($ucresult['uid'] <= 0) { $error = 'admin_exist_password_error'; } else { $uid = $ucresult['uid']; $email = $ucresult['email']; $password = $ucresult['password']; } } if (!$error && $uid > 0) { $password = md5($password); uc_user_addprotected($username, ''); } else { $uid = 0; $error = empty($error) ? 'error_unknow_type' : $error; } return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error); }
$cpurl = CPURL; $s_url = S_URL; if ($uid) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('members') . " WHERE uid='{$uid}'"); if (!($member = $_SGLOBAL['db']->fetch_array($query))) { showmessage('designated_users_do_not_exist'); } } if (submitcheck('usergroupsubmit')) { //删除保护 if (!ckfounder($_SGLOBAL['supe_uid']) && (ckfounder($member['uid']) || $_SGLOBAL['supe_uid'] == $member['uid'])) { showmessage('no_authority_management_operation'); } include_once S_ROOT . './uc_client/client.php'; if ($_POST['flag'] == 1) { $result = uc_user_addprotected(array($member['username']), $_SGLOBAL['supe_username']); } else { $_POST['flag'] = 0; $result = uc_user_deleteprotected(array($member['username']), $_SGLOBAL['supe_username']); } if ($result) { $setarr['flag'] = $_POST['flag']; } $setarr['credit'] = intval($_POST['credit']); $setarr['experience'] = intval($_POST['experience']); if ($uid != $_SGLOBAL['supe_uid']) { if (!empty($_POST['groupid'])) { $setarr['groupid'] = intval($_POST['groupid']); } } updatetable('members', $setarr, array('uid' => $uid));
function check_adminuser($username, $password, $email) { @(include ROOT_PATH . './config.inc.php'); include ROOT_PATH . './uc_client/client.php'; $error = ''; $uid = uc_user_register($username, $password, $email); /*vot comments: -1 : The user name is not valid -2 : Contains not allowed words -3 : User name already exists -4 : Email format is wrong -5 : THis Email is not allowed for registration -6 : This email is not registered >1 : the UID is successfully identified */ if ($uid == -1 || $uid == -2) { $error = 'admin_username_invalid'; } elseif ($uid == -4 || $uid == -5 || $uid == -6) { $error = 'admin_email_invalid'; } elseif ($uid == -3) { $ucresult = uc_user_login($username, $password); list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult); $ucresult = $tmp; if ($ucresult['uid'] <= 0) { $error = 'admin_exist_password_error'; } else { $uid = $ucresult['uid']; $email = $ucresult['email']; $password = $ucresult['password']; } } if (!$error && $uid > 0) { $password = md5($password); uc_user_addprotected($username, ''); } else { $uid = 0; $error = empty($error) ? 'error_unknow_type' : $error; } return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error); }