本文整理汇总了PHP中member::login方法的典型用法代码示例。如果您正苦于以下问题:PHP member::login方法的具体用法?PHP member::login怎么用?PHP member::login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类member
的用法示例。
在下文中一共展示了member::login方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_mode_login
/**
* Login
*
* @param array $gpc - contains $gpc['username'] and $gpc['password']
*
*/
public function process_mode_login($gpc)
{
# validation on controller
if (empty($gpc['username'])) {
throw new e_user_input("Blank username");
}
if (empty($gpc['password'])) {
throw new e_user_input("Blank password");
}
# login the session user class
if (member::login($gpc['username'], $gpc['password']) instanceof member) {
add::redirect(add::config()->path);
}
}
示例2: member
if ($submit) {
require DT_ROOT . '/include/post.func.php';
require DT_ROOT . '/module/member/member.class.php';
$do = new member();
if (!$username) {
wap_msg($L['type_username']);
}
if (!$password) {
wap_msg($L['type_password']);
}
if (strpos($username, '@') !== false) {
$r = $db->get_one("SELECT username FROM {$DT_PRE}member WHERE email='{$username}'");
$r or wap_msg($L['not_email']);
$username = $r['username'];
}
$user = $do->login($username, $password, 86400 * 365);
if ($user) {
wap_msg($L['login_success'], $forward ? $forward : 'index.php');
} else {
wap_msg($do->errmsg);
}
} else {
$head_title = $L['member_login'] . $DT['seo_delimiter'] . $head_title;
include template('login', $TP);
}
break;
case 'logout':
set_cookie('auth', '');
wap_msg($L['logout_success'], 'index.php');
break;
case 'charge':
示例3: decrypt
return preg_match("/^[0-9a-zA-Z_]{10,}\$/", $openid);
}
if ($action == 'login') {
$openid = get_cookie('weixin_openid');
if ($openid) {
$openid = decrypt($openid, DT_KEY . 'WXID');
}
if (is_openid($openid)) {
$r = $db->get_one("SELECT username FROM {$DT_PRE}weixin_user WHERE openid='{$openid}'");
if ($r && $r['username']) {
include load('member.lang');
$MOD = cache_read('module-2.php');
include DT_ROOT . '/include/module.func.php';
include DT_ROOT . '/module/member/member.class.php';
$do = new member();
$user = $do->login($r['username'], '', 0, true);
set_cookie('weixin_openid', '');
}
$url = get_cookie('weixin_url');
dheader($url ? $url : 'my.php');
}
} else {
if ($action == 'bind') {
$openid = get_cookie('weixin_openid');
if ($openid) {
$openid = decrypt($openid, DT_KEY . 'WXID');
}
if ($_userid && is_openid($openid)) {
$r = $db->get_one("SELECT itemid FROM {$DT_PRE}weixin_user WHERE username='{$_username}'");
if (!$r) {
$r = $db->get_one("SELECT username FROM {$DT_PRE}weixin_user WHERE openid='{$openid}'");
示例4: VALUES
if ($MOD['welcome_message'] || $MOD['welcome_email']) {
$title = $L['register_msg_welcome'];
$content = ob_template('welcome', 'mail');
if ($MOD['welcome_message']) {
send_message($username, $title, $content);
}
if ($MOD['welcome_email'] && $DT['mail_type'] != 'close') {
send_mail($email, $title, $content);
}
}
if ($MOD['vmember'] && $MOD['vemail']) {
$db->query("INSERT INTO {$DT_PRE}validate (type,username,ip,addtime,status,title,editor,edittime) VALUES ('email','{$username}','{$DT_IP}','{$DT_TIME}','3','{$email}','system','{$DT_TIME}')");
}
require MD_ROOT . '/member.class.php';
$do = new member();
$do->login($username, '', 0, true);
message($L['send_check_success'], $MOD['linkurl']);
} else {
if ($DT['mail_type'] == 'close') {
message($L['send_mail_close']);
}
if ($MOD['checkuser'] != 2) {
dheader(DT_PATH);
}
if ($submit) {
captcha($captcha);
check_name($username) or message($L['send_check_username_bad']);
$user = userinfo($username);
if ($user) {
if ($user['groupid'] != 4) {
dalert($L['send_check_deny'], DT_PATH);
示例5: message
if ($option == 'username' || $option == 'passport') {
$passport = $username;
if ($option == 'username' && $MOD['passport']) {
$r = $db->get_one("SELECT username FROM {$DT_PRE}member WHERE `passport`='{$username}'");
if ($r) {
$username = $r['username'];
}
}
} else {
message($L['login_msg_not_member']);
}
}
if ($MOD['passport'] == 'uc') {
include DT_ROOT . '/api/' . $MOD['passport'] . '.inc.php';
}
$user = $do->login($username, $password, $cookietime);
if ($user) {
if ($MOD['passport'] && $MOD['passport'] != 'uc') {
$api_url = '';
$user['password'] = is_md5($password) ? $password : md5($password);
//Once MD5
if (strtoupper($MOD['passport_charset']) != DT_CHARSET) {
$user = convert($user, DT_CHARSET, $MOD['passport_charset']);
}
extract($user);
include DT_ROOT . '/api/' . $MOD['passport'] . '.inc.php';
if ($api_url) {
$forward = $api_url;
}
}
#if($MOD['sso']) include DT_ROOT.'/api/sso.inc.php';
示例6: captcha
$DT['captcha_admin'] = 0;
}
if ($submit) {
captcha($captcha, $DT['captcha_admin']);
if (!$username) {
msg('请输入用户名');
}
if (!$password) {
msg('请输入密码');
}
include load('member.lang');
$MOD = cache_read('module-2.php');
require DT_ROOT . '/include/module.func.php';
require DT_ROOT . '/module/member/member.class.php';
$do = new member();
$user = $do->login($username, $password);
if ($user) {
if ($user['groupid'] != 1 || $user['admin'] < 1) {
msg('您无权限访问后台', $MODULE[2]['linkurl'] . 'logout.php?forward=' . urlencode(DT_PATH));
}
if ($user['userid'] != $CFG['founderid']) {
if ($DT['admin_week'] && !check_period(',' . $DT['admin_week']) || $DT['admin_hour'] && !check_period($DT['admin_hour'])) {
set_cookie('auth', '');
dalert('未被允许的管理时间', $MODULE[2]['linkurl'] . 'logout.php?forward=' . urlencode(DT_PATH));
}
}
if ($CFG['authadmin'] == 'cookie') {
set_cookie($secretkey, $user['userid']);
} else {
$_SESSION[$secretkey] = $user['userid'];
}
示例7: alert
} else {
alert($member->erromsg, $console->_j_web_set['main_path'] . "/");
exit;
}
break;
case "remove":
if (!$member->remove($_GET["row"], $_GET["data"])) {
alert($member->erromsg, -1);
}
break;
default:
if ($member->status()) {
linkto($console->_j_web_set['main_path'] . "/member/detail");
}
if ($_POST) {
if ($member->login($_POST["account"], $_POST["password"])) {
/*先清除原有購物車內容*/
$shopping_car = new order($console->conn, PREFIX . "shopping_car", PREFIX . "shopping_car_list", PREFIX . "products");
$temp_del = $shopping_car->car_list();
if ($temp_del) {
$temp_id_str = '';
foreach ($temp_del as $k => $v) {
if ($temp_id_str != '') {
$temp_id_str .= ',';
}
$temp_id_str .= $v["shopping_car_list_id"];
}
$shopping_car->car_remove($temp_id_str);
}
if ($_SESSION["login_page"]) {
//-判斷有否暫存頁面
示例8: isset
if ($ck != 'screen') {
set_cookie('mobile', 'screen', $DT_TIME + 86400 * 30);
}
} else {
if (strpos($DT_URL, 'action=sync&auth=') !== false && strpos($DT_URL, 'goto=') !== false) {
if ($DT_MOB['os'] == 'ios') {
isset($auth) or $auth = '';
$auth = decrypt($auth, DT_KEY . 'SCREEN');
if ($auth) {
$arr = explode('|', $auth);
if (check_name($arr[0]) && $_username != $arr[0] && $DT_IP == $arr[1] && $DT_TIME - $arr[2] < 600) {
include load('member.lang');
$MOD = cache_read('module-2.php');
include DT_ROOT . '/module/member/member.class.php';
$do = new member();
$user = $do->login($arr[0], '', 0, true);
}
}
$tmp = explode('goto=', $DT_URL);
$goto = $tmp[1];
if (preg_match("/^[a-z0-9_\\.\\?\\&\\=\\-]{5,}\$/", $goto)) {
if (strpos($goto, '://') === false) {
$goto = $MODULE[2]['linkurl'] . $goto;
}
$url = $goto;
}
}
dheader($url);
}
if ($ck != 'pc') {
if (preg_match("/(iPhone|iPod|Android)/i", $_SERVER['HTTP_USER_AGENT'])) {