本文整理汇总了PHP中uc_user_synlogin函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_user_synlogin函数的具体用法?PHP uc_user_synlogin怎么用?PHP uc_user_synlogin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uc_user_synlogin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: dologin
public function dologin()
{
if ($this->user['id']) {
// $this->Redirect('','','',1);
}
$request_name = 'username';
$request_password = 'password';
$request_email = 'email';
$user_name = addslashes($this->input[$request_name]);
$password = addslashes($this->input[$request_password]);
if (!$user_name && !$password) {
$this->ReportError($this->lang['nameerror']);
}
$email = addslashes($this->input[$request_email]);
$member = uc_user_login($user_name, $password);
$timestamp = TIMENOW;
// uid 大于0 登录成功,-1 : 用户不存在,或者被删除 -2:密码错误 其他:未定义
if ($member[0] > 0) {
//同步登录
$ucsynlogin = uc_user_synlogin($member[0]);
hg_set_cookie('user', $member[1], $timestamp + 31536000);
hg_set_cookie('pass', $member[4], $timestamp + 31536000);
hg_set_cookie('member_id', $member[0], $timestamp + 31536000);
$this->Redirect($this->lang['loginsucess'], '', 2, 0, $ucsynlogin);
} else {
$this->ReportError($this->lang['nameerror']);
}
}
开发者ID:h3len,项目名称:Project,代码行数:28,代码来源:login.php
示例2: register
function register()
{
$activeuser = uc_get_user($this->base->post['username']);
if ($activeuser) {
$this->base->message('该用户无需注册,请直接登录!', 'user/login');
}
$uid = uc_user_register($this->base->post['username'], $this->base->post['password'], $this->base->post['email']);
if ($uid <= 0) {
if ($uid == -1) {
$this->base->message('用户名不合法');
} elseif ($uid == -2) {
$this->base->message('包含要允许注册的词语');
} elseif ($uid == -3) {
$this->base->message('用户名已经存在');
} elseif ($uid == -4) {
$this->base->message('Email 格式有误');
} elseif ($uid == -5) {
$this->base->message('Email 不允许注册');
} elseif ($uid == -6) {
$this->base->message('该 Email 已经被注册');
} else {
$this->base->message('未定义');
}
} else {
$_ENV['user']->add($this->base->post['username'], $this->base->post['password'], $this->base->post['email'], $uid);
$_ENV['user']->refresh($uid);
$ucsynlogin = uc_user_synlogin($uid);
$this->base->message('注册成功' . $ucsynlogin . '<br><a href="' . $_SERVER['PHP_SELF'] . '">继续</a>');
}
}
开发者ID:source-hunter,项目名称:tipask,代码行数:30,代码来源:ucenter.class.php
示例3: authenticateUC
public function authenticateUC()
{
//通过接口判断登录帐号的正确性,返回值为数组
list($uid, $username, $password, $email) = uc_user_login($this->username, $this->password);
setcookie('Example_auth', '', -86400);
if ($uid > 0) {
//用户登陆成功,设置 Cookie,加密直接用 uc_authcode 函数,用户使用自己的函数
setcookie('Example_auth', uc_authcode($uid . "\t" . $username, 'ENCODE'));
//生成同步登录的代码
$ucsynlogin = uc_user_synlogin($uid);
$user = User::model()->findByPk($uid);
$this->_id = $user->id;
$this->setState('email', $user->email);
//$this->setState('role', '管理员');
//保存登录记录
$arr = array('uid' => $user->id, 'login_time' => strtotime('NOW'), 'login_ip' => Yii::app()->request->userHostAddress);
$model = new LoginRecord();
$model->attributes = $arr;
$model->save();
$this->errorCode = self::ERROR_NONE;
} elseif ($uid == -1) {
$this->errorCode = self::ERROR_USERNAME_INVALID;
} elseif ($uid == -2) {
$this->errorCode = self::ERROR_PASSWORD_INVALID;
}
return !$this->errorCode;
}
开发者ID:vangogogo,项目名称:justsns,代码行数:27,代码来源:UserIdentity.php
示例4: index
public function index()
{
if ($_REQUEST['uc'] == 1) {
@(include dirname(__FILE__) . '/../../config.inc.php');
if (UC_KEY == "" || UC_API == "") {
exit("登陆失败,请检查uc配置文件config.inc.php");
}
include dirname(__FILE__) . '/../../include/db_mysql.class.php';
include dirname(__FILE__) . '/../../uc_client/client.php';
if (isset($_SESSION['uc_uid'])) {
$ucsynlogin = uc_user_synlogin($_SESSION['uc_uid']);
$this->assign('ucsynclogin', $ucsynlogin);
unset($_SESSION['uc_uid']);
}
}
$user = daocall('user', 'getUser', array(getRole('user')));
$agents = daocall('agent', 'selectList', array());
foreach ($agents as $agent) {
if ($agent['id'] == $user['agent_id']) {
$user['agent_name'] = $agent['name'];
}
}
$login_ip = $_SERVER['REMOTE_ADDR'];
$this->_tpl->assign('login_ip', $login_ip);
$this->_tpl->assign('user', $user);
//$this->pageNewsByNumber();
return $this->_tpl->fetch('user/index.html');
}
开发者ID:srdc2014,项目名称:vhms,代码行数:28,代码来源:user.ctl.php
示例5: userLogin
/**
* 写入UserCookie
* @param int $userid 用户userid
* @param string $username 用户名
* @param int $expire Cookie失效时间
* @param string $md5pass 经过md5加密后的密码(数据库中存储的),整合UC的时候无效
* @return void
*/
public function userLogin($userid, $expire)
{
//补充日期信息
global $king, $action;
$user = $this->infoUser($userid);
kc_setCookie('auth_' . $king->config('userpre', 'user'), $user['authcookie'], $expire);
if ($this->isuc) {
return uc_user_synlogin($user['uid']);
}
return '';
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:19,代码来源:core.class.php
示例6: syncLogin
/**
* 同步登陆ucenter
* @param $event
*/
public static function syncLogin($event)
{
UcenterInterface::getInstance();
$user = $event->identity;
$ucenterUser = self::getUser($user->username);
//同步登陆ucenter
setcookie('Example_auth', '', -86400);
setcookie('Example_auth', uc_authcode($ucenterUser[0] . "\t" . $ucenterUser[1], 'ENCODE'));
$ucsynlogin = uc_user_synlogin($ucenterUser[0]);
//生成同步登录的代码
$script = '登录成功' . $ucsynlogin . '<br><a href="' . $_SERVER['PHP_SELF'] . '">继续</a>';
\Yii::$app->session->setFlash('syn-login-script', "{$script}");
}
开发者ID:buuug7,项目名称:game4039,代码行数:17,代码来源:UcenterUtil.php
示例7: show
public function show()
{
$graph_url = "https://graph.qq.com/oauth2.0/me?access_token=" . $_SESSION['access_token'];
$str = get_url_contents($graph_url);
if (strpos($str, "callback") !== false) {
$lpos = strpos($str, "(");
$rpos = strrpos($str, ")");
$str = substr($str, $lpos + 1, $rpos - $lpos - 1);
}
$user = json_decode($str);
if (isset($user->error)) {
echo "<h3>error:</h3>" . $user->error;
echo "<h3>msg :</h3>" . $user->error_description;
exit;
}
//debug
//echo("Hello " . $user->openid);
//set openid to session
$_SESSION["openid"] = $user->openid;
$get_user_info = "https://graph.qq.com/user/get_user_info?" . "access_token=" . $_SESSION['access_token'] . "&oauth_consumer_key=" . $_SESSION["appid"] . "&openid=" . $_SESSION["openid"] . "&format=json";
$info = get_url_contents($get_user_info);
$arr = json_decode($info, true);
$arr['openid'] = $_SESSION["openid"];
$arr['avatar'] = str_replace('100', '', $arr['figureurl_2']);
/* $arr = array(
'nickname' => 'Yang',
'avatar' => str_replace('100','','http://qzapp.qlogo.cn/qzapp/206523/A2D8AE5184F0453A7F5502463CE6DD0C/100'),
'openid' => 'A2D8AE5184F0453A7F5502463CE6DD0C',
);*/
$member = $this->mUser->qq_login($arr['nickname'], $arr['openid'], $arr['avatar']);
$member['large_avatar'] = $member['avatar'] . '30';
$member['middle_avatar'] = $member['avatar'] . '50';
$member['small_avatar'] = $member['avatar'] . '100';
$timestamp = TIMENOW;
// uid 大于0 登录成功,-1 : 用户不存在,或者被删除 -2:密码错误 其他:未定义
if ($member['id'] > 0) {
//同步登录
$ucsynlogin = uc_user_synlogin($member['id']);
//print_r($ucsynlogin);exit;
hg_set_cookie('user', urldecode($member['username']), $timestamp + 31536000);
hg_set_cookie('pass', $member['password'], $timestamp + 31536000);
hg_set_cookie('member_id', $member['id'], $timestamp + 31536000);
// hg_pre($_COOKIE);exit;
$this->Redirect($this->lang['loginsucess'], '', 2, 0, $ucsynlogin);
} else {
$this->ReportError($this->lang['nameerror']);
}
}
开发者ID:h3len,项目名称:Project,代码行数:48,代码来源:qq_login.php
示例8: zuitu_uc_synlogin
function zuitu_uc_synlogin($email, $pass) {
if (!function_exists('uc_user_login')) return array();
if (!defined('UC_API')) return array();
$isuid = strpos($email, '@') ? 2 : 0;
if (strtolower(UC_CHARSET)!='utf-8') {
$email = mb_convert_encoding($email, UC_CHARSET, 'UTF-8');
}
$ucresult = uc_user_login($email, $pass, $isuid, 0);
$uckey = array( 'uid', 'username', 'password', 'email', 'duplicate' );
$ucresult = array_combine($uckey, $ucresult);
if ($ucresult['uid']>0 ) {
$script_string = uc_user_synlogin($ucresult['uid']);
Session::Set('script', $script_string);
}
DB::Query('SET NAMES UTF8;');
}
开发者ID:noikiy,项目名称:mdwp,代码行数:16,代码来源:uc.php
示例9: API_Login
function API_Login($user, $pass)
{
global $db, $onlineip;
include_once ONEZ_ROOT . './uc_client/client.php';
$api = uc_user_login($user, $pass, 0);
list($uid, $username, $password, $email) = $api;
if ($uid < 0) {
if ($uid == -1) {
return '用户不存在,或者被删除';
} elseif ($uid == -2) {
return '用户名或密码不正确';
} elseif ($uid == -3) {
return '安全提问错';
}
}
if (!$db) {
include_once ONEZ_ROOT . './include/db_mysql.class.php';
db_local();
$db = new onez_db();
}
$db->reset();
if ($db->rows("users", "uid='{$uid}'") == 0) {
//创建本地用户
if ($data = uc_get_user($uid, 1)) {
list($uid, $username, $email) = $data;
$arr = array('uid' => $uid, 'username' => $username, 'password' => md5($pass), 'email' => $email, 'infoip' => $onlineip, 'infotime' => time());
$db->insert('users', $arr);
}
}
$GLOBALS['cookiepre'] = 'onez_';
osetcookie('userid', $uid, 31536000);
osetcookie('username', $username, 31536000);
echo uc_user_synlogin($uid);
echo <<<ONEZ
<p align="center"><br /><br /><br /><br />
<a href="#" onclick="ReLoad()"><font size="2" color="#0000ff">正在同步登录中...</font></a>
</p>
<script type="text/javascript">
function ReLoad(){
top.location.reload();
}
window.onload=ReLoad;
</script>
ONEZ;
exit;
return 'Y';
}
开发者ID:shenhua4286,项目名称:gxw,代码行数:47,代码来源:discuz.php
示例10: login
static function login($username, $password, $isuid = 0)
{
list($uid, $username, $password, $email) = uc_user_login($username, $password, $isuid);
setcookie(self::$authPre . 'auth', '', -86400);
if ($uid > 0) {
self::$uid = $uid;
self::$username = $username;
self::$password = md5($password);
self::$email = $email;
setcookie(self::$authPre . 'auth', uc_authcode($uid . "\t" . $username . "\t" . md5($password) . "\t" . $email, 'ENCODE'));
return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'synlogin' => uc_user_synlogin($uid));
} else {
self::$lastAction = 'login';
self::$lastErrorCode = $uid;
return FALSE;
}
}
开发者ID:zqstudio2015,项目名称:myweiphp,代码行数:17,代码来源:UcApi.php
示例11: UcenterLogin
public function UcenterLogin($data)
{
$db = new dbstuff();
$db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, 0);
list($uid, $username, $email) = uc_get_user($data['username']);
if (is_null($uid)) {
$_data['email'] = $data['email'];
$_data['username'] = $data['username'];
$_data['password'] = $data['password'];
$_data['user_id'] = $data['user_id'];
$uid = self::UcenterReg($_data);
return self::UcenterLogin($data);
} else {
$ucsynlogin = uc_user_synlogin($uid);
}
//var_dump($uid);
return $ucsynlogin;
}
开发者ID:shuai959980629,项目名称:TTDV1,代码行数:18,代码来源:Ucenter_model.php
示例12: login
function login($username, $password, $type = 'g')
{
if (empty($username) || empty($password)) {
return false;
}
$rt = uc_user_login($username . '#' . $type, $password);
$uid = $rt[0];
if ($uid > 0) {
return uc_user_synlogin($uid);
}
switch ($uid) {
case -1:
$return = array('result' => $uid, 'message' => 'user is not exist!!');
break;
case -2:
$return = array('result' => $uid, 'message' => 'wrong password!!');
break;
}
return $return;
}
开发者ID:sjw-github,项目名称:lib,代码行数:20,代码来源:ucClient.ini.php
示例13: create
public function create()
{
$userInfo = array('email' => $this->input['email'], 'username' => $this->input['username'], 'password' => $this->input['password']);
$ret = $this->info->createUser($userInfo);
$user_name = addslashes($this->input['username']);
$password = addslashes($this->input['password']);
$email = addslashes($this->input['email']);
include_once './uclient/client.php';
$member = uc_user_login($user_name, $password);
// uid 大于0 登录成功,-1 : 用户不存在,或者被删除 -2:密码错误 其他:未定义
if ($member[0] > 0) {
//同步登录
$ucsynlogin = uc_user_synlogin($member[0]);
hg_set_cookie('user', $member[1], $timestamp + 31536000);
hg_set_cookie('pass', $member[4], $timestamp + 31536000);
hg_set_cookie('member_id', $member[0], $timestamp + 31536000);
$ret['script'] = $ucsynlogin;
} else {
$this->ReportError($this->lang['nameerror']);
}
echo json_encode($ret);
}
开发者ID:h3len,项目名称:Project,代码行数:22,代码来源:register.php
示例14: on_login
function on_login()
{
global $_G;
empty($mrefreshtime) && ($mrefreshtime = 2000);
if ($_G['uid']) {
$ucsynlogin = uc_user_synlogin($_G['uid']);
$param = array('username' => $_G['member']['username'], 'ucsynlogin' => $ucsynlogin, 'uid' => $_G['member']['uid']);
showmessage('login_succeed', dreferer(), $param, array('showdialog' => 1, 'locationtime' => 1));
}
if (!($_G['member_loginperm'] = logincheck())) {
showmessage('login_strike');
}
if (!submitcheck('loginsubmit', 1)) {
$_G['referer'] = dreferer();
$cookietimecheck = !empty($_G['cookie']['cookietime']) ? 'checked="checked"' : '';
$username = !empty($_G['cookie']['loginuser']) ? htmlspecialchars($_G['cookie']['loginuser']) : '';
include template('member/login');
} else {
$_G['uid'] = $_G['member']['uid'] = 0;
$_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
$result = userlogin($_G['gp_username'], $_G['gp_password'], null, null, 'auto');
if ($result['status'] > 0) {
setloginstatus($result['member'], $_G['gp_cookietime'] ? 2592000 : 0);
$ucsynlogin = uc_user_synlogin($_G['uid']);
$message = 1;
$param = array('username' => $_G['member']['username'], 'ucsynlogin' => $ucsynlogin, 'uid' => $_G['uid']);
showmessage('login_succeed', dreferer(), $param, array('showdialog' => 1, 'locationtime' => 1));
} else {
$password = preg_replace("/^(.{" . round(strlen($_G['gp_password']) / 4) . "})(.+?)(.{" . round(strlen($_G['gp_password']) / 6) . "})\$/s", "\\1***\\3", $_G['gp_password']);
$errorlog = dhtmlspecialchars(TIMESTAMP . "\t" . ($result['ucresult']['username'] ? $result['ucresult']['username'] : dstripslashes($_G['gp_username'])) . "\t" . $password . "\t" . "Ques #" . intval($_G['gp_questionid']) . "\t" . $_G['clientip']);
writelog('illegallog', $errorlog);
loginfailed($_G['member_loginperm']);
$fmsg = $result['ucresult']['uid'] == '-3' ? empty($_G['gp_questionid']) || $answer == '' ? 'login_question_empty' : 'login_question_invalid' : 'login_invalid';
showmessage($fmsg, '', array('loginperm' => $_G['member_loginperm']));
}
}
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:37,代码来源:member_logging.php
示例15: _do_email_login
private function _do_email_login()
{
$username = $_POST['username'];
$password = $_POST['password'];
if (strpos($username, "@") > 0) {
//邮箱登陆
$where['user_email'] = $username;
} else {
$where['user_login'] = $username;
}
$users_model = M('Users');
$result = $users_model->where($where)->find();
$ucenter_syn = C("UCENTER_ENABLED");
$ucenter_old_user_login = false;
$ucenter_login_ok = false;
if ($ucenter_syn) {
setcookie("thinkcmf_auth", "");
include UC_CLIENT_ROOT . "client.php";
list($uc_uid, $username, $password, $email) = uc_user_login($username, $password);
if ($uc_uid > 0) {
if (!$result) {
$data = array('user_login' => $username, 'user_email' => $email, 'user_pass' => sp_password($password), 'last_login_ip' => get_client_ip(0, true), 'create_time' => time(), 'last_login_time' => time(), 'user_status' => '1', 'user_type' => 2);
$id = $users_model->add($data);
$data['id'] = $id;
$result = $data;
}
} else {
switch ($uc_uid) {
case "-1":
//用户不存在,或者被删除
if ($result) {
//本应用已经有这个用户
if (sp_compare_password($password, $result['user_pass'])) {
//本应用已经有这个用户,且密码正确,同步用户
$uc_uid2 = uc_user_register($username, $password, $result['user_email']);
if ($uc_uid2 < 0) {
$uc_register_errors = array("-1" => "用户名不合法", "-2" => "包含不允许注册的词语", "-3" => "用户名已经存在", "-4" => "Email格式有误", "-5" => "Email不允许注册", "-6" => "该Email已经被注册");
$this->error("同步用户失败--" . $uc_register_errors[$uc_uid2]);
}
$uc_uid = $uc_uid2;
} else {
$this->error("密码错误1!");
}
}
break;
case -2:
//密码错
if ($result) {
//本应用已经有这个用户
if (sp_compare_password($password, $result['user_pass'])) {
//本应用已经有这个用户,且密码正确,同步用户
$uc_user_edit_status = uc_user_edit($username, "", $password, "", 1);
if ($uc_user_edit_status <= 0) {
$this->error("登陆错误3!");
}
list($uc_uid2) = uc_get_user($username);
$uc_uid = $uc_uid2;
$ucenter_old_user_login = true;
} else {
$this->error("密码错误4!");
}
} else {
$this->error("密码错误1!");
}
break;
}
}
$ucenter_login_ok = true;
echo uc_user_synlogin($uc_uid);
}
//exit();
if (!empty($result)) {
if (sp_compare_password($password, $result['user_pass']) || $ucenter_login_ok) {
$_SESSION["user"] = $result;
//写入此次登录信息
$data = array('last_login_time' => date("Y-m-d H:i:s"), 'last_login_ip' => get_client_ip(0, true));
$users_model->where("id=" . $result["id"])->save($data);
$redirect = empty($_SESSION['login_http_referer']) ? __ROOT__ . "/" : $_SESSION['login_http_referer'];
$_SESSION['login_http_referer'] = "";
$ucenter_old_user_login_msg = "";
if ($ucenter_old_user_login) {
//$ucenter_old_user_login_msg="老用户请在跳转后,再次登陆";
}
$this->success("登录验证成功!", $redirect);
} else {
$this->error("密码错误7!");
}
} else {
$this->error("用户名不存在!");
}
}
开发者ID:lvxiaolin,项目名称:thinkcfm,代码行数:91,代码来源:LoginController.class.php
示例16: doLogin
public function doLogin()
{
$aUsername = $username = I('post.username', '', 'op_t');
$aPassword = I('post.password', '', 'op_t');
$aVerify = I('post.verify', '', 'op_t');
$aRemember = I('post.remember', 0, 'intval');
/* 检测验证码 */
if (check_verify_open('login')) {
if (!check_verify($aVerify)) {
$res['info'] = "验证码输入错误。";
return $res;
}
}
/* 调用UC登录接口登录 */
check_username($aUsername, $email, $mobile, $aUnType);
if (!check_reg_type($aUnType)) {
$res['info'] = "该类型未开放登录。";
}
$uid = UCenterMember()->login($username, $aPassword, $aUnType);
if (0 < $uid) {
//UC登录成功
/* 登录用户 */
$Member = D('Member');
$args['uid'] = $uid;
$args = array('uid' => $uid, 'nickname' => $username);
check_and_add($args);
if ($Member->login($uid, $aRemember == 1)) {
//登录用户
//TODO:跳转到登录前页面
if (UC_SYNC && $uid != 1) {
//同步登录到UC
$ref = M('ucenter_user_link')->where(array('uid' => $uid))->find();
$html = '';
$html = uc_user_synlogin($ref['uc_uid']);
}
$oc_config = (include_once './OcApi/oc_config.php');
if ($oc_config['SSO_SWITCH']) {
include_once './OcApi/OCenter/OCenter.php';
$OCApi = new \OCApi();
$html = $OCApi->ocSynLogin($uid);
}
$res['status'] = 1;
$res['info'] = $html;
//$this->success($html, get_nav_url(C('AFTER_LOGIN_JUMP_URL')));
} else {
$res['info'] = $Member->getError();
}
} else {
//登录失败
switch ($uid) {
case -1:
$res['info'] = '用户不存在或被禁用!';
break;
//系统级别禁用
//系统级别禁用
case -2:
$res['info'] = '密码错误!';
break;
default:
$res['info'] = $uid;
break;
// 0-接口参数错误(调试阶段使用)
}
}
return $res;
}
开发者ID:chenyongze,项目名称:bighaha,代码行数:66,代码来源:LoginWidget.class.php
示例17: actlogin
public function actlogin()
{
setcookie('LoginCookie', '', time() - 10 * 60, "/");
//uc登陆
$loginconfig = FS("Webconfig/loginconfig");
$uc_mcfg = $loginconfig['uc'];
if ($uc_mcfg['enable'] == 1) {
require_once C('APP_ROOT') . "Lib/Uc/config.inc.php";
require C('APP_ROOT') . "Lib/Uc/uc_client/client.php";
}
//uc登陆
if ($_SESSION['verify'] != md5($_POST['sVerCode'])) {
ajaxmsg("验证码错误!", 0);
}
false !== strpos($_POST['sUserName'], "@") ? $data['user_email'] = text($_POST['sUserName']) : ($data['user_name'] = text($_POST['sUserName']));
$vo = M('members')->field('id,user_name,user_email,user_pass,is_ban')->where($data)->find();
if ($vo['is_ban'] == 1) {
ajaxmsg("您的帐户已被冻结,请联系客服处理!", 0);
}
if (!is_array($vo)) {
//本站登陆不成功,偿试uc登陆及注册本站
if ($uc_mcfg['enable'] == 1) {
list($uid, $username, $password, $email) = uc_user_login(text($_POST['sUserName']), text($_POST['sPassword']));
if ($uid > 0) {
$regdata['txtUser'] = text($_POST['sUserName']);
$regdata['txtPwd'] = text($_POST['sPassword']);
$regdata['txtEmail'] = $email;
$newuid = $this->ucreguser($regdata);
if (is_numeric($newuid) && $newuid > 0) {
$logincookie = uc_user_synlogin($uid);
//UC同步登陆
setcookie('LoginCookie', $logincookie, time() + 10 * 60, "/");
$this->_memberlogin($newuid);
ajaxmsg();
//登陆成功
} else {
ajaxmsg($newuid, 0);
}
}
}
//本站登陆不成功,偿试uc登陆及注册本站
ajaxmsg("用户名或者密码错误!", 0);
} else {
if ($vo['user_pass'] == md5($_POST['sPassword'])) {
//本站登陆成功,uc登陆及注册UC
//uc登陆及注册UC
if ($uc_mcfg['enable'] == 1) {
$dataUC = uc_get_user($vo['user_name']);
if ($dataUC[0] > 0) {
$logincookie = uc_user_synlogin($dataUC[0]);
//UC同步登陆
setcookie('LoginCookie', $logincookie, time() + 10 * 60, "/");
} else {
$uid = uc_user_register($vo['user_name'], $_POST['sPassword'], $vo['user_email']);
if ($uid > 0) {
$logincookie = uc_user_synlogin($dataUC[0]);
//UC同步登陆
setcookie('LoginCookie', $logincookie, time() + 10 * 60, "/");
}
}
}
//uc登陆及注册UC
$this->_memberlogin($vo['id']);
$url_referer = text($_POST['url_referer']);
if (empty($url_referer)) {
$url_referer = session("url_referer");
}
if (empty($url_referer)) {
$url_referer = __APP__ . "/member";
}
session("url_referer", null);
ajaxmsg(array("url_referer" => $url_referer));
} else {
//本站登陆不成功
ajaxmsg("用户名或者密码错误!", 0);
}
}
}
开发者ID:hutao1004,项目名称:yintt,代码行数:78,代码来源:CommonAction.class.php
示例18: urlencode
} else {
$loginUrl = wsq::userloginUrl2($_G['uid']);
}
$referer .= '&loginUrl=' . urlencode($loginUrl);
}
C::t('#qqconnect#common_member_connect')->update($connect_member['uid'], !$_G['setting']['connect']['oauth2'] ? array('conuin' => $conuin, 'conuinsecret' => $conuinsecret, 'conopenid' => $conopenid, 'conisfeed' => 1) : array('conuintoken' => $conuintoken, 'conopenid' => $conopenid, 'conisfeed' => 1));
$params['mod'] = 'login';
connect_login($connect_member);
loadcache('usergroups');
$usergroups = $_G['cache']['usergroups'][$_G['groupid']]['grouptitle'];
$param = array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle']);
C::t('common_member_status')->update($connect_member['uid'], array('lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP));
$ucsynlogin = '';
if ($_G['setting']['allowsynlogin']) {
loaducenter();
$ucsynlogin = uc_user_synlogin($_G['uid']);
}
dsetcookie('stats_qc_login', 3, 86400);
header('location: ' . $referer);
exit;
} else {
header('location: ' . $referer . '&loginErr=1001');
exit;
}
}
function connect_login($connect_member)
{
global $_G;
if (!($member = getuserbyuid($connect_member['uid'], 1))) {
return false;
} else {
开发者ID:samyex6,项目名称:discuz3.2-lite,代码行数:31,代码来源:connect.inc.php
示例19: handdl
function handdl($username, $password, $fs = 1, $rid = 2)
{
$username = addslashes($username);
if (isEmail($username)) {
$dlfs = '2';
} else {
$dlfs = '0';
}
if ($fs == 1) {
$res = uc_user_login($username, $password, $dlfs, 0);
if ($res['0'] <= 0) {
//RES
if ($res['0'] == -1) {
if ($rid != 1) {
return "FALSE";
} else {
$remsg['jg'] = "FALSE";
$remsg['username'] = $username;
$remsg['txt'] = '用户不存在,或者被删除';
return $remsg;
}
} elseif ($res['0'] == -2) {
if ($rid != 1) {
return "FALSE";
} else {
$remsg['jg'] = "FALSE";
$remsg['username'] = $username;
$remsg['txt'] = '密码错';
return $remsg;
}
} else {
if ($rid != 1) {
return "FALSE";
} else {
$remsg['jg'] = "FALSE";
$remsg['username'] = $username;
$remsg['txt'] = '未定义';
return $remsg;
}
}
//RES
} else {
$uid = $res['0'];
$username = $res['1'];
$uemail = $res['3'];
echo uc_user_synlogin($uid);
if ($rid != 1) {
return 'TRUE';
} else {
$remsg['jg'] = "TRUE";
$remsg['uid'] = $uid;
$remsg['username'] = $username;
$remsg['email'] = $uemail;
$remsg['txt'] = '登陆成功';
return $remsg;
}
}
} else {
if ($fs == 2) {
if ($dlfs == '2') {
include "../BTSUHAND/dorun/Run_Mysql.php";
$sqluc = mysql_query("SELECT `uid`,`username` FROM `pre_ucenter_members` WHERE `email`='" . $username . "' ", $linka);
if (empty($sqluc)) {
$remsg['jg'] = "FALSE";
$remsg['username'] = $username;
$remsg['txt'] = '用户不存在';
return $remsg;
}
$infouc = mysql_fetch_object($sqluc);
if ($infouc == "") {
$remsg['jg'] = "FALSE";
$remsg['username'] = $username;
$remsg['txt'] = '用户不存在';
return $remsg;
}
if (!isset($infouc->uid)) {
$remsg['jg'] = "FALSE";
$remsg['username'] = $username;
$remsg['txt'] = '用户不存在';
return $remsg;
}
$username = $infouc->username;
}
if ($data = uc_get_user($username)) {
//list($uid, $username, $email) = $data;
$uid = $data['0'];
echo uc_user_synlogin($uid);
if ($rid != 1) {
return "TRUE";
} else {
$remsg['jg'] = "TRUE";
$remsg['uid'] = $uid;
$remsg['username'] = $username;
$remsg['email'] = 'cant';
$remsg['txt'] = '登陆成功';
return $remsg;
}
} else {
if ($rid != 1) {
return "FALSE";
//.........这里部分代码省略.........
开发者ID:BTSnowball,项目名称:BTSnowball_Users_Hand,代码行数:101,代码来源:hand.php
示例20: uc_user_synlogin
}
if (!preg_match('/^[A-z]\\w+?$/', $_G['setting']['reginput']['password'])) {
$_G['setting']['reginput']['password'] = 'password';
}
if (!preg_match('/^[A-z]\\w+?$/', $_G['setting']['reginput']['password2'])) {
$_G['setting']['reginput']['password2'] = 'password2';
}
if (!preg_match('/^[A-z]\\w+?$/', $_G['setting']['reginput']['email'])) {
$_G['setting']['reginput']['email'] = 'email';
}
$_G['gp_username'] = $_G['gp_' . $_G['setting']['reginput']['username']];
$_G['gp_password'] = $_G['gp_' . $_G['setting']['reginput']['password']];
$_G['gp_password2'] = $_G['gp_' . $_G['setting']['reginput']['password2']];
$_G['gp_email'] = $_G['gp_' . $_G['setting']['reginput']['email']];
if ($_G['uid']) {
$ucsynlogin = $_G['setting']['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
showmessage('login_succeed', 'forum.php', array('username' => $_G['member']['username'], 'uid' => $_G['uid']), array('extrajs' => $ucsynlogin));
} elseif (!$_G['setting']['regstatus'] || !$_G['setting']['ucactivation']) {
if ($_G['gp_action'] == 'activation' || $_G['gp_activationauth']) {
if (!$_G['setting']['ucactivation'] && !$_G['setting']['closedallowactivation']) {
showmessage('register_disable_activation');
}
} elseif (!$_G['setting']['regstatus']) {
showmessage(!$_G['setting']['regclosemessage'] ? 'register_disable' : str_replace(array("\r", "\n"), '', $_G['setting']['regclosemessage']));
}
}
$inviteconfig = array();
$query = DB::query("SELECT * FROM " . DB::table('common_setting') . " WHERE skey IN ('bbrules', 'bbrulesforce', 'bbrulestxt', 'welcomemsg', 'welcomemsgtitle', 'welcomemsgtxt', 'inviteconfig')");
while ($setting = DB::fetch($query)) {
${$setting}['skey'] = $setting['svalue'];
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:member_register.php
注:本文中的uc_user_synlogin函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论