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


PHP PwdCode函数代码示例

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


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

示例1: synlogin

 function synlogin($user)
 {
     global $timestamp, $uc_key;
     list($winduid, $windid, $windpwd) = explode("\t", $this->base->strcode($user, false));
     header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
     $safecv = '';
     $cktime = 31536000;
     $cktime != 0 && ($cktime += $timestamp);
     Cookie("winduser", StrCode($winduid . "\t" . PwdCode($windpwd) . "\t" . $safecv), $cktime);
     Cookie("ucuser", StrCode($winduid . "\t" . md5($uc_key . $windpwd)), $cktime);
     Cookie('lastvisit', '', 0);
     return '';
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:13,代码来源:class_User.php

示例2: PassportUserdb

/**
*取得用户数据
**/
function PassportUserdb()
{
    global $db, $timestamp, $webdb, $onlineip, $TB, $pre, $db_ifsafecv, $userDB;
    list($lfjuid, $lfjpwd, $safecv) = explode("\t", StrCode(GetCookie('winduser'), 'DECODE'));
    if (!$lfjuid || !$lfjpwd) {
        return '';
    }
    if ($db_ifsafecv) {
        $SQL = ",M.safecv";
    }
    $detail = $userDB->get_allInfo($lfjuid);
    if (PwdCode($detail[password]) != $lfjpwd || $db_ifsafecv && $safecv != $detail['safecv']) {
        return;
    }
    return $detail;
}
开发者ID:GHubgenius,项目名称:qbbj,代码行数:19,代码来源:pwbbs5.php

示例3: synlogin

 function synlogin($user)
 {
     global $timestamp, $uc_key;
     list($winduid, $windid, $windpwd) = explode("\t", $this->base->strcode($user, false));
     header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
     $safecv = '';
     $cktime = 31536000;
     $cktime != 0 && ($cktime += $timestamp);
     Cookie("winduser", StrCode($winduid . "\t" . PwdCode($windpwd) . "\t" . $safecv), $cktime);
     Cookie("ucuser", StrCode($winduid . "\t" . md5($uc_key . $windpwd)), $cktime);
     Cookie('lastvisit', '', 0);
     //鑾峰彇鍕嬬珷_start
     require_once R_P . 'require/functions.php';
     doMedalBehavior($winduid, 'continue_login');
     //鑾峰彇鍕嬬珷_end
     return '';
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:17,代码来源:class_User.php

示例4: wap_login

function wap_login($username, $password, $safecv, $lgt = 0)
{
    global $db, $timestamp, $onlineip, $db_ckpath, $db_ckdomain, $db_bbsurl, $db_ifsafecv;
    $men = $db->get_one("SELECT m.uid,m.password,m.safecv,m.groupid,m.yz,md.onlineip FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid WHERE m." . ($lgt ? 'uid' : 'username') . "=" . pwEscape($username));
    if ($men) {
        $e_login = explode("|", $men['onlineip']);
        if ($e_login[0] != $onlineip . ' *' || $timestamp - $e_login[1] > 600 || $e_login[2] > 1) {
            $men_uid = $men['uid'];
            $men_pwd = $men['password'];
            $check_pwd = $password;
            if ($men['yz'] > 2) {
                wap_msg('login_jihuo');
            }
            if (strlen($men_pwd) == 16) {
                $check_pwd = substr($password, 8, 16);
                /*支持 16 位 md5截取密码*/
            }
            if ($men_pwd == $check_pwd && (!$db_ifsafecv || $men['safecv'] == $safecv)) {
                if (strlen($men_pwd) == 16) {
                    $db->update("UPDATE pw_members SET password=" . pwEscape($password) . " WHERE uid=" . pwEscape($men_uid));
                }
                $L_groupid = (int) $men['groupid'];
                Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain);
            } else {
                global $L_T;
                $L_T = $e_login[2];
                $L_T ? $L_T-- : ($L_T = 5);
                $F_login = "{$onlineip} *|{$timestamp}|{$L_T}";
                $db->update("UPDATE pw_memberdata SET onlineip=" . pwEscape($F_login) . " WHERE uid=" . pwEscape($men_uid));
                wap_msg('login_pwd_error');
            }
        } else {
            global $L_T;
            $L_T = 600 - ($timestamp - $e_login[1]);
            wap_msg('login_forbid');
        }
    } else {
        global $errorname;
        $errorname = $username;
        wap_msg('user_not_exists');
    }
    Cookie("winduser", StrCode($men_uid . "\t" . PwdCode($password) . "\t" . $safecv));
    Cookie('lastvisit', '', 0);
    wap_msg('wap_login', 'index.php');
}
开发者ID:adi00,项目名称:wumaproject,代码行数:45,代码来源:wap_mod.php

示例5: checkuptoadmin

function checkuptoadmin($CK)
{
    Add_S($CK);
    global $db, $manager;
    if (is_array($manager) && CkInArray($CK[1], $manager)) {
        global $manager_pwd;
        $v_key = array_search($CK[1], $manager);
        if (!SafeCheck($CK, PwdCode($manager_pwd[$v_key]))) {
            $rt = $db->get_one("SELECT uid,username,groupid,groups,password FROM pw_members WHERE username=" . pwEscape($CK[1]));
            if (!SafeCheck($CK, PwdCode($rt['password']))) {
                return false;
            }
        }
        return true;
    } elseif ($CK[1] == $manager) {
        global $manager_pwd;
        if (!SafeCheck($CK, PwdCode($manager_pwd))) {
            $rt = $db->get_one("SELECT uid,username,groupid,groups,password FROM pw_members WHERE username=" . pwEscape($CK[1]));
            if (!SafeCheck($CK, PwdCode($rt['password']))) {
                return false;
            }
        }
        return true;
    } else {
        return false;
    }
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:27,代码来源:up_function.php

示例6: weiboResetUserPassword

function weiboResetUserPassword($userId, $password, $repeatPassword)
{
    global $db_ckpath, $db_ckdomain;
    if ('' == $password || '' == $repeatPassword) {
        Showmsg('创建密码不能为空');
    }
    $rg_config = L::reg();
    list($rg_regminpwd, $rg_regmaxpwd) = explode("\t", $rg_config['rg_pwdlen']);
    $register = L::loadClass('Register', 'user');
    $register->checkPwd($password, $repeatPassword);
    $weiboLoginService = L::loadClass('WeiboLoginService', 'sns/weibotoplatform/service');
    /* @var $weiboLoginService PW_WeiboLoginService */
    $isSuccess = $weiboLoginService->resetLoginUserPassword($userId, $password);
    if (!$isSuccess) {
        return false;
    }
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $user = $userService->get($userId);
    Cookie("winduser", StrCode($userId . "\t" . PwdCode($user['password']) . "\t" . $user['safecv']));
    Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain);
    Cookie('lastvisit', '', 0);
    //自动获取勋章_start
    require_once R_P . 'require/functions.php';
    doMedalBehavior($userId, 'continue_login');
    //自动获取勋章_end
    return true;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:28,代码来源:weibobind.php

示例7: list

     } else {
         pwCache::setData(D_P . 'data/bbscache/ip_cache.php', "<?php die;?><{$timestamp}>\n<{$onlineip}>");
     }
 }
 //addonlinefile();
 if (GetCookie('userads') && $inv_linkopen && $inv_linktype == '1') {
     require_once R_P . 'require/userads.php';
 }
 if (GetCookie('o_invite') && $db_modes['o']['ifopen'] == 1) {
     list($o_u, $hash, $app) = explode("\t", GetCookie('o_invite'));
     if (is_numeric($o_u) && strlen($hash) == 18) {
         require_once R_P . 'require/o_invite.php';
     }
 }
 if ($rgyz == 1) {
     Cookie("winduser", StrCode($winduid . "\t" . PwdCode($windpwd) . "\t" . $safecv));
     Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain);
     Cookie('lastvisit', '', 0);
     //将$lastvist清空以将刚注册的会员加入今日到访会员中
     /*连续登录天数*/
     if ($db_md_ifopen) {
         require_once R_P . 'require/functions.php';
         doMedalBehavior($winduid, 'continue_login');
     }
 }
 //发送短消息
 if ($rg_config['rg_regsendmsg']) {
     $rg_config['rg_welcomemsg'] = str_replace('$rg_name', $regname, $rg_config['rg_welcomemsg']);
     M::sendNotice(array($windid), array('title' => "Welcome To[{$db_bbsname}]!", 'content' => $rg_config['rg_welcomemsg']));
 }
 //发送邮件
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:register.php

示例8: albumViewRight

 /**
  *相册浏览权限
  *@param $aid int 相册ID
  *@return Array 返回相册相关信息
  */
 function albumViewRight($aid)
 {
     $albumDao = $this->_getDaoFactory('CnAlbum');
     $album = $albumDao->getAlbumInfo($aid, 0);
     if (empty($album)) {
         return 'data_error';
     }
     $ownerid = $album['ownerid'];
     /*if(!$this->isUserAlbum($ownerid)){
     			return 'mode_o_photos_private_0';
     		}*/
     $friendService = $this->_getServiceFactory('Friend', 'friend');
     if (!$this->isMyAlbum($ownerid) && $album['private'] == 1 && $friendService->isFriend($this->_winduid, $ownerid) !== true && !$this->isPermission()) {
         return 'mode_o_photos_private_1';
     }
     if (!$this->isMyAlbum($ownerid) && $album['private'] == 2 && !$this->isPermission()) {
         return 'mode_o_photos_private_2';
     }
     $cookiename = 'albumview_' . $aid;
     if ($album['albumpwd'] && PwdCode($album['albumpwd']) != GetCookie($cookiename) && !$this->isMyAlbum($ownerid) && $album['private'] == 3 && !$this->isPermission()) {
         //GetCookie($cookiename) && Cookie($cookiename,'',time()-3600);
         return 'mode_o_photos_private_3';
     }
     return $album;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:30,代码来源:photo.class.php

示例9: User_info

function User_info()
{
    global $db, $timestamp, $db_onlinetime, $winduid, $windpwd, $safecv, $db_ifonlinetime, $c_oltime, $onlineip, $db_ipcheck, $tdtime, $montime, $db_ifsafecv, $db_ifpwcache, $uc_server;
    PwNewDB();
    $detail = getUserByUid($winduid);
    if (empty($detail) && $uc_server) {
        require_once R_P . 'require/ucuseradd.php';
    }
    $loginout = 0;
    if ($db_ipcheck && strpos($detail['onlineip'], $onlineip) === false) {
        $iparray = explode('.', $onlineip);
        strpos($detail['onlineip'], $iparray[0] . '.' . $iparray[1]) === false && ($loginout = 1);
    }
    if (!$detail || PwdCode($detail['password']) != $windpwd || $db_ifsafecv && $safecv != $detail['safecv'] || $loginout || $detail['yz'] > 1) {
        $GLOBALS['groupid'] = 'guest';
        require_once R_P . 'require/checkpass.php';
        Loginout();
        if ($detail['yz'] > 1) {
            $GLOBALS['jihuo_uid'] = $detail['uid'];
            Showmsg('login_jihuo');
        }
        Showmsg('ip_change');
    } else {
        list($detail['shortcut'], $detail['appshortcut']) = explode("\t", $detail['shortcut']);
        unset($detail['password']);
        $detail['honor'] = substrs($detail['honor'], 90);
        $distime = $timestamp - $detail['lastvisit'];
        if ($distime > $db_onlinetime || $distime > 3600) {
            //Start elementupdate
            if ($db_ifpwcache & 1 && SCR != 'post' && SCR != 'thread') {
                require_once R_P . 'lib/elementupdate.class.php';
                $elementupdate = new ElementUpdate();
                $elementupdate->userSortUpdate($detail);
            }
            //End elementupdate
            if (!GetCookie('hideid')) {
                $ecpvisit = pwEscape($timestamp, false);
                $ct = 'lastvisit=' . $ecpvisit . ',thisvisit=' . $ecpvisit;
                if ($db_ifonlinetime) {
                    $c_oltime = $c_oltime <= 0 ? 0 : ($c_oltime > $db_onlinetime * 1.2 ? $db_onlinetime : intval($c_oltime));
                    $s_oltime = pwEscape($c_oltime, false);
                    $ct .= ',onlinetime=onlinetime+' . $s_oltime;
                    if ($detail['lastvisit'] > $montime) {
                        $ct .= ',monoltime=monoltime+' . $s_oltime;
                    } else {
                        $ct .= ',monoltime=' . $s_oltime;
                    }
                    $c_oltime && updateDatanalyse($winduid, 'memberOnLine', $c_oltime);
                    $c_oltime = 0;
                }
                $db->update("UPDATE pw_memberdata SET {$ct} WHERE uid=" . pwEscape($winduid));
                $detail['lastvisit'] = $detail['thisvisit'] = $timestamp;
            }
        }
    }
    return $detail;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:57,代码来源:global.php

示例10: checkpass

function checkpass($CK)
{
    S::slashes($CK);
    global $db, $manager, $db_ifsafecv;
    if (S::inArray($CK[1], $manager)) {
        global $manager_pwd;
        $v_key = array_search($CK[1], $manager);
        $ifQuery = true;
        // In order ot get bubble info
        if (!SafeCheck($CK, PwdCode($manager_pwd[$v_key]))) {
            $userService = L::loadClass('UserService', 'user');
            /* @var $userService PW_UserService */
            $rt = $userService->getByUserName($CK[1], true, true);
            if (!SafeCheck($CK, PwdCode($rt['password'])) || $db_ifsafecv && $rt['safecv'] != $CK['3']) {
                return false;
            }
            if (!admincheck($rt['uid'], $rt['username'], $rt['groupid'], $rt['groups'], 'check')) {
                return false;
            }
            $ifQuery = false;
        } elseif ($db_ifsafecv) {
            $userService = L::loadClass('UserService', 'user');
            /* @var $userService PW_UserService */
            $rt = $userService->getByUserName($CK[1], true, true);
            if ($rt && $rt['safecv'] != $CK['3']) {
                return false;
            }
            $ifQuery = false;
        }
        if ($ifQuery) {
            $userService = L::loadClass('UserService', 'user');
            /* @var $userService PW_UserService */
            $rt = $userService->getByUserName($CK[1], true, true);
        }
        define('If_manager', 1);
        $rightset['gid'] = 3;
        $rightset['all'] = 1;
        $rightset['bubble'] = $rt['bubble'];
        require GetLang('purview');
        foreach ($purview as $key => $value) {
            $rightset[$key] = 1;
        }
        foreach ($nav_manager['option'] as $key => $value) {
            $rightset[$key] = 1;
        }
    } else {
        $rt = $db->get_one("SELECT m.uid,m.username,m.groupid,m.groups,m.password,m.safecv,m.groupid,u.gptype,p.rvalue as allowadmincp,md.bubble FROM pw_members m LEFT JOIN pw_usergroups u ON u.gid=m.groupid LEFT JOIN pw_permission p ON p.uid='0' AND p.fid='0' AND p.gid=m.groupid AND p.rkey='allowadmincp' LEFT JOIN pw_memberdata md ON md.uid = m.uid WHERE m.username=" . S::sqlEscape($CK[1]));
        if (!$rt['allowadmincp'] || $rt['gptype'] != 'system' && $rt['gptype'] != 'special' || $db_ifsafecv && $rt['safecv'] != $CK['3']) {
            return false;
        }
        if (!SafeCheck($CK, PwdCode($rt['password'])) || !admincheck($rt['uid'], $CK[1], $rt['groupid'], $rt['groups'], 'check')) {
            return false;
        }
        $rightset = $db->get_value('SELECT value FROM pw_adminset WHERE gid=' . S::sqlEscape($rt['groupid']));
        if ($rightset) {
            if (!is_array($rightset = unserialize($rightset))) {
                $rightset = array();
            }
        } else {
            $rightset = array();
        }
        require GetLang('purview');
        foreach ($rightset as $key => $value) {
            $rightset[$key] = isset($purview[$key]) && $rightset[$key] == 1 ? 1 : 0;
        }
        $rightset['gid'] = $rt['groupid'];
        $rightset['bubble'] = $rt['bubble'];
    }
    $rightset['uid'] = $rt['uid'];
    return $rightset;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:71,代码来源:admincp.php

示例11: User_info

/**
 * 获取用户信息
 */
function User_info()
{
    global $db, $timestamp, $db_onlinetime, $winduid, $windpwd, $bday, $safecv, $db_ifonlinetime, $c_oltime, $onlineip, $db_ipcheck, $tdtime, $montime, $db_ifsafecv, $db_ifpwcache, $uc_server, $db_md_ifopen;
    PwNewDB();
    $detail = getUserByUid($winduid);
    if (empty($detail) && $uc_server) {
        require_once R_P . 'require/ucuseradd.php';
    }
    $loginout = 0;
    if ($db_ipcheck && strpos($detail['onlineip'], $onlineip) === false) {
        $iparray = explode('.', $onlineip);
        strpos($detail['onlineip'], $iparray[0] . '.' . $iparray[1]) === false && ($loginout = 1);
    }
    if (!$detail || PwdCode($detail['password']) != $windpwd || $db_ifsafecv && $safecv != $detail['safecv'] || $loginout || $detail['yz'] > 1) {
        $GLOBALS['groupid'] = 'guest';
        require_once R_P . 'require/checkpass.php';
        Loginout();
        if ($detail['yz'] > 1) {
            $GLOBALS['jihuo_uid'] = $detail['uid'];
            Showmsg('login_jihuo');
        }
        Showmsg('ip_change');
    } else {
        list($detail['shortcut'], $detail['appshortcut']) = explode("\t", $detail['shortcut']);
        unset($detail['password']);
        $detail['honor'] = substrs($detail['honor'], 90);
        $distime = $timestamp - $detail['lastvisit'];
        if ($distime > $db_onlinetime || $distime > 3600) {
            /*--- element update ---start*/
            if ($db_ifpwcache & 1 && SCR != 'post' && SCR != 'thread') {
                L::loadClass('elementupdate', '', false);
                $elementupdate = new ElementUpdate();
                $elementupdate->userSortUpdate($detail);
            }
            /*--- element update ---end*/
            if (!GetCookie('hideid')) {
                $userService = L::loadClass('UserService', 'user');
                /* @var $userService PW_UserService */
                $updateMemberData = $updateByIncrementMemberData = array();
                $updateMemberData['lastvisit'] = $timestamp;
                $updateMemberData['thisvisit'] = $timestamp;
                if ($db_ifonlinetime) {
                    $c_oltime = intval($c_oltime);
                    $c_oltime = $c_oltime <= 0 ? 0 : ($c_oltime > $db_onlinetime * 1.2 ? $db_onlinetime : $c_oltime);
                    $updateByIncrementMemberData['onlinetime'] = $c_oltime;
                    if ($detail['lastvisit'] > $montime) {
                        $updateByIncrementMemberData['monoltime'] = $c_oltime;
                    } else {
                        $updateMemberData['monoltime'] = $c_oltime;
                    }
                    if ($c_oltime) {
                        require_once R_P . 'require/functions.php';
                        updateDatanalyse($winduid, 'memberOnLine', $c_oltime);
                    }
                    $c_oltime = 0;
                }
                if (get_date($timestamp, 'Y-m-d') > get_date($detail['lastvisit'], 'Y-m-d')) {
                    /*更新今日登录数*/
                    $stasticsService = L::loadClass('Statistics', 'datanalyse');
                    $stasticsService->login($winduid);
                    /*连续登录天数*/
                    if ($db_md_ifopen) {
                        require_once R_P . 'require/functions.php';
                        doMedalBehavior($winduid, 'continue_login');
                    }
                }
                $userService->update($winduid, array(), $updateMemberData);
                $updateByIncrementMemberData && $userService->updateByIncrement($winduid, array(), $updateByIncrementMemberData);
                $detail['lastvisit'] = $detail['thisvisit'] = $timestamp;
            }
        }
    }
    return $detail;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:77,代码来源:global.php

示例12: updateThreadTrade

        }
        //update meminfo
        if ($upmeminfo) {
            updateThreadTrade($upmeminfo, $winduid);
        }
        unset($upmemdata, $upmeminfo);
        $result = $userService->update($winduid, $pwSQL);
        // defend start
        CloudWind::yunUserDefend('editprofile', $winduid, $windid, $upmemdata['pwdctime'], 0, 101, '', '', '', array('profile' => array_keys($pwSQL)));
        // defend end
        /* platform weibo app */
        $siteBindService = L::loadClass('WeiboSiteBindService', 'sns/weibotoplatform/service');
        /* @var $siteBindService PW_WeiboSiteBindService */
        if ($siteBindService->isOpen() && $upmembers['password']) {
            $weiboLoginService = L::loadClass('WeiboLoginService', 'sns/weibotoplatform/service');
            /* @var $weiboLoginService PW_WeiboLoginService */
            $weiboLoginService->setLoginUserPasswordHasReset($winduid);
            Cookie("winduser", StrCode($winduid . "\t" . PwdCode($upmembers['password']) . "\t" . $upmembers['safecv']));
            Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain);
            Cookie('lastvisit', '', 0);
            //自动获取勋章_start
            require_once R_P . 'require/functions.php';
            doMedalBehavior($winduid, 'continue_login');
            //自动获取勋章_end
        }
        //* $_cache = getDatastore();
        //* $_cache->delete('UID_'.$winduid);
        initJob($winduid, "doUpdatedata");
        refreshto("profile.php?action=modify&info_type={$info_type}", 'operate_success', 2, true);
    }
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:info_safe.php

示例13: login

 function login($username, $password, $cookietime, $not_pwd = false)
 {
     extract($GLOBALS);
     if ($not_pwd) {
         //不需要知道原始密码就能登录
         $rs = $this->get_passport($username, 'name');
     } else {
         $rs = $this->check_password($username, $password);
         if (!is_array($rs)) {
             return $rs;
             //0为用户不存在,-1为密码不正确
         }
     }
     if (eregi("^pwbbs", $webdb[passport_type])) {
         if ($db_ifsafecv) {
             $_r = $this->get_passport($username, 'name');
             $safecv = $_r[safecv];
         }
         set_cookie(CookiePre() . '_winduser', StrCode($rs[uid] . "\t" . PwdCode($rs[password]) . "\t{$safecv}"), $cookietime);
         set_cookie('lastvisit', '', 0);
     } else {
         set_cookie("passport", "{$rs['uid']}\t{$username}\t" . mymd5("{$rs['password']}"), $cookietime);
     }
     if (defined("UC_CONNECT")) {
         global $uc_login_code;
         $uc_login_code = uc_user_synlogin($rs[uid]);
     }
     return $rs[uid];
 }
开发者ID:GHubgenius,项目名称:qbbj,代码行数:29,代码来源:class.user.php

示例14: checkpass1

function checkpass1($username, $password, $safecv, $lgt = 0)
{
    global $db, $timestamp, $onlineip, $db_ckpath, $db_ckdomain, $men_uid, $db_ifsafecv, $db_ifpwcache, $db_logintype;
    $str_logintype = '';
    if ($db_logintype) {
        for ($i = 0; $i < 3; $i++) {
            ${'logintype_' . $i} = $db_logintype & pow(2, $i) ? 1 : 0;
        }
    } else {
        $logintype_0 = 1;
    }
    !${'logintype_' . $lgt} && Showmsg('login_errortype');
    switch (intval($lgt)) {
        case 0:
            $str_logintype = 'username';
            break;
        case 1:
            $str_logintype = 'uid';
            break;
        case 2:
            !preg_match("/^[-a-zA-Z0-9_\\.]+@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}\$/", $username) && Showmsg('illegal_email');
            $str_logintype = 'email';
            break;
        default:
            $str_logintype = 'username';
            break;
    }
    $men_uid = '';
    if (intval($lgt) == 2) {
        $query = $db->query("SELECT m.uid,m.username,m.password,m.safecv,m.groupid,m.memberid,m.yz,md.onlineip,md.postnum,md.rvrc,md.money,md.credit,md.currency,md.lastpost,md.onlinetime,md.todaypost,md.monthpost,md.monoltime,md.digests " . " FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid" . " WHERE m." . $str_logintype . "=" . pwEscape($username) . " LIMIT 2");
        $int_querynum = $db->num_rows($query);
        if (!$int_querynum) {
            Showmsg('user_not_exists');
        } elseif ($int_querynum == 1) {
            $men = $db->fetch_array($query);
        } else {
            Showmsg('reg_email_have_same');
        }
    } else {
        $men = $db->get_one("SELECT m.uid,m.username,m.password,m.safecv,m.groupid,m.memberid,m.yz,md.onlineip,md.postnum,md.rvrc,md.money,md.credit,md.currency,md.lastpost,md.onlinetime,md.todaypost,md.monthpost" . " FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid" . " WHERE m." . $str_logintype . "=" . pwEscape($username));
    }
    if ($men) {
        $e_login = explode("|", $men['onlineip']);
        if ($e_login[0] != $onlineip . ' *' || $timestamp - $e_login[1] > 600 || $e_login[2] > 1) {
            $men_uid = $men['uid'];
            $men_pwd = $men['password'];
            $check_pwd = $password;
            $men['yz'] > 2 && Showmsg('login_jihuo');
            if (strlen($men_pwd) == 16) {
                $check_pwd = substr($password, 8, 16);
                /*支持 16 位 md5截取密码*/
            }
            if ($men_pwd == $check_pwd && (!$db_ifsafecv || $men['safecv'] == $safecv)) {
                if (strlen($men_pwd) == 16) {
                    $db->update("UPDATE pw_members SET password=" . pwEscape($password) . "WHERE uid=" . pwEscape($men_uid));
                }
                $L_groupid = $men['groupid'] == '-1' ? $men['memberid'] : $men['groupid'];
                Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain);
            } else {
                global $L_T;
                $L_T = $timestamp - $e_login[1] > 600 ? 5 : $e_login[2];
                $L_T ? $L_T-- : ($L_T = 5);
                $F_login = "{$onlineip} *|{$timestamp}|{$L_T}";
                $db->update("UPDATE pw_memberdata SET onlineip=" . pwEscape($F_login) . "WHERE uid=" . pwEscape($men_uid));
                Showmsg('login_pwd_error');
            }
        } else {
            global $L_T;
            $L_T = 600 - ($timestamp - $e_login[1]);
            Showmsg('login_forbid');
        }
    } else {
        global $errorname;
        $errorname = $username;
        Showmsg('user_not_exists');
    }
    //Start Here会员排行榜
    if ($db_ifpwcache & 1) {
        require_once R_P . 'lib/elementupdate.class.php';
        $elementupdate = new ElementUpdate();
        $elementupdate->userSortUpdate($men);
    }
    //End Here
    return array($men_uid, $L_groupid, PwdCode($password));
}
开发者ID:adi00,项目名称:wumaproject,代码行数:85,代码来源:checkpass.php

示例15: array

        }
        $sql1 += array('groupid' => -1, 'memberid' => 8, 'gender' => 0, 'regdate' => $timestamp);
        /**
        		$db->update("REPLACE INTO pw_members SET".S::sqlSingle($sql1));
        		**/
        pwQuery::replace('pw_members', $sql1);
        $winduid = $db->insert_id();
        $sql2 += array('uid' => $winduid, 'postnum' => 0, 'lastvisit' => $timestamp, 'thisvisit' => $timestamp, 'onlineip' => $onlineip);
        /**
        		$db->update("REPLACE INTO pw_memberdata SET".S::sqlSingle($sql2));
        		**/
        pwQuery::replace('pw_memberdata', $sql2);
        //* $db->update("UPDATE pw_bbsinfo SET newmember=".S::sqlEscape($userdb['username']).",totalmember=totalmember+1 WHERE id='1'");
        $db->update(pwQuery::buildClause("UPDATE :pw_table SET newmember=:newmember,totalmember=totalmember+1 WHERE id=:id", array('pw_bbsinfo', $userdb['username'], 1)));
    }
    $db_hash = $_db_hash;
    $windpwd = PwdCode($userdb['password']);
    Cookie("winduser", StrCode($winduid . "\t" . $windpwd), $userdb['cktime']);
    Cookie('lastvisit', '', 0);
    Loginipwrite();
    if ($ajax == 1) {
        ObStart();
        echo "success\t{$db_bbsurl}";
        ajax_footer();
    }
    ObHeader($forward ? $forward : $db_bbsurl);
} elseif ($action == 'quit') {
    $db_hash = $_db_hash;
    Loginout();
    ObHeader($forward ? $forward : $db_bbsurl);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:passport_client.php


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