本文整理匯總了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;
}
}