• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP userlogin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dbconn

/**
 * Connect to the database and load user details
 *
 * @param $autoclean
 *   (optional) boolean - Check whether or not to run cleanup (default: false)
 */
function dbconn($autoclean = false)
{
    global $mysql_host, $mysql_user, $mysql_pass, $mysql_db, $THEME, $LANGUAGE, $LANG, $site_config;
    $THEME = $LANGUAGE = null;
    if (!ob_get_level()) {
        if (extension_loaded('zlib') && !ini_get('zlib.output_compression')) {
            ob_start('ob_gzhandler');
        } else {
            ob_start();
        }
    }
    header("Content-Type: text/html;charset={$site_config['CHARSET']}");
    function_exists("mysql_connect") or die("MySQL support not available.");
    @mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die('DATABASE: mysql_connect: ' . mysql_error());
    @mysql_select_db($mysql_db) or die('DATABASE: mysql_select_db: ' . mysql_error());
    unset($mysql_pass);
    //security
    userlogin();
    //Get user info
    //Get language and theme
    $CURUSER = $GLOBALS["CURUSER"];
    $ss_a = mysql_fetch_assoc(SQL_Query_exec("select uri from stylesheets where id='" . ($CURUSER ? $CURUSER['stylesheet'] : $site_config['default_theme']) . "'"));
    $THEME = $ss_a["uri"];
    $lng_a = mysql_fetch_assoc(SQL_Query_exec("select uri from languages where id='" . ($CURUSER ? $CURUSER['language'] : $site_config['default_language']) . "'"));
    $LANGUAGE = $lng_a["uri"];
    require_once "languages/{$LANGUAGE}";
    if ($autoclean) {
        autoclean();
    }
}
开发者ID:Arkhana,项目名称:TorrentTrader2.08,代码行数:36,代码来源:functions.php


示例2: processsubmission

function processsubmission()
{
    global $logged_in, $user, $HTTP_POST_VARS, $list_prefix, $HTTP_GET_VARS, $MAIN;
    //lets make sure anonymous requests are accepted as "logged in".
    if (isset($HTTP_POST_VARS['anonymous'])) {
        $logged_in = 1;
        $email = 'anonymous';
        $username = 'anonymous';
    } else {
        $email = $user['email'];
        $username = $user['username'];
    }
    //lets accept request from users who are not cookied but are logging in.
    if (!$logged_in && isset($HTTP_POST_VARS['user'])) {
        $user = userlogin($HTTP_POST_VARS['user'], $HTTP_POST_VARS['pass'], $HTTP_POST_VARS['automatic']);
        if (0 != strcmp($user['email'], "anonymous")) {
            $logged_in = 1;
            $email = $user['email'];
            $username = $user['username'];
        }
    }
    //lets see if our user is logged in
    if (!$logged_in) {
        //if our user is not logged in we will redo the form for them with the data pre-entered.
        submissionform_redo();
    } else {
        //if they are logged in we will process the request.
        $req_date = time();
        if (!is_numeric($HTTP_GET_VARS['request'])) {
            die("HACKING ATTEMPT");
        }
        //we need to find out what the next id number is, add one to it, and then add it to the sql insert.
        $sql = "SELECT * FROM " . $list_prefix . "praise_list ORDER BY `id` DESC;";
        $result = db_query($sql);
        if ($result) {
            $rows = db_num_rows($result);
        } else {
            $rows = 0;
        }
        if ($rows > 0) {
            $row = db_fetch_array($result);
            $idval = $row['id'] + 1;
        } else {
            $idval = 1;
        }
        //lets do the sql insert
        $sql = "INSERT INTO " . $list_prefix . "praise_list (id, request, praise, postdate, left_by, username) VALUES ('" . $idval . "', '" . $HTTP_GET_VARS['request'] . "', '" . $HTTP_POST_VARS['praise'] . "', '" . $req_date . "',  '" . addslashes($email) . "', '" . $username . "');";
        $result = db_query($sql);
        if ($result) {
            $CONTENT = "Your praise been processed.<BR>\r\n";
        } else {
            $CONTENT = "ERROR: the server was unable to process your praise at this time.<BR>\r\n";
            $CONTENT .= "The SQL query was: " . $sql . "<BR>\r\n";
        }
        $WORK = insert_into_template($MAIN, "{CONTENT}", $CONTENT);
        $WORK = filltemplate($WORK, "Leave Praise");
        printf("%s", striptemplate($WORK));
    }
}
开发者ID:BackupTheBerlios,项目名称:fishcms-svn,代码行数:59,代码来源:leavepraise.php


示例3: checkuser

function checkuser()
{
    if ($_SESSION['user_status'] == true) {
        $array = ['user_id' => $_SESSION['user_id'], 'user_status' => $_SESSION['user_status'], 'name' => $_SESSION['myname'], 'propic' => $_SESSION['propic']];
        return json_encode($array);
    } else {
        userlogin();
        $array = ['user_id' => $_SESSION['user_id'], 'user_status' => $_SESSION['user_status'], 'name' => $myname, 'propic' => $propic];
        return json_encode($array);
    }
}
开发者ID:kevinjxliu,项目名称:helius,代码行数:11,代码来源:ustatus.php


示例4: login

 public function login()
 {
     global $_G;
     $validate_error = array();
     //数据验证
     $validate_error_rules = $this->rules();
     if ($validate_error_rules !== true) {
         return $validate_error_rules;
     }
     require_once libfile('function/member');
     $input_email = $_POST['email'];
     $input_password = $_POST['password'];
     $input_rememberme = $_POST['rememberme'];
     if (!($_G['member_loginperm'] = logincheck($input_email))) {
         $validate_error['password'] = '密码错误次数过多,请 15 分钟后重新登录';
         return $validate_error;
     }
     $result = userlogin($input_email, $input_password, 0, 0, 'email', $_G['clientip']);
     if ($result['status'] <= 0) {
         $password = preg_replace("/^(.{" . round(strlen($input_password) / 4) . "})(.+?)(.{" . round(strlen($input_password) / 6) . "})\$/s", "\\1***\\3", $input_password);
         $errorlog = dhtmlspecialchars(TIMESTAMP . "\t" . ($result['ucresult']['username'] ? $result['ucresult']['username'] : $input_email) . "\t" . $password . "\t" . "Ques #" . intval($_GET['questionid']) . "\t" . $_G['clientip']);
         writelog('illegallog', $errorlog);
         loginfailed($input_email);
         failedip();
         if ($_G['member_loginperm'] > 1) {
             $loginperm = $_G['member_loginperm'] - 1;
             $validate_error['password'] = '密码错误,您还可以尝试 ' . $loginperm . ' 次';
             return $validate_error;
         } elseif ($_G['member_loginperm'] == -1) {
             $validate_error['password'] = '抱歉,您输入的密码有误';
             return $validate_error;
         } else {
             $validate_error['password'] = '密码错误次数过多,请 15 分钟后重新登录';
             return $validate_error;
         }
     } else {
         setloginstatus($result['member'], $_GET['rememberme'] ? 2592000 : 0);
         //是否记住密码,自动登录
         if ($_G['member']['lastip'] && $_G['member']['lastvisit']) {
             dsetcookie('lip', $_G['member']['lastip'] . ',' . $_G['member']['lastvisit']);
         }
         C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'port' => $_G['remoteport'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP));
         $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
         //是否Ucenter同步登录
         return true;
     }
 }
开发者ID:thinfell,项目名称:dii,代码行数:47,代码来源:UserLogin.php


示例5: dbconn

function dbconn($autoclean = false)
{
    global $mysql_host, $mysql_user, $mysql_pass, $mysql_db;
    if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass)) {
        switch (mysql_errno()) {
            case 1040:
            case 2002:
                if ($_SERVER['REQUEST_METHOD'] == "GET") {
                    die("<html><head><meta http-equiv='refresh' content=\"5 {$_SERVER['REQUEST_URI']}\"></head><body><table border='0' width='100%' height='100%'><tr><td><h3 align='center'>The server load is very high at the moment. Retrying, please wait...</h3></td></tr></table></body></html>");
                } else {
                    die("Too many users. Please press the Refresh button in your browser to retry.");
                }
            default:
                die("[" . mysql_errno() . "] dbconn: mysql_connect: " . mysql_error());
        }
    }
    mysql_select_db($mysql_db) or die('dbconn: mysql_select_db: ' . mysql_error());
    userlogin();
    if ($autoclean) {
        register_shutdown_function("autoclean");
    }
}
开发者ID:CtrlSystem,项目名称:biotorrents,代码行数:22,代码来源:bittorrent.php


示例6: 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


示例7: check_user_login

 function check_user_login()
 {
     global $_G;
     $admin_username = isset($_POST['admin_username']) ? trim($_POST['admin_username']) : '';
     if ($admin_username != '') {
         require_once libfile('function/member');
         if (logincheck($_POST['admin_username'])) {
             if ((empty($_POST['admin_questionid']) || empty($_POST['admin_answer'])) && $_G['config']['admincp']['forcesecques']) {
                 $this->do_user_login();
             }
             $result = userlogin($_POST['admin_username'], $_POST['admin_password'], $_POST['admin_questionid'], $_POST['admin_answer']);
             if ($result['status'] == 1) {
                 $cpgroupid = DB::result_first("SELECT uid FROM " . DB::table('common_admincp_member') . " WHERE uid='{$result['member']['uid']}'");
                 if ($cpgroupid || $this->checkfounder($result['member'])) {
                     DB::insert('common_admincp_session', array('uid' => $result['member']['uid'], 'adminid' => $result['member']['adminid'], 'panel' => $this->panel, 'dateline' => TIMESTAMP, 'ip' => $this->core->var['clientip'], 'errorcount' => -1), false, true);
                     setloginstatus($result['member'], 0);
                     dheader('Location: ' . ADMINSCRIPT . '?' . cpurl('url', array('sid')));
                 } else {
                     $this->cpaccess = -2;
                 }
             } else {
                 loginfailed($_POST['admin_username']);
             }
         } else {
             $this->cpaccess = -4;
         }
     }
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:28,代码来源:class_admincp.php


示例8: dbconn

function dbconn($do_clean = false)
{
    global $dbhost, $dbuser, $dbpass, $database, $language;
    if ($GLOBALS['persist']) {
        $conres = $GLOBALS["___mysqli_ston"] = mysqli_connect($dbhost, $dbuser, $dbpass);
    } else {
        $conres = $GLOBALS["___mysqli_ston"] = mysqli_connect($dbhost, $dbuser, $dbpass);
    }
    if (!$conres) {
        switch (is_object($GLOBALS["___mysqli_ston"]) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)) {
            case 1040:
            case 2002:
                if ($_SERVER['REQUEST_METHOD'] == 'GET') {
                    die('<html><head><meta http-equiv=refresh content="20;' . $_SERVER['REQUEST_URI'] . '"></head><body><table border="0" width="100%" height="100%"><tr><td><h3 align="center">' . $language['ERR_SERVER_LOAD'] . '</h3></td></tr></table></body></html>');
                }
                die($language['ERR_CANT_CONNECT']);
            default:
                die('[' . (is_object($GLOBALS["___mysqli_ston"]) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)) . '] dbconn: mysql_connect: ' . (is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
        }
    }
    if ($GLOBALS["charset"] == "UTF-8") {
        do_sqlquery("SET NAMES utf8");
    }
    (bool) mysqli_query($GLOBALS["___mysqli_ston"], "USE {$database}") or die($language['ERR_CANT_OPEN_DB'] . ' ' . $database . ' - ' . (is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
    userlogin();
    if ($do_clean) {
        register_shutdown_function('cleandata');
    }
}
开发者ID:Karpec,项目名称:gizd,代码行数:29,代码来源:functions.php


示例9: login

function login()
{
    /*{{{*/
    require_once dirname(dirname(dirname(__FILE__))) . '/bigappjson.class.php';
    $username = isset($_REQUEST["username"]) ? $_REQUEST["username"] : "";
    $password = isset($_REQUEST["password"]) ? $_REQUEST["password"] : "";
    global $_G;
    $_GET['username'] = $username;
    $_GET['password'] = $password;
    ////////////////////////////////////////////
    //$_GET['questionid'] = $_GET['answer'] = '';
    if (isset($_REQUEST['questionid'])) {
        $questionid = intval($_REQUEST['questionid']);
    } else {
        $questionid = 0;
    }
    if (isset($_REQUEST['answer'])) {
        $answer = $_REQUEST['answer'];
    } else {
        $answer = '';
    }
    if (function_exists('iconv')) {
        $userName = iconv('UTF-8', CHARSET . '//ignore', $username);
        $answer = iconv('UTF-8', CHARSET . '//ignore', $answer);
    } else {
        $userName = mb_convert_encoding($username, CHARSET, 'UTF-8');
        $answer = mb_convert_encoding($answer, CHARSET, 'UTF-8');
    }
    ////////////////////////////////////////////
    $_GET['loginfield'] = 'username';
    require_once libfile('function/member');
    require_once libfile('class/member');
    require_once libfile('function/misc');
    require_once libfile('function/mail');
    loaducenter();
    if (!($_G['member_loginperm'] = logincheck($userName))) {
        echo BIGAPPJSON::encode(array('error_code' => 3, 'error_msg' => lang('plugin/bigapp', 'too_many_errors'), 'Variables' => array('auth' => null), 'Message' => array('messageval' => 'for comaptible', 'messagestr' => lang('plugin/bigapp', 'too_many_errors'))));
        die(0);
    }
    $result = userlogin($userName, $password, $questionid, $answer, 'username', $_G['clientip']);
    if ($result['ucresult']['uid'] == '-3') {
        echo BIGAPPJSON::encode(array('error_code' => 9, 'error_msg' => lang('plugin/bigapp', 'user_seq_question'), 'Variables' => array('auth' => null), 'Message' => array('messageval' => 'for comaptible', 'messagestr' => lang('plugin/bigapp', 'user_seq_question'))));
        die(0);
    }
    $uid = $_G['uid'] = $result['ucresult']['uid'];
    $userName = $result['ucresult']['username'];
    $userAvatar = avatar($_G['uid'], 'big', true);
    $userAvatar = str_replace("\r", '', $userAvatar);
    $userAvatar = str_replace("\n", '', $userAvatar);
    $ctlObj = new logging_ctl();
    $ctlObj->setting = $_G['setting'];
    if ($result['status'] == -1) {
        if (!$ctlObj->setting['fastactivation']) {
            echo BIGAPPJSON::encode(array('error_code' => 5, 'error_msg' => lang('plugin/bigapp', 'activate_first'), 'Variables' => array('auth' => null), 'Message' => array('messageval' => 'for comaptible', 'messagestr' => lang('plugin/bigapp', 'login_failed'))));
            die(0);
        }
        $init_arr = explode(',', $ctlObj->setting['initcredits']);
        $groupid = $ctlObj->setting['regverify'] ? 8 : $ctlObj->setting['newusergroupid'];
        C::t('common_member')->insert($uid, $result['ucresult']['username'], md5(random(10)), $result['ucresult']['email'], $_G['clientip'], $groupid, $init_arr);
        $result['member'] = getuserbyuid($uid);
        $result['status'] = 1;
    }
    if ($result['status'] > 0) {
        if ($ctlObj->extrafile && file_exists($ctlObj->extrafile)) {
            require_once $ctlObj->extrafile;
        }
        setloginstatus($result['member'], $_GET['cookietime'] ? 2592000 : 0);
        checkfollowfeed();
        C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP));
        if (isset($result['member']['password'])) {
            unset($result['member']['password']);
        }
        if (isset($result['member']['credits'])) {
            unset($result['member']['credits']);
        }
        /////////////////////////////////////////////////
        // 登录成功,进行绑定
        $plat = $_GET["platform"];
        if ($plat == "qq") {
            include_once CUR_PATH . "/../qqconnect/bind.php";
        } else {
            if ($plat == 'wechat') {
                include_once CUR_PATH . "/../wechatconnect/bind.php";
            }
        }
        /////////////////////////////////////////////////
        echo BIGAPPJSON::encode(array('error_code' => 0, 'error_msg' => lang('plugin/bigapp', 'bind_succ'), 'data' => $result['member'], 'Message' => array('messageval' => 'login_succeed', 'messagestr' => lang('plugin/bigapp', 'bind_succ')), 'Variables' => array('auth' => 'in order to be comapatible')));
        die(0);
    }
    if ($_G['member_loginperm'] > 1) {
        echo BIGAPPJSON::encode(array('error_code' => 6, 'error_msg' => lang('plugin/bigapp', 'login_failed'), 'Variables' => array('auth' => null), 'Message' => array('messageval' => 'for comaptible', 'messagestr' => lang('plugin/bigapp', 'login_failed'))));
    } elseif ($_G['member_loginperm'] == -1) {
        echo BIGAPPJSON::encode(array('error_code' => 7, 'error_msg' => lang('plugin/bigapp', 'error_password'), 'Variables' => array('auth' => null), 'Message' => array('messageval' => 'for comaptible', 'messagestr' => lang('plugin/bigapp', 'error_password'))));
    } else {
        echo BIGAPPJSON::encode(array('error_code' => 8, 'error_msg' => lang('plugin/bigapp', 'too_many_errors'), 'Variables' => array('auth' => null), 'Message' => array('messageval' => 'for comaptible', 'messagestr' => lang('plugin/bigapp', 'too_many_errors'))));
    }
    die(0);
}
开发者ID:Mushan3420,项目名称:BigApp-PHP7,代码行数:98,代码来源:platform_login.php


示例10: on_login

 function on_login()
 {
     global $_G;
     if ($_G['uid']) {
         $referer = dreferer();
         $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
         $param = array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['member']['uid']);
         showmessage('login_succeed', $referer ? $referer : './', $param, array('showdialog' => 1, 'locationtime' => true, 'extrajs' => $ucsynlogin));
     }
     $from_connect = $this->setting['connect']['allow'] && !empty($_GET['from']) ? 1 : 0;
     $seccodecheck = $from_connect ? false : $this->setting['seccodestatus'] & 2;
     $seccodestatus = !empty($_GET['lssubmit']) ? false : $seccodecheck;
     $invite = getinvite();
     if (!submitcheck('loginsubmit', 1, $seccodestatus)) {
         $auth = '';
         $username = !empty($_G['cookie']['loginuser']) ? dhtmlspecialchars($_G['cookie']['loginuser']) : '';
         if (!empty($_GET['auth'])) {
             list($username, $password, $questionexist) = explode("\t", authcode($_GET['auth'], 'DECODE'));
             $username = dhtmlspecialchars($username);
             $auth = dhtmlspecialchars($_GET['auth']);
         }
         $cookietimecheck = !empty($_G['cookie']['cookietime']) || !empty($_GET['cookietime']) ? 'checked="checked"' : '';
         if ($seccodecheck) {
             $seccode = random(6, 1) + $seccode[0] * 1000000;
         }
         if ($this->extrafile && file_exists($this->extrafile)) {
             require_once $this->extrafile;
         }
         $navtitle = lang('core', 'title_login');
         include template($this->template);
     } else {
         if (!empty($_GET['auth'])) {
             list($_GET['username'], $_GET['password']) = daddslashes(explode("\t", authcode($_GET['auth'], 'DECODE')));
         }
         if (!($_G['member_loginperm'] = logincheck($_GET['username']))) {
             showmessage('login_strike');
         }
         if ($_GET['fastloginfield']) {
             $_GET['loginfield'] = $_GET['fastloginfield'];
         }
         $_G['uid'] = $_G['member']['uid'] = 0;
         $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
         if (!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) {
             showmessage('profile_passwd_illegal');
         }
         $result = userlogin($_GET['username'], $_GET['password'], $_GET['questionid'], $_GET['answer'], $this->setting['autoidselect'] ? 'auto' : $_GET['loginfield'], $_G['clientip']);
         $uid = $result['ucresult']['uid'];
         if (!empty($_GET['lssubmit']) && ($result['ucresult']['uid'] == -3 || $seccodecheck)) {
             $_GET['username'] = $result['ucresult']['username'];
             $this->logging_more($result['ucresult']['uid'] == -3);
         }
         if ($result['status'] == -1) {
             if (!$this->setting['fastactivation']) {
                 $auth = authcode($result['ucresult']['username'] . "\t" . FORMHASH, 'ENCODE');
                 showmessage('location_activation', 'member.php?mod=' . $this->setting['regname'] . '&action=activation&auth=' . rawurlencode($auth) . '&referer=' . rawurlencode(dreferer()), array(), array('location' => true));
             } else {
                 $init_arr = explode(',', $this->setting['initcredits']);
                 $groupid = $this->setting['regverify'] ? 8 : $this->setting['newusergroupid'];
                 C::t('common_member')->insert($uid, $result['ucresult']['username'], md5(random(10)), $result['ucresult']['email'], $_G['clientip'], $groupid, $init_arr);
                 $result['member'] = getuserbyuid($uid);
                 $result['status'] = 1;
             }
         }
         if ($result['status'] > 0) {
             if ($this->extrafile && file_exists($this->extrafile)) {
                 require_once $this->extrafile;
             }
             setloginstatus($result['member'], $_GET['cookietime'] ? 2592000 : 0);
             checkfollowfeed();
             if ($_G['member']['lastip'] && $_G['member']['lastvisit']) {
                 dsetcookie('lip', $_G['member']['lastip'] . ',' . $_G['member']['lastvisit']);
             }
             C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP));
             $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
             if ($invite['id']) {
                 $result = C::t('common_invite')->count_by_uid_fuid($invite['uid'], $uid);
                 if (!$result) {
                     C::t('common_invite')->update($invite['id'], array('fuid' => $uid, 'fusername' => $_G['username']));
                     updatestat('invite');
                 } else {
                     $invite = array();
                 }
             }
             if ($invite['uid']) {
                 require_once libfile('function/friend');
                 friend_make($invite['uid'], $invite['username'], false);
                 dsetcookie('invite_auth', '');
                 if ($invite['appid']) {
                     updatestat('appinvite');
                 }
             }
             $param = array('username' => $result['ucresult']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['member']['uid'], 'groupid' => $_G['groupid'], 'syn' => $ucsynlogin ? 1 : 0);
             $extra = array('showdialog' => true, 'locationtime' => true, 'extrajs' => $ucsynlogin);
             $loginmessage = $_G['groupid'] == 8 ? 'login_succeed_inactive_member' : 'login_succeed';
             $location = $invite || $_G['groupid'] == 8 ? 'home.php?mod=space&do=home' : dreferer();
             if (empty($_GET['handlekey']) || !empty($_GET['lssubmit'])) {
                 if (defined('IN_MOBILE')) {
                     showmessage($loginmessage, $location, $param, array('location' => true));
                 } else {
                     if (!empty($_GET['lssubmit'])) {
//.........这里部分代码省略.........
开发者ID:torrent520,项目名称:torrent520.github.io,代码行数:101,代码来源:class_member.php


示例11: registerUser

function registerUser()
{
    global $application;
    $redirectUrl = '/dashboard/';
    $get_params = getparametersvalform(array('name', 'emailadd', 'userpwd', 'phone'));
    extract($get_params);
    if (checkuseravailbyid($emailadd) == TRUE) {
        if ($userpwd != '' && $emailadd != '') {
            if (isValidEmail($emailadd)) {
                $insert_id = Insertintouserprofile($name, $emailadd, md5($userpwd), $phone);
                if (is_numeric($insert_id) && $insert_id > 0) {
                    userlogin($application, 'LOGIN');
                }
            } else {
                $application->flash('reg_valid', 'Please enter valid Email Address');
                $application->redirect('/');
            }
        } else {
            $application->flash('reg_mand', 'Please Enter Email Address and Password');
            $application->redirect('/');
        }
    } else {
        $application->flash('reg_avail', 'This email is not available.');
        $application->redirect('/');
    }
}
开发者ID:Gorakh12345,项目名称:leadershipe,代码行数:26,代码来源:userfunction.php


示例12: htmlspecialchars

$olddiscuz_user = $_G['username'];
$olddiscuz_userss = $_G['member']['username'];
if (!$user) {
    $newuid = DB::result_first("SELECT uid FROM " . DB::table('common_member') . " WHERE username='{$_G['gp_username']}'");
    if (DB::result_first("SELECT COUNT(*) FROM " . DB::table('myrepeats') . " WHERE uid='{$newuid}' AND username='" . addslashes($olddiscuz_userss) . "'")) {
        $username = htmlspecialchars($_G['gp_username']);
        include template('myrepeats:switch_login');
        exit;
    }
    showmessage('myrepeats:user_nonexistence');
} elseif ($user['locked']) {
    $usernamess = stripslashes($_G['gp_username']);
    showmessage('myrepeats:user_locked', '', array('user' => $usernamess));
}
list($password, $questionid, $answer) = explode("\t", authcode($user['logindata'], 'DECODE', $_G['config']['security']['authkey']));
$result = userlogin($_G['gp_username'], $password, $questionid, $answer);
$_G['myrepeats_ucresult'] = $result['ucresult'];
if ($result['status'] > 0) {
    setloginstatus($result['member'], 2592000);
    DB::query("UPDATE " . DB::table('myrepeats') . " SET lastswitch='" . TIMESTAMP . "' WHERE uid='{$olddiscuz_uid}' AND username='{$_G['gp_username']}'");
    $ucsynlogin = $_G['setting']['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
    dsetcookie('mrn', '');
    dsetcookie('mrd', '');
    $comment = $user['comment'] ? '(' . $user['comment'] . ') ' : '';
    showmessage('myrepeats:login_succeed', $referer, array('user' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'comment' => $comment), array('showmsg' => 1, 'showdialog' => 1, 'locationtime' => 3, 'extrajs' => $ucsynlogin));
} elseif ($result['status'] == -1) {
    clearcookies();
    $_G['myrepeats_ucresult']['username'] = addslashes($_G['myrepeats_ucresult']['username']);
    $_G['username'] = '';
    $_G['uid'] = 0;
    $auth = authcode($_G['myrepeats_ucresult']['username'] . "\t" . formhash(), 'ENCODE');
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:switch.inc.php


示例13: dbconn

function dbconn($do_clean = false)
{
    global $dbhost, $dbuser, $dbpass, $database, $HTTP_SERVER_VARS, $db;
    /*
     * Connect to Database.
     */
    if ($GLOBALS["persist"]) {
        $db = new mysqli($dbhost, $dbuser, $dbpass, $database);
    } else {
        $db = new mysqli($dbhost, $dbuser, $dbpass, $database);
    }
    if ($db->connect_error) {
        die('Connect Error (' . $db->connect_errno . ') ' . $db->connect_error);
    }
    userlogin();
    if ($do_clean) {
        register_shutdown_function("cleandata");
    }
}
开发者ID:Q8HMA,项目名称:BtiTracker-1.5.1,代码行数:19,代码来源:functions.php


示例14: on_login

 function on_login()
 {
     global $_G;
     if ($_G['uid']) {
         $ucsynlogin = $_G['setting']['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
         $param = array('username' => $_G['member']['username'], 'uid' => $_G['member']['uid']);
         showmessage('login_succeed', dreferer(), $param, array('showdialog' => 1, 'locationtime' => true, 'extrajs' => $ucsynlogin));
     }
     $seccodecheck = $_G['setting']['seccodestatus'] & 2;
     $invite = getinvite();
     if (!submitcheck('loginsubmit', 1, $seccodecheck)) {
         $_G['referer'] = dreferer();
         $thetimenow = '(GMT ' . ($_G['setting']['timeoffset'] > 0 ? '+' : '') . $_G['setting']['timeoffset'] . ') ' . dgmdate(TIMESTAMP, 'u') . ($cookietimecheck = !empty($_G['cookie']['cookietime']) ? 'checked="checked"' : '');
         if ($seccodecheck) {
             $seccode = random(6, 1) + $seccode[0] * 1000000;
         }
         $username = !empty($_G['cookie']['loginuser']) ? htmlspecialchars($_G['cookie']['loginuser']) : '';
         $navtitle = lang('core', 'title_login');
         include template('member/login');
     } else {
         if (!($_G['member_loginperm'] = logincheck())) {
             showmessage('login_strike');
         }
         if ($_G['gp_fastloginfield']) {
             $_G['gp_loginfield'] = $_G['gp_fastloginfield'];
         }
         $_G['uid'] = $_G['member']['uid'] = 0;
         $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
         $result = userlogin($_G['gp_username'], $_G['gp_password'], $_G['gp_questionid'], $_G['gp_answer'], $_G['setting']['autoidselect'] ? 'auto' : $_G['gp_loginfield']);
         if ($result['status'] > 0) {
             setloginstatus($result['member'], $_G['gp_cookietime'] ? 2592000 : 0);
             DB::query("UPDATE " . DB::table('common_member_status') . " SET lastip='" . $_G['clientip'] . "', lastvisit='" . time() . "', lastactivity='" . TIMESTAMP . "' WHERE uid='{$_G['uid']}'");
             $ucsynlogin = $_G['setting']['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
             include_once libfile('function/stat');
             updatestat('login', 1);
             updatecreditbyaction('daylogin', $_G['uid']);
             checkusergroup($_G['uid']);
             if ($invite['id']) {
                 DB::update("common_invite", array('fuid' => $uid, 'fusername' => $username), array('id' => $invite['id']));
                 updatestat('invite');
             }
             if ($invite['uid']) {
                 require_once libfile('function/friend');
                 friend_make($invite['uid'], $invite['username'], false);
                 dsetcookie('invite_auth', '');
                 if ($invite['appid']) {
                     updatestat('appinvite');
                 }
             }
             if (!empty($_G['inajax']) && empty($_G['gp_quickforward'])) {
                 $_G['setting']['msgforward'] = unserialize($_G['setting']['msgforward']);
                 $mrefreshtime = intval($_G['setting']['msgforward']['refreshtime']) * 1000;
                 loadcache('usergroups');
                 $usergroups = addslashes($_G['cache']['usergroups'][$_G['groupid']]['grouptitle']);
                 $message = 1;
                 include template('member/login');
             } else {
                 $param = array('username' => $_G['member']['username'], 'uid' => $_G['member']['uid'], 'syn' => $ucsynlogin ? 1 : 0);
                 if ($_G['groupid'] == 8) {
                     showmessage('login_succeed_inactive_member', 'home.php?mod=space&do=home', $param, array('extrajs' => $ucsynlogin));
                 } else {
                     showmessage('login_succeed', $invite ? 'home.php?mod=space&do=home' : dreferer(), $param, array('extrajs' => $ucsynlogin));
                 }
             }
         } elseif ($result['status'] == -1) {
             $auth = authcode($result['ucresult']['username'] . "\t" . FORMHASH, 'ENCODE');
             $location = 'member.php?mod=' . $_G['setting']['regname'] . '&action=activation&auth=' . rawurlencode($auth);
             if ($_G['inajax'] && empty($_G['gp_quickforward'])) {
                 $message = 2;
                 include template('member/login');
             } else {
                 showmessage('login_activation', $location);
             }
         } 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:v998,项目名称:discuzx-en,代码行数:83,代码来源:member_logging.php


示例15: add_user

 case 'add_user':
     if (isset($_SESSION['logged_in']) && $_SESSION['level'] <= USER_SUPERUSER) {
         add_user($page[1]);
     }
     break;
 case 'register':
     if (isset($CONFIG['login_required']) && $CONFIG['login_required'] == 1) {
         register_user($page[1]);
     }
     break;
 case 'login':
     if (isset($CONFIG['login_required']) && $CONFIG['login_required'] == 1) {
         if (isset($_SESSION['logged_in'])) {
             header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));
         } else {
             userlogin($page[1]);
         }
     } else {
         header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));
     }
     break;
 case 'admin':
     if (isset($_SESSION['logged_in'])) {
         /* already logged in */
     } else {
         adminlogin($page[1]);
     }
     break;
 case 'bottom':
     $query = "SELECT * FROM " . db_tablename('quotes') . " WHERE queue=0 and rating < 0 ORDER BY rating ASC LIMIT " . $limit;
     quote_generation($query, lang('bottom_title'), -1);
开发者ID:ryjkov,项目名称:rash-qdb-fork,代码行数:31,代码来源:index.php


示例16: login

function login()
{
    //this function draws a complete login form
    global $user, $HTTP_POST_VARS;
    //lets make sure that if our user is logged in or logging in that we know it.
    if (!isset($user)) {
        $user = getuserinfo();
    }
    if (0 == strcmp($user['username'], "anonymous") && isset($HTTP_POST_VARS['user'])) {
        $user = userlogin($HTTP_POST_VARS['user'], $HTTP_POST_VARS['pass'], $HTTP_POST_VARS['automatic']);
    }
    //lets see if we need to present the user with a login box
    if (0 == strcmp($user['username'], "anonymous")) {
        if (iset($_SERVER["QUERY_STRING"])) {
            $url = $_SERVER["SCRIPT_NAME"] . "?" . $_SERVER["QUERY_STRING"] . "&login=1";
        } else {
            $url = $_SERVER["SCRIPT_NAME"] . "?login=1";
        }
        $WORK = "Please Enter your username and password to login:<BR>\r\n";
        $WORK .= "<form method='post' action='" . $url . "'>\r\n";
        $WORK .= "Username: <input type='text' name='user' size='20'><BR>\r\n";
        $WORK .= "Password: <input type='password' name='pass' size='20'><BR>\r\n";
        $WORK .= "Log me on automatically each visit: <input type='checkbox' name='automatic' checked><BR>\r\n";
        $WORK .= "<input type='submit' value='Login'>\r\n";
        $WORK .= "</form>\r\n";
    } else {
        $WORK = "You are currently logged in as " . $user['username'] . ".<BR>\r\n";
    }
    return $WORK;
}
开发者ID:BackupTheBerlios,项目名称:fishcms-svn,代码行数:30,代码来源:phpbbauth.php


示例17: check_user_login

 function check_user_login()
 {
     global $_G;
     $admin_email = isset($_POST['admin_email']) ? trim($_POST['admin_email']) : '';
     if ($admin_email != '') {
         if (logincheck($_POST['admin_email'])) {
             if ((empty($_POST['admin_questionid']) || empty($_POST['admin_answer'])) && ($_G['config']['admincp']['forcesecques'] || $_G['group']['forcesecques'])) {
                 $this->do_user_login();
             }
             $result = userlogin($_POST['admin_email'], $_POST['admin_password'], $_POST['admin_questionid'], $_POST['admin_answer'], 'auto', $this->core->var['clientip']);
             if ($result['status'] == 1) {
                 if ($this->checkfounder($result['member']) || $result['member']['groupid'] == 1 || $result['member']['groupid'] == 2) {
                     C::t('admincp_session')->insert(array('uid' => $result['member']['uid'], 'adminid' => $result['member']['adminid'], 'panel' => $result['member']['groupid'], 'dateline' => TIMESTAMP, 'ip' => $this->core->var['clientip'], 'errorcount' => -1), false, true);
                     setloginstatus($result['member'], 0);
                     dheader('Location: ' . ADMINSCRIPT . '?' . cpurl('url', array('sid')));
                 } else {
                     $this->cpaccess = -2;
                 }
             } else {
                 loginfailed($_POST['admin_email']);
             }
         } else {
             $this->cpaccess = -4;
         }
     }
 }
开发者ID:druphliu,项目名称:dzzoffice,代码行数:26,代码来源:dzz_admincp.php


示例18: elseif

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP username函数代码示例发布时间:2022-05-23
下一篇:
PHP userlink函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap