本文整理汇总了PHP中uc_user_checkname函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_user_checkname函数的具体用法?PHP uc_user_checkname怎么用?PHP uc_user_checkname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uc_user_checkname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUsername
public function checkUsername($username)
{
$this->initDiscuzApi();
if (UC_CHARSET == 'gbk') {
$username = iconv('UTF-8', 'gb2312', $username);
}
$result = uc_user_checkname($username);
return $this->convertApiResult($result);
}
示例2: CheckUsernameValid
/**
* Check whether the given username is legal(not in the forbidden list).
* @param $username: a username
* @return true if the username is legal; false otherwise.
* */
public function CheckUsernameValid($username)
{
/* uc_user_checkname is defined as a global function */
$result = uc_user_checkname($username);
if ($result > 0) {
return true;
} else {
return false;
}
}
示例3: checkUcenterName
public function checkUcenterName($attribute, $params)
{
//ucenter
Yii::import('ext.ucenter.MUcenter', true);
$flag = uc_user_checkname($this->name);
switch ($flag) {
case -1:
$this->addError('name', Yii::t('app', '用户名不合法'));
break;
case -2:
$this->addError('name', Yii::t('app', '包含不允许注册的词语'));
break;
case -3:
$this->addError('name', Yii::t('app', '用户名已经存在'));
break;
}
}
示例4: checkUserExit
/**
* 检测会员是否存在
* @author Vimhui Develop Team
* @param $username 会员名
* @return bool
*/
public function checkUserExit($username,$isreturn=false) {
$ucresult = uc_user_checkname($username);
if($isreturn === true) return $ucresult;
if ($ucresult == 1){
return true;
}
if($ucresult == -1) {
$this->uc_error = 'profile_username_illegal';
return false;
} elseif($ucresult == -2) {
$this->uc_error = 'profile_username_protect';
return false;
} elseif($ucresult == -3) {
$this->uc_error = 'register_check_found';
return false;
}
}
示例5: ajax_check_name
function ajax_check_name()
{
$this->uid != NULL && exit('Acess Denied!');
$this->toclose();
$register = M('user');
if ($register->where(array('name' => $this->post['name']))->count() != 0) {
exit('重新注册<script>$("#tip_mid").html("该用户名已被使用!");
$("#tip").css({left:$("#reg_name").offset().left+100,top:$("#reg_name").offset().top-46});
swing("register_div");</script> ');
} else {
if ($register->where(array('email' => $this->post['email']))->count() != 0) {
exit('重新注册<script>$("#tip_mid").html("该邮箱已被使用!");
$("#tip").css({left:$("#reg_email").offset().left+100,top:$("#reg_email").offset().top-46});
swing("register_div");</script>');
} else {
if ($this->setting['is_invite_register'] == 1 && ($register->where(array('invitecode' => $this->post['invite_val']))->count() == 0 || $register->where(array('invitecode' => $this->post['invite_val']))->getField('invitecount') < 1)) {
exit('重新注册<script>$("#tip_mid").html("该邀请码已失效!");
$("#tip").css({left:$("#invite_code_input").offset().left+100,top:$("#invite_code_input").offset().top-46});
swing("register_div");</script>');
} else {
if ($this->setting['register_code'] == 1 && md5($this->post['code']) != $_SESSION['verify']) {
exit('重新注册<script>$("#tip_mid").html("验证码输入错误!");
$("#tip").css({left:$("#reg_code").offset().left+100,top:$("#reg_code").offset().top-46});
swing("register_div");</script>');
} else {
if ($this->setting['ucenter_on'] == 1) {
if (uc_user_checkemail($this->post['email'] != 1)) {
exit('重新注册<script>$("#tip_mid").html("UC:该邮箱不能注册!");
$("#tip").css({left:$("#reg_email").offset().left+100,top:$("#reg_email").offset().top-46});
swing("register_div");</script>');
} else {
if (uc_user_checkname($this->post['name'] != 1)) {
exit('重新注册<script>$("#tip_mid").html("UC:该用户名不能注册!");
$("#tip").css({left:$("#reg_email").offset().left+100,top:$("#reg_email").offset().top-46});
swing("register_div");</script>');
}
}
}
echo '正在注册...<script>document.register_form.submit();</script>';
}
}
}
}
}
示例6: check_uname
public function check_uname($uname)
{
$ret = uc_user_checkname($this->iconv($uname));
if ($ret > 0) {
return $uname;
} else {
if ($ret == -1) {
$this->err->add('用户名不合法', 281);
} else {
if ($ret == -2) {
$this->err->add('包含要不允许注册的词语', 282);
} else {
if ($ret == -3) {
$this->err->add('用户名已经存在', 283);
}
}
}
}
return false;
}
示例7: doregister
function doregister()
{
$rules = array(array('password', 'require', '密码不能为空!', 1), array('user_realname', 'require', '用户名不能为空!', 1), array('repassword', 'require', '重复密码不能为空!', 1), array('repassword', 'password', '确认密码不正确', 0, 'confirm'));
if (I('post.reg_type') == 1) {
if (!sp_check_verify_code()) {
$this->error("验证码错误!");
}
$_POST['email'] = I('post.username');
array_unshift($rules, array('username', 'require', '邮箱不能为空!', 1), array('email', 'email', '邮箱格式不正确!', 1));
} else {
array_unshift($rules, array('username', 'require', '手机号码不能为空!', 1));
$user_phone = I('post.username');
if (!preg_match('/^[1][3458]{1}[0-9]{9}$/', $user_phone)) {
$this->error('手机号码格式有误');
}
//手机号码格式检测
$check = M('Sms')->field('code,add_time')->where(array('phone' => $user_phone))->order('id desc')->find();
if (empty($_POST['code'])) {
$this->error('验证码不能为空');
}
if (strtolower($check['code']) != strtolower(I('post.code'))) {
$this->error("手机验证码错误");
}
if (time() > $check['add_time'] + 3600) {
$this->error('验证码已过期,请重新获取');
}
}
$users_model = M("Member");
if ($users_model->validate($rules)->create() === false) {
$this->error($users_model->getError());
}
extract($_POST);
//用户名需过滤的字符的正则
/**$stripChar = '?<*.>\'"';
if(preg_match('/['.$stripChar.']/is', $username)==1){
$this->error('用户名中包含'.$stripChar.'等非法字符!');
}
**/
$banned_usernames = explode(",", sp_get_cmf_settings("banned_usernames"));
if (in_array($username, $banned_usernames)) {
$this->error("此用户名禁止使用!");
}
if (strlen($password) < 6 || strlen($password) > 20) {
$this->error("密码长度至少6位,最多20位!");
}
$where['user_login'] = $username;
$where['user_email'] = $email;
// $where['user_realname']=$user_realname;
$where['_logic'] = 'OR';
$ucenter_syn = C("UCENTER_ENABLED");
$uc_checkemail = 1;
$uc_checkusername = 1;
if ($ucenter_syn) {
include UC_CLIENT_ROOT . "client.php";
$uc_checkemail = uc_user_checkemail($email);
$uc_checkusername = uc_user_checkname($username);
}
$users_model = M("Member");
$result = $users_model->where($where)->count();
if ($result || $uc_checkemail < 0 || $uc_checkusername < 0) {
$this->error("用户名或者该邮箱已经存在!");
} else {
$uc_register = true;
if ($ucenter_syn) {
$uc_uid = uc_user_register($username, $password, $email);
//exit($uc_uid);
if ($uc_uid < 0) {
$uc_register = false;
}
}
if ($uc_register) {
$need_email_active = C("SP_MEMBER_EMAIL_ACTIVE");
if ($need_email_active) {
//配置为需要邮件激活时
if (I('post.reg_type') == 1) {
//邮箱注册
$need_email_active = true;
} else {
if (I('post.reg_type') == 2) {
//手机号码注册
$need_email_active = false;
}
}
}
$data = array('user_login' => $username, 'user_email' => $email, 'user_nicename' => $username, 'user_realname' => $user_realname, 'user_pass' => sp_password($password), 'last_login_ip' => get_client_ip(), 'create_time' => date("Y-m-d H:i:s"), 'last_login_time' => date("Y-m-d H:i:s"), 'user_status' => $need_email_active ? 2 : 1, "utype" => 0, 'user_phone' => $user_phone);
$rst = $users_model->add($data);
if ($rst) {
//登入成功页面跳转
$data['id'] = $rst;
//插入我的账户
$account = M("Account");
$ac['uid'] = $rst;
$ac['money'] = get_point_rule('register');
$account->add($ac);
$_SESSION['user'] = $data;
//发送激活邮件
if ($need_email_active) {
$this->_send_to_active();
unset($_SESSION['user']);
$this->success("注册成功,激活后才能使用!", U("user/login/index"));
//.........这里部分代码省略.........
示例8: verify_member_name
/**
* 验证会员名
* Enter description here ...
* @param unknown_type $member_name
*/
function verify_member_name($member_name, $member_id = 0, $identifier = 0, $type, $isUc = 1)
{
$member_name = addslashes(trim(stripslashes($member_name)));
$ret = $this->member_name_auth($member_name);
if ($ret < 0 && $type == 'm2o') {
return $ret;
//-4 超出最大长度 -5 低于最小长度 -6 含有 % @ < > * 特殊符号
} else {
if ($this->member_name_exists($member_name, $member_id, $identifier)) {
return -7;
//用户名存在
} elseif ($this->settings['ucenter']['open'] && $isUc && !$identifier) {
include_once CUR_CONF_PATH . 'uc_client/client.php';
return uc_user_checkname($member_name);
}
}
return 1;
}
示例9: exit
} else {
exit("err");
}
} else {
exit("err");
}
} elseif ($act == 'check_usname') {
require_once QISHI_ROOT_PATH . 'include/fun_user.php';
$usname = trim($_POST['usname']);
if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
$usname = utf8_to_gbk($usname);
}
$user = get_user_inusername($usname);
if (defined('UC_API')) {
include_once QISHI_ROOT_PATH . 'uc_client/client.php';
if (uc_user_checkname($usname) === 1 && empty($user)) {
exit("true");
} else {
exit("false");
}
}
empty($user) ? exit("true") : exit("false");
} elseif ($act == 'check_email') {
require_once QISHI_ROOT_PATH . 'include/fun_user.php';
$email = trim($_POST['email']);
if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
$email = utf8_to_gbk($email);
}
$user = get_user_inemail($email);
if (defined('UC_API')) {
include_once QISHI_ROOT_PATH . 'uc_client/client.php';
示例10: ajax_username
public function ajax_username()
{
$username = isset($_GET['username']) && trim($_GET['username']) ? trim($_GET['username']) : exit('0');
if (CHARSET != 'utf-8') {
$username = iconv('utf-8', CHARSET, $username);
$username = addslashes($username);
}
if ($this->db->get_one(array('username' => $username))) {
exit('0');
} else {
//UCenter部分
if ($this->config['ucuse']) {
pc_base::load_config('uc_config');
include PHPCMS_PATH . 'api/uc_client/client.php';
$rs = uc_user_checkname($username);
if ($rs < 1) {
exit('0');
}
}
exit('1');
}
}
示例11: ShowMsg
$cfg_ml->DelCache($mid);
ShowMsg('操作成功,请重新登录系统!', 'login.php');
exit;
} else {
if ($fmdo == 'user') {
//检查用户名是否存在
if ($dopost == "checkuser") {
AjaxHead();
$msg = '';
$uid = trim($uid);
if ($cktype == 0) {
$msgtitle = '用户笔名';
} else {
#api{{
if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) {
$ucresult = uc_user_checkname($uid);
if ($ucresult > 0) {
echo "<font color='#4E7504'><b>√用户名可用</b></font>";
} elseif ($ucresult == -1) {
echo "<font color='red'><b>×用户名不合法</b></font>";
} elseif ($ucresult == -2) {
echo "<font color='red'><b>×包含要允许注册的词语</b></font>";
} elseif ($ucresult == -3) {
echo "<font color='red'><b>×用户名已经存在</b></font>";
}
exit;
}
#/aip}}
$msgtitle = '用户名';
}
if ($cktype != 0 || $cfg_mb_wnameone == 'N') {
示例12: dsetcookie
dsetcookie('con_auth_hash');
connect_error_output('qqconnect:connect_login_first');
}
$conuin = $connect_guest['conuin'];
$conuinsecret = $connect_guest['conuinsecret'];
if ($conuin && $conuinsecret && $conopenid) {
try {
$connectOAuthClient = Cloud::loadClass('Service_Client_ConnectOAuth');
$connect_user_info = $connectOAuthClient->connectGetUserInfo($conopenid, $conuin, $conuinsecret);
} catch (Exception $e) {
connect_error_output();
}
if ($connect_user_info['nickname']) {
$qq_nick = $connect_user_info['nickname'];
$connect_nickname = $connectService->connectFilterUsername($qq_nick);
}
loaducenter();
$ucresult = uc_user_checkname($connect_nickname);
$first_available_username = '';
if ($ucresult >= 0) {
$first_available_username = $connect_nickname;
}
echo $first_available_username;
}
}
include template('common/footer');
function connect_error_output($error = '')
{
include template('common/footer');
exit;
}
示例13: CheckUsername
function CheckUsername()
{
$username=trim($this->Post['username'] ? $this->Post['username'] : $this->Post['check_value']);
if (strlen($username) < 3 || strlen($username) > 15) {
response_text(__("用户名长度请控制在3~15"));
}
if (($filter_msg = filter($username))) {
response_text("用户名 ".$filter_msg);
}
if (preg_match('~[\~\`\!\@\#\$\%\^\&\*\(\)\=\+\[\{\]\}\;\:\'\"\,\<\.\>\/\?]~',$username)) {
response_text(__("用户名不能包含特殊字符"));
}
$censoruser = ConfigHandler::get('user','forbid');
$censoruser .= "topic
login
member
profile
tag
get_password
report
weather
master
url";
$censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censoruser = trim($censoruser)), '/')).')$/i';
if($censoruser && @preg_match($censorexp, $username)) {
response_text(sprintf(__("用户名<b>%s</b>被保留,禁止注册"), $username));
}
$response= "对不起,您输入的用户名 <B>{$username}</B> 不能注册或已经被他人使用,请选择其他名字后再试。";
$this->DatabaseHandler->SetTable(TABLE_PREFIX. 'system_members');
$is_exists=$this->DatabaseHandler->Select('',"username='{$username}'");
if($is_exists) {
response_text($response);
}
if(true === UCENTER)
{
include_once(UC_CLIENT_ROOT . './client.php');
$uc_result = uc_user_checkname($username);
if($uc_result < 0) {
response_text($response);
}
}
exit ;
}
示例14: user_checkname
static function user_checkname($username)
{
global $kekezu;
if ($kekezu->_sys_config['user_intergration'] == 1) {
$member_obj = new Keke_witkey_member_class();
$member_obj->setWhere('username="' . $username . '"');
$res = $member_obj->count_keke_witkey_member();
$res = $res ? 0 : 1;
} elseif ($kekezu->_sys_config['user_intergration'] == 2) {
require_once S_ROOT . '/uc_client/client.php';
$res = uc_user_checkname($username);
}
return $res;
}
示例15: checkName
static function checkName($username)
{
$checkname = uc_user_checkname();
if ($checkname > 0) {
return TRUE;
} else {
self::$lastAction = 'checkname';
self::$lastErrorCode = $checkname;
return FALSE;
}
}