本文整理匯總了PHP中uc_user_addprotected函數的典型用法代碼示例。如果您正苦於以下問題:PHP uc_user_addprotected函數的具體用法?PHP uc_user_addprotected怎麽用?PHP uc_user_addprotected使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了uc_user_addprotected函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$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);
}
示例2: check_adminuser
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);
}
示例3: check_adminuser
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);
}
示例4: tname
$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));
示例5: check_adminuser
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);
}