当前位置: 首页>>代码示例>>PHP>>正文


PHP getpassport函数代码示例

本文整理汇总了PHP中getpassport函数的典型用法代码示例。如果您正苦于以下问题:PHP getpassport函数的具体用法?PHP getpassport怎么用?PHP getpassport使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getpassport函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show_msg

        show_msg('危险!指定的SupeSite数据库已有数据,如果继续将会清空原有数据!', $step + 1);
    } else {
        show_msg('数据库配置成功,进入下一步操作', $step + 1, 1);
    }
} elseif (submitcheck('opensubmit')) {
    //检查用户身份
    $step = 5;
    include_once S_ROOT . './common.php';
    //UC注册用户
    if (!@(include_once S_ROOT . './uc_client/client.php')) {
        showmessage('system_error');
    }
    $uid = uc_user_register($_POST['username'], $_POST['password'], 'webmastor@yourdomain.com');
    if ($uid == -3) {
        //已存在,登录
        if (!($passport = getpassport($_POST['username'], $_POST['password']))) {
            show_msg('输入的用户名密码不正确,请确认');
        }
        $setarr = array('uid' => $passport['uid'], 'username' => addslashes($passport['username']));
    } elseif ($uid > 0) {
        $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;
开发者ID:cwcw,项目名称:cms,代码行数:31,代码来源:index.php

示例2: authUser

 function authUser($username, $password)
 {
     global $_SGLOBAL;
     $username = addslashes(siconv($username, $this->charset, 'UTF-8'));
     $password = addslashes(siconv($password, $this->charset, 'UTF-8'));
     if ($this->member = getpassport($username, $password)) {
         $_SGLOBAL['supe_uid'] = $this->member['uid'];
         $this->member['username'] = addslashes($this->member['username']);
         $_SGLOBAL['supe_username'] = $this->member['username'];
         $_SGLOBAL['timestamp'] = $this->timestamp;
         return true;
     } else {
         $this->sendFault(1, 'Authoried Error.Please check your password.');
     }
 }
开发者ID:NaturalWill,项目名称:UCQA,代码行数:15,代码来源:class_xmlrpc.php

示例3: elseif

        } elseif ($session['errorcount'] <= 3) {
            $cpaccess = 1;
        }
    } else {
        $_SGLOBAL['db']->query("DELETE FROM " . tname('adminsession') . " WHERE uid='{$_SGLOBAL['supe_uid']}' OR dateline+1800<'{$timestamp}'");
        $_SGLOBAL['db']->query("INSERT INTO " . tname('adminsession') . " (uid, ip, dateline, errorcount)\r\n\t\t\tVALUES ('{$_SGLOBAL['supe_uid']}', '" . getonlineip() . "', '{$_SGLOBAL['timestamp']}', '0')");
        $cpaccess = 1;
    }
} else {
    $cpaccess = 2;
}
switch ($cpaccess) {
    case '1':
        //可以登录
        if (submitcheck('loginsubmit')) {
            if (!($passport = getpassport($_SGLOBAL['supe_username'], $_POST['password']))) {
                $_SGLOBAL['db']->query("UPDATE " . tname('adminsession') . " SET errorcount=errorcount+1 WHERE uid='{$_SGLOBAL['supe_uid']}'");
                cpmessage('enter_the_password_is_incorrect', 'admincp.php');
            } else {
                $_SGLOBAL['db']->query("UPDATE " . tname('adminsession') . " SET errorcount='-1' WHERE uid='{$_SGLOBAL['supe_uid']}'");
                $refer = empty($_SCOOKIE['_refer']) ? $_SGLOBAL['refer'] : rawurldecode($_SCOOKIE['_refer']);
                if (empty($refer) || preg_match("/(login)/i", $refer)) {
                    $refer = 'admincp.php';
                }
                ssetcookie('_refer', '');
                showmessage('login_success', $refer, 0);
            }
        } else {
            if ($_SERVER['REQUEST_METHOD'] == 'GET') {
                ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));
            } else {
开发者ID:AlexChien,项目名称:ey_uhome,代码行数:31,代码来源:admincp.php

示例4: template

if ($_SCONFIG['seccode_login']) {
    include_once S_ROOT . './source/function_cp.php';
    if (!ckseccode($_POST['seccode'])) {
        $_SGLOBAL['input_seccode'] = 1;
        include template('do_login');
        exit;
    }
}
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('member') . " WHERE username='{$username}'");
$value = $_SGLOBAL['db']->fetch_array($query);
if (empty($value)) {
    showmessage('login_failure_please_re_login', 'do.php?ac=' . $_SCONFIG['login_action']);
}
$password = $value[2];
//同步获取用户源
if (!($passport = getpassport($username, $password))) {
    showmessage('login_failure_please_re_login', 'do.php?ac=' . $_SCONFIG['login_action']);
}
$setarr = array('uid' => $passport['uid'], 'username' => addslashes($passport['username']), 'password' => md5("{$passport['uid']}|{$_SGLOBAL['timestamp']}"));
include_once S_ROOT . './source/function_space.php';
//开通空间
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid='{$setarr['uid']}'");
if (!($space = $_SGLOBAL['db']->fetch_array($query))) {
    $space = space_open($setarr['uid'], $setarr['username'], 0, $passport['email']);
}
$_SGLOBAL['member'] = $space;
//实名
realname_set($space['uid'], $space['username'], $space['name'], $space['namestatus']);
//检索当前用户
$query = $_SGLOBAL['db']->query("SELECT password FROM " . tname('member') . " WHERE uid='{$setarr['uid']}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_cas_login.php

示例5: tname

    if ($session['errorcount'] == -1) {
        DB::query("UPDATE " . tname('adminsession') . " SET dateline='{$_G['timestamp']}' WHERE uid='{$_G['uid']}'");
        $cpaccess = 2;
    } elseif ($session['errorcount'] <= 3) {
        $cpaccess = 1;
    }
} else {
    DB::query("DELETE FROM " . tname('adminsession') . " WHERE uid='{$_G['uid']}' OR dateline+1800<'{$timestamp}'");
    DB::query("INSERT INTO " . tname('adminsession') . " (uid, ip, dateline, errorcount)\n\t\tVALUES ('{$_G['uid']}', '" . $_G['clientip'] . "', '{$_G['timestamp']}', '0')");
    $cpaccess = 1;
}
switch ($cpaccess) {
    case '1':
        //可以登錄
        if (submitcheck('dologin', 1)) {
            if (!($passport = getpassport($_G['username'], $_POST['admin_password']))) {
                DB::query("UPDATE " . tname('adminsession') . " SET errorcount=errorcount+1 WHERE uid='{$_G['uid']}'");
                showmessage('enter_the_password_is_incorrect', $BASESCRIPT);
            } else {
                DB::query("UPDATE " . tname('adminsession') . " SET errorcount='-1' WHERE uid='{$_G['uid']}'");
                $refer = empty($_G['cookie']['_refer']) ? $_SGLOBAL['refer'] : rawurldecode($_G['cookie']['_refer']);
                if (empty($refer) || preg_match("/(login)/i", $refer)) {
                    $refer = $BASESCRIPT;
                }
                showmessage('login_success', $refer, 0);
            }
        } else {
            if ($_SERVER['REQUEST_METHOD'] == 'GET') {
                ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));
            } else {
                ssetcookie('_refer', rawurlencode($BASESCRIPT));
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:admin.php


注:本文中的getpassport函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。