本文整理汇总了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);
}
开发者ID:cwcw,项目名称:cms,代码行数:31,代码来源:index.php
示例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);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:install_function.php
示例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);
}
开发者ID:h3len,项目名称:Project,代码行数:40,代码来源:func.inc.php
示例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));
开发者ID:hongz1125,项目名称:devil,代码行数:31,代码来源:admin_member.php
示例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);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:40,代码来源:func.inc.php
注:本文中的uc_user_addprotected函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论