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

PHP vbsetcookie函数代码示例

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

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



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

示例1: verify_authentication2

 function verify_authentication2($username)
 {
     global $vbulletin;
     $username = strip_blank_ascii($username, ' ');
     if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'")) {
         if ($vbulletin->GPC[COOKIE_PREFIX . 'userid'] and $vbulletin->GPC[COOKIE_PREFIX . 'userid'] != $vbulletin->userinfo['userid']) {
             // we have a cookie from a user and we're logging in as
             // a different user and we're not going to store a new cookie,
             // so let's unset the old one
             vbsetcookie('userid', '', true, true, true);
             vbsetcookie('password', '', true, true, true);
         }
         vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true);
         vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true);
         $return_value = true;
         ($hook = vBulletinHook::fetch_hook('login_verify_success')) ? eval($hook) : false;
         return $return_value;
     }
     $return_value = false;
     ($hook = vBulletinHook::fetch_hook('login_verify_failure_username')) ? eval($hook) : false;
     return $return_value;
 }
开发者ID:xijbx,项目名称:loginshell,代码行数:22,代码来源:loginshell.php


示例2: md5

             $sql = "SELECT activationid FROM useractivation WHERE userid = '" . $userid . "'";
             $data = $vbulletin->db->query_first($sql);
             $activationid = $data["activationid"];
             if (!empty($activationid)) {
                 $url = "register.php?a=act&u=" . $userid . "&i=" . $activationid;
             } else {
                 $url = "index.php";
                 $token = md5(uniqid(microtime(), true));
                 $token_time = time();
                 $form = "site-account-details";
                 $_SESSION['site_registration'][$form . '_token'] = array('token' => $token, 'time' => $token_time);
                 // start new session
                 $vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids,\n                            username, password, salt FROM " . TABLE_PREFIX . "user\n                            WHERE userid = " . $userid);
                 require_once DIR . '/includes/functions_login.php';
                 vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true);
                 vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true);
                 if ($vbulletin->options['usestrikesystem']) {
                     exec_unstrike_user($vbulletin->GPC['username']);
                 }
                 process_new_login('', 1, $vbulletin->GPC['cssprefs']);
                 cache_permissions($vbulletin->userinfo, true);
                 $vbulletin->session->save();
             }
         }
     }
 } else {
     $valid_entries = FALSE;
     $messages['errors'][] = $message = "Please check your username and password.";
     $messages['fields'][] = $error_type = "username-member";
     $messages['errors'][] = $message = "";
     $messages['fields'][] = $error_type = "password-member";
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:index.php


示例3: switch

// *********************************************************************************
// set $threadedmode (continued from global.php)
if ($vbulletin->options['allowthreadedmode'] and !$show['search_engine'] and !VB_API) {
    if (!empty($vbulletin->GPC['mode'])) {
        // Look for command to switch types on the query string
        switch ($vbulletin->GPC['mode']) {
            case 'threaded':
                $threadedCookieVal = 'threaded';
                break;
            case 'hybrid':
                $threadedCookieVal = 'hybrid';
                break;
            default:
                $threadedCookieVal = 'linear';
        }
        vbsetcookie('threadedmode', $threadedCookieVal);
        $vbulletin->GPC[COOKIE_PREFIX . 'threadedmode'] = $threadedCookieVal;
        unset($threadedCookieVal);
    }
    if (!empty($vbulletin->GPC[COOKIE_PREFIX . 'threadedmode'])) {
        switch ($vbulletin->GPC[COOKIE_PREFIX . 'threadedmode']) {
            case 'threaded':
                $threadedmode = 1;
                break;
            case 'hybrid':
                $threadedmode = 2;
                break;
            default:
                $threadedmode = 0;
        }
    } else {
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:showthread.php


示例4: if

	vbsetcookie('languageid', $languageid);
}
else if ($vbulletin->GPC[COOKIE_PREFIX . 'languageid'] AND !empty($vbulletin->languagecache[$vbulletin->GPC[COOKIE_PREFIX . 'languageid']]['userselect']))
{
	$languageid = $vbulletin->GPC[COOKIE_PREFIX . 'languageid'];
}
else
{
	$languageid = 0;
}

// Set up user's chosen style
if ($vbulletin->GPC['styleid'])
{
	$styleid =& $vbulletin->GPC['styleid'];
	vbsetcookie('userstyleid', $styleid);
}
else if ($vbulletin->GPC[COOKIE_PREFIX . 'userstyleid'])
{
	$styleid = $vbulletin->GPC[COOKIE_PREFIX . 'userstyleid'];
}
else
{
	$styleid = 0;
}

// build the session and setup the environment
$vbulletin->session = new vB_Session($vbulletin, $sessionhash, $vbulletin->GPC[COOKIE_PREFIX . 'userid'], $vbulletin->GPC[COOKIE_PREFIX . 'password'], $styleid, $languageid);

// Hide sessionid in url if we are a search engine or if we have a cookie
$vbulletin->session->set_session_visibility($show['search_engine'] OR $vbulletin->superglobal_size['_COOKIE'] > 0);
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:init.php


示例5: process_logout

function process_logout()
{
	global $vbulletin;

	// clear all cookies beginning with COOKIE_PREFIX
	$prefix_length = strlen(COOKIE_PREFIX);
	foreach ($_COOKIE AS $key => $val)
	{
		$index = strpos($key, COOKIE_PREFIX);
		if ($index == 0 AND $index !== false)
		{
			$key = substr($key, $prefix_length);
			if (trim($key) == '')
			{
				continue;
			}
			// vbsetcookie will add the cookie prefix
			vbsetcookie($key, '', 1);
		}
	}

	if ($vbulletin->userinfo['userid'] AND $vbulletin->userinfo['userid'] != -1)
	{
		// init user data manager
		$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
		$userdata->set_existing($vbulletin->userinfo);
		$userdata->set('lastactivity', TIMENOW - $vbulletin->options['cookietimeout']);
		$userdata->set('lastvisit', TIMENOW);
		$userdata->save();

		// make sure any other of this user's sessions are deleted (in case they ended up with more than one)
		$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE userid = " . $vbulletin->userinfo['userid']);
	}

	$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE sessionhash = '" . $vbulletin->db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'");

	if ($vbulletin->session->created == true)
	{
		// if we just created a session on this page, there's no reason not to use it
		$newsession = $vbulletin->session;
	}
	else
	{
		$newsession = new vB_Session($vbulletin, '', 0, '', $vbulletin->session->vars['styleid']);
	}
	$newsession->set('userid', 0);
	$newsession->set('loggedin', 0);
	$newsession->set_session_visibility(($vbulletin->superglobal_size['_COOKIE'] > 0));
	$vbulletin->session =& $newsession;

	($hook = vBulletinHook::fetch_hook('logout_process')) ? eval($hook) : false;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:52,代码来源:functions_login.php


示例6: log_admin_action

    log_admin_action();
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$vbulletin->input->clean_array_gpc('r', array('redirect' => TYPE_NOHTML));
# Not sure where this comes from
if (!empty($vbulletin->GPC['redirect'])) {
    define('CP_REDIRECT', $vbulletin->GPC['redirect']);
    print_stop_message('redirecting_please_wait');
}
// #############################################################################
// ############################### LOG OUT OF CP ###############################
// #############################################################################
if ($_REQUEST['do'] == 'cplogout') {
    vbsetcookie('cpsession', '', false, true, true);
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "cpsession WHERE userid = " . $vbulletin->userinfo['userid'] . " AND hash = '" . $db->escape_string($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) . "'");
    if (!empty($vbulletin->session->vars['sessionurl_js'])) {
        exec_header_redirect('index.php?' . $vbulletin->session->vars['sessionurl_js']);
    } else {
        exec_header_redirect('index.php');
    }
}
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'frames';
}
if ($_REQUEST['do'] == 'frames') {
    $vbulletin->input->clean_array_gpc('r', array('loc' => TYPE_NOHTML));
    $navframe = '<frame src="index.php?' . $vbulletin->session->vars['sessionurl'] . "do=nav" . iif($cpnavjs, '&amp;cpnavjs=1') . "\" name=\"nav\" scrolling=\"yes\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" border=\"no\" />\n";
    $headframe = '<frame src="index.php?' . $vbulletin->session->vars['sessionurl'] . "do=head\" name=\"head\" scrolling=\"no\" noresize=\"noresize\" frameborder=\"0\" marginwidth=\"10\" marginheight=\"0\" border=\"no\" />\n";
    $mainframe = '<frame src="' . iif(!empty($vbulletin->GPC['loc']), $vbulletin->GPC['loc'], 'index.php?' . $vbulletin->session->vars['sessionurl'] . 'do=home') . "\" name=\"main\" scrolling=\"yes\" frameborder=\"0\" marginwidth=\"10\" marginheight=\"10\" border=\"no\" />\n";
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:index.php


示例7: date

     } else {
         $current['year'] = date('Y');
         $current['month'] = date('m');
         $current['day'] = date('d');
         if ($year < 1970 or mktime(0, 0, 0, $month, $day, $year) <= mktime(0, 0, 0, $current['month'], $current['day'], $current['year'] - 13)) {
             // this user is >13
             $show['coppa'] = false;
         } else {
             if ($vbulletin->options['usecoppa'] == 2) {
                 if ($vbulletin->options['checkcoppa']) {
                     vbsetcookie('coppaage', $month . '-' . $day . '-' . $year, 1);
                 }
                 eval(standard_error(fetch_error('under_thirteen_registration_denied')));
             } else {
                 if ($vbulletin->options['checkcoppa']) {
                     vbsetcookie('coppaage', $month . '-' . $day . '-' . $year, 1);
                 }
                 $show['coppa'] = true;
             }
         }
     }
 } else {
     $show['coppa'] = false;
 }
 ($hook = vBulletinHook::fetch_hook('register_form_start')) ? eval($hook) : false;
 if ($errorlist) {
     $checkedoff['adminemail'] = iif($vbulletin->GPC['options']['adminemail'], 'checked="checked"');
     $checkedoff['showemail'] = iif($vbulletin->GPC['options']['showemail'], 'checked="checked"');
 } else {
     $checkedoff['adminemail'] = iif(bitwise($vbulletin->bf_misc_regoptions['adminemail'], $vbulletin->options['defaultregoptions']), 'checked="checked"');
     $checkedoff['showemail'] = iif(bitwise($vbulletin->bf_misc_regoptions['receiveemail'], $vbulletin->options['defaultregoptions']), 'checked="checked"');
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:register.php


示例8: ExternalAuthorization

 public function ExternalAuthorization($userid)
 {
     $this->vbulletin->userinfo = $this->vbulletin->db->query_first_slave("SELECT userid, password, username FROM " . TABLE_PREFIX . "user WHERE userid='{$userid}'");
     if ($this->vbulletin->userinfo) {
         require_once DIR . '/includes/functions_login.php';
         vbsetcookie('userid', $this->vbulletin->userinfo['userid'], true, true, true);
         vbsetcookie('password', md5($this->vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true);
         exec_unstrike_user($this->vbulletin->userinfo['username']);
         define('EXTERNAL_AUTH', true);
         // create new session
         process_new_login('', 0, '');
     }
     if (!empty($_SERVER['HTTP_REFERER'])) {
         $url = $_SERVER['HTTP_REFERER'];
     } else {
         $url = $this->vbulletin->options['homeurl'];
     }
     if (strpos($url, "?")) {
         $url .= "&vbsession=" . $this->vbulletin->session->vars['sessionhash'];
     } else {
         $url .= "?vbsession=" . $this->vbulletin->session->vars['sessionhash'];
     }
     header('Location:' . $url);
     echo "Вы были перенаправлены сюда <a href='" . $url . "'>" . $url . "</a>";
     exit;
 }
开发者ID:dautushenka,项目名称:dle-vb,代码行数:26,代码来源:class_dle_integration.php


示例9: array

$vbulletin->input->clean_array_gpc('r', array('perpage' => vB_Cleaner::TYPE_UINT));
// if cookie was set, set the perpage value to the value found in cookie only if not set in the request.
// If request perpage is not empty, the user probably set it and we need to update the cookie.
if (!empty($vbulletin->GPC[COOKIE_PREFIX . 'contentlist_perpage'])) {
    if (empty($vbulletin->GPC['perpage'])) {
        $vbulletin->GPC['perpage'] = $vbulletin->GPC[COOKIE_PREFIX . 'contentlist_perpage'];
    }
}
if (!empty($vbulletin->GPC['perpage'])) {
    $perpage = $vbulletin->GPC['perpage'];
} else {
    $perpage = 25;
}
// save to cookie if the request value is different than the one saved in cookie.
if ($perpage != $vbulletin->GPC[COOKIE_PREFIX . 'contentlist_perpage'] and !@headers_sent()) {
    vbsetcookie('contentlist_perpage', $perpage, true, true, true);
}
// ###################### end setting cookies #######################
print_cp_header($vbphrase['content_management']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'contentlist';
}
// articles root channelid
$articleChannelId = vB_Api::instanceInternal('node')->fetchArticleChannel();
// just a wrapper for generateCategoryList because I'm having to call the same3 lines over and over again.
function getFullCategoryList(&$channelInfoArray = array(), $tabsize = 1, $tabchar = "--", $tabspace = " ")
{
    $cache = vB_Cache::instance(vB_Cache::CACHE_STD);
    $cacheKey = "vBAdminCP_CMS_Categories";
    $categories = $cache->read($cacheKey);
    $writeCache = false;
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:31,代码来源:cms.php


示例10: eval

    }
    ($hook = vBulletinHook::fetch_hook('photoplog_settings_letterbar')) ? eval($hook) : false;
    eval('$photoplog[\'letter_bar\'] = "' . fetch_template('photoplog_letter_bar') . '";');
}
// ##################### INITIALIZE CATEGORY BITS #########################
if (defined('PHOTOPLOG_RANDOM') && !defined('PHOTOPLOG_HTTPD') && !$photoplog_perm_fileid && !$photoplog_perm_catid && !$photoplog_perm_commentid && !isset($_REQUEST['u']) && !isset($_REQUEST['q']) && !isset($_REQUEST['page']) && !isset($_REQUEST['v'])) {
    require_once './listing.php';
}
// ##################### INITIALIZE JAVASCRIPT BIT ########################
$vbulletin->input->clean_array_gpc('c', array(COOKIE_PREFIX . 'photoplogjs' => TYPE_BOOL));
$photoplog['jsactive'] = intval($vbulletin->GPC[COOKIE_PREFIX . 'photoplogjs']);
$photoplog_cookiepath = $vbulletin->options['cookiepath'];
$photoplog_cookiedomain = $vbulletin->options['cookiedomain'];
$vbulletin->options['cookiepath'] = '/';
$vbulletin->options['cookiedomain'] = '';
vbsetcookie('photoplogjs', '0', false);
$vbulletin->options['cookiepath'] = $photoplog_cookiepath;
$vbulletin->options['cookiedomain'] = $photoplog_cookiedomain;
unset($photoplog_cookiepath, $photoplog_cookiedomain);
//##################### INITIALIZE STATISTICS BAR #########################
if (defined('PHOTOPLOG_RANDOM') && !defined('PHOTOPLOG_HTTPD') && !isset($_REQUEST['c']) && !isset($_REQUEST['n']) && !isset($_REQUEST['u']) && !isset($_REQUEST['q']) && !isset($_REQUEST['page']) && !isset($_REQUEST['v'])) {
    $photoplog_numbermembers = vb_number_format($vbulletin->userstats['numbermembers']);
    $photoplog_activemembers = vb_number_format($vbulletin->userstats['activemembers']);
    $photoplog_showactivemembers = $vbulletin->options['activememberdays'] > 0 && $vbulletin->options['activememberoptions'] & 2 ? true : false;
    $photoplog_do_sql = "WHERE catid > 0";
    $photoplog_do_arr = array();
    foreach ($photoplog_ds_catopts as $photoplog_ds_catid => $photoplog_ds_value) {
        $photoplog_ds_catid = intval($photoplog_ds_catid);
        if ($photoplog_ds_catopts[$photoplog_ds_catid]['parentid'] < 0 && $photoplog_ds_catopts[$photoplog_ds_catid]['displayorder'] != 0) {
            $photoplog_child_list = array();
            if (isset($photoplog_list_relatives[$photoplog_ds_catid])) {
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:settings.php


示例11: process_logout

function process_logout()
{
    global $vbulletin;
    // clear all cookies beginning with COOKIE_PREFIX
    $prefix_length = strlen(COOKIE_PREFIX);
    foreach ($_COOKIE as $key => $val) {
        $index = strpos($key, COOKIE_PREFIX);
        if ($index == 0 and $index !== false) {
            $key = substr($key, $prefix_length);
            if (trim($key) == '') {
                continue;
            }
            // vbsetcookie will add the cookie prefix
            vbsetcookie($key, '', 1);
        }
    }
    if ($vbulletin->userinfo['userid'] and $vbulletin->userinfo['userid'] != -1) {
        // init user data manager
        $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
        $userdata->set_existing($vbulletin->userinfo);
        $userdata->set('lastactivity', TIMENOW - $vbulletin->options['cookietimeout']);
        $userdata->set('lastvisit', TIMENOW);
        $userdata->save();
        // make sure any other of this user's sessions are deleted (in case they ended up with more than one)
        $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE userid = " . $vbulletin->userinfo['userid']);
    }
    $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE sessionhash = '" . $vbulletin->db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'");
    // Remove accesstoken from apiclient table so that a new one will be generated
    if (defined('VB_API') and VB_API === true and $vbulletin->apiclient['apiclientid']) {
        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "apiclient SET apiaccesstoken = '', userid = 0\n\t\t\tWHERE apiclientid = " . intval($vbulletin->apiclient['apiclientid']));
        $vbulletin->apiclient['apiaccesstoken'] = '';
    }
    if ($vbulletin->session->created == true and !VB_API) {
        // if we just created a session on this page, there's no reason not to use it
        $newsession = $vbulletin->session;
    } else {
        // API should always create a new session here to generate a new accesstoken
        $newsession = new vB_Session($vbulletin, '', 0, '', $vbulletin->session->vars['styleid']);
    }
    $newsession->set('userid', 0);
    $newsession->set('loggedin', 0);
    $newsession->set_session_visibility($vbulletin->superglobal_size['_COOKIE'] > 0);
    $vbulletin->session =& $newsession;
    ($hook = vBulletinHook::fetch_hook('logout_process')) ? eval($hook) : false;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:45,代码来源:functions_login.php


示例12: read_input_context

	/**
	* Reads some context based on general input information
	*/
	public function read_input_context()
	{
		global $vbulletin;

		$vbulletin->input->clean_array_gpc('r', array(
			'referrerid' => TYPE_UINT,
			'a'          => TYPE_STR,
			'nojs'       => TYPE_BOOL
		));

		$vbulletin->input->clean_array_gpc('p', array(
			'ajax' => TYPE_BOOL,
		));

		// #############################################################################
		// set the referrer cookie if URI contains a referrerid
		if ($vbulletin->GPC['referrerid'] AND !$vbulletin->GPC[COOKIE_PREFIX . 'referrerid'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['usereferrer'])
		{
			if ($referrerid = verify_id('user', $vbulletin->GPC['referrerid'], 0))
			{
				vbsetcookie('referrerid', $referrerid);
			}
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:27,代码来源:class_bootstrap.php


示例13: validateFBSession

 /**
  * Makes sure local copy of FB session is in synch with actual FB session
  *
  * @return bool, fb userid if logged in, false otherwise
  */
 protected function validateFBSession()
 {
     // grab the current access token stored locally (in cookie or db depending on login status)
     if ($this->registry->userinfo['userid'] == 0) {
         $curaccesstoken = $this->registry->input->clean_gpc('c', COOKIE_PREFIX . 'fbaccesstoken', TYPE_STR);
     } else {
         $curaccesstoken = !empty($this->registry->userinfo['fbaccesstoken']) ? $this->registry->userinfo['fbaccesstoken'] : '';
     }
     // if we have a new access token that is valid, re-query FB for updated info, and cache it locally
     if ($curaccesstoken != $this->facebook->getAccessToken() and $this->isValidAuthToken()) {
         // update the userinfo array with fresh facebook data
         $this->registry->userinfo['fbaccesstoken'] = $this->facebook->getAccessToken();
         //$this->registry->userinfo['fbprofilepicurl'] = $this->fb_userinfo['pic_square'];
         // if user is guest, store fb session info in cookie
         if ($this->registry->userinfo['userid'] == 0) {
             vbsetcookie('fbaccesstoken', $this->facebook->getAccessToken());
             vbsetcookie('fbprofilepicurl', $this->fb_userinfo['pic_square']);
         } else {
             $this->registry->db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "user\n\t\t\t\t\tSET\n\t\t\t\t\t\tfbaccesstoken = '" . $this->facebook->getAccessToken() . "'\n\t\t\t\t\tWHERE userid = " . $this->registry->userinfo['userid'] . "\n\t\t\t\t");
         }
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:class_facebook.php


示例14: vbsetcookie

            $mobile_browser = true;
        }
    }
    if ($mobile_browser and preg_match('/(ipad|ipod|iphone|blackberry|android|pre\\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
        $mobile_browser_advanced = true;
    }
}
// Set up user's chosen style
if ($vbulletin->GPC['styleid']) {
    $styleid =& $vbulletin->GPC['styleid'];
    vbsetcookie('userstyleid', $styleid);
    if ($styleid == -1) {
        vbsetcookie('skipmobilestyle', 1);
        $vbulletin->GPC[COOKIE_PREFIX . 'skipmobilestyle'] = 1;
    } elseif (isset($vbulletin->options['mobilestyleid_advanced']) and $styleid == $vbulletin->options['mobilestyleid_advanced'] or isset($vbulletin->options['mobilestyleid_basic']) and $styleid == $vbulletin->options['mobilestyleid_basic']) {
        vbsetcookie('skipmobilestyle', 0);
        $vbulletin->GPC[COOKIE_PREFIX . 'skipmobilestyle'] = 0;
    }
} elseif ($mobile_browser_advanced && $vbulletin->options['mobilestyleid_advanced'] && !$vbulletin->GPC[COOKIE_PREFIX . 'skipmobilestyle']) {
    $styleid = $vbulletin->options['mobilestyleid_advanced'];
} elseif ($mobile_browser && $vbulletin->options['mobilestyleid_basic'] && !$vbulletin->GPC[COOKIE_PREFIX . 'skipmobilestyle']) {
    $styleid = $vbulletin->options['mobilestyleid_basic'];
} elseif ($vbulletin->GPC[COOKIE_PREFIX . 'userstyleid']) {
    $styleid = $vbulletin->GPC[COOKIE_PREFIX . 'userstyleid'];
} else {
    $styleid = 0;
}
$session = vB_Session::getNewSession(vB::getDbAssertor(), vB::getDatastore(), vB::getConfig(), $sessionhash, $vbulletin->GPC[COOKIE_PREFIX . 'userid'], $vbulletin->GPC[COOKIE_PREFIX . 'password'], $styleid, $languageid);
vB::setCurrentSession($session);
//needs to go after the session
// fetch url of referring page after we have access to vboptions['forumhome']
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:31,代码来源:init.php


示例15: FatalError

$RedirectMethod = $Config['RedirectMethod'];
if (!in_array($RedirectMethod, array('SubmitForm', 'SendHeader'))) {
    FatalError("Invalid RedirectMethod option: '{$RedirectMethod}'");
}
GetInputData('UserIdentifier', $Username);
GetInputData('LoginMessage', $LoginMessage);
$Username = strip_blank_ascii($Username, ' ');
if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . TABLE_PREFIX . "user \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($Username)) . "'")) {
    if ($CookieUser) {
        vbsetcookie('userid', $vbulletin->userinfo['userid']);
        vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT));
    } else {
        if ($vbulletin->{$_COOKIE}[COOKIE_PREFIX . 'userid'] and $_COOKIE[COOKIE_PREFIX . 'userid'] != $vbulletin->userinfo['userid']) {
            // If there is cookie from other user, delete it
            vbsetcookie('userid', '');
            vbsetcookie('password', '');
        }
    }
} else {
    FatalError("Erroneous or empty query result: " . "SELECT userid, usergroupid, membergroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($Username)) . "'");
}
// Create new session
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session \n\t\t\t\t\t\t\t WHERE sessionhash = '" . $vbulletin->db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'");
if ($vbulletin->session->created == true and $vbulletin->session->vars['userid'] == 0) {
    $newsession =& $vbulletin->session;
} else {
    $newsession =& new vB_Session($vbulletin, '', $vbulletin->userinfo['userid'], '', $vbulletin->session->vars['styleid']);
}
$newsession->set('userid', $vbulletin->userinfo['userid']);
$newsession->set('loggedin', 1);
$newsession->set('bypass', 0);
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:vblogin.php


示例16: vbsetcookie

                         $new_remaining = $fullpage_remaining - 1;
                         vbsetcookie('fullpage', $new_remaining);
                     }
                 } else {
                     if ($fullpage_remaining === '0' || empty($fullpage_remaining) && $vbulletin->options['adintegrate_fullpage_arrival'] == '1') {
                         $fullpage_adcode = createad($vbulletin->options['adintegrate_fullpage_adcode']);
                         if (!empty($fullpage_adcode)) {
                             $adintegrate_domain = explode('/', $vbulletin->options['bburl']);
                             $adintegrate_url = $vbulletin->options['bburl'] . '/advertisement.php?url=' . $adintegrate_domain['0'] . '//' . $adintegrate_domain['2'] . $_SERVER['REQUEST_URI'];
                             header("Location: {$adintegrate_url}");
                         }
                         // + 1 because it will count the page that they'll be bounced to afterwards.
                         $chanceofad++;
                         vbsetcookie('fullpage', $chanceofad);
                     } else {
                         vbsetcookie('fullpage', $chanceofad);
                     }
                 }
             }
         }
     }
 }
 // Footer
 if ($vbulletin->options['adintegrate_footer_onoff'] == '1') {
     if (checkadtime($vbulletin->options['adintegrate_footer_timescale']) != '1') {
         $footer_adcode = createad($vbulletin->options['adintegrate_footer_adcode']);
         if ($vbulletin->options['adintegrate_footer_refresh'] != '0') {
             $footer_adcode .= refreshad_js(footer);
         }
         eval('$footer_advertisement = "' . fetch_template('advertisement_footer') . '";');
         insertads($vbulletin->options['adintegrate_footer_autoinsert'], 'footer', $footer_advertisement);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:global_start.php


示例17: update_threadedmode_cookie

 /**
  * Resets the threadedmode cookie to the user's profile choice
  *
  * @param	integer	User ID
  */
 function update_threadedmode_cookie($userid)
 {
     if (isset($this->user['threadedmode'])) {
         if (!@headers_sent()) {
             vbsetcookie('threadedmode', '', 1);
         }
     }
 }
开发者ID:holandacz,项目名称:nb4,代码行数:13,代码来源:class_dm_user.php


示例18: vbsetcookie

// override cookie
// Set up user's chosen language
if ($vbulletin->GPC['langid'] and !empty($vbulletin->languagecache["{$vbulletin->GPC['langid']}"]['userselect'])) {
    $languageid =& $vbulletin->GPC['langid'];
    vbsetcookie('languageid', $languageid);
} else {
    if ($vbulletin->GPC[COOKIE_PREFIX . 'languageid'] and !empty($vbulletin->languagecache[$vbulletin->GPC[COOKIE_PREFIX . 'languageid']]['userselect'])) {
        $languageid = $vbulletin->GPC[COOKIE_PREFIX . 'languageid'];
    } else {
        $languageid = 0;
    }
}
// Set up user's chosen style
if ($vbulletin->GPC['styleid']) {
    $styleid =& $vbulletin->GPC['styleid'];
    vbsetcookie('styleid', $styleid);
} else {
    if ($vbulletin->GPC[COOKIE_PREFIX . 'styleid']) {
        $styleid = $vbulletin->GPC[COOKIE_PREFIX . 'styleid'];
    } else {
        $styleid = 0;
    }
}
// build the session and setup the environment
$vbulletin->session =& new vB_Session($vbulletin, $sessionhash, $vbulletin->GPC[COOKIE_PREFIX . 'userid'], $vbulletin->GPC[COOKIE_PREFIX . 'password'], $styleid, $languageid);
// Hide sessionid in url if we are a search engine or if we have a cookie
$vbulletin->session->set_session_visibility($show['search_engine'] or $vbulletin->superglobal_size['_COOKIE'] > 0);
$vbulletin->userinfo =& $vbulletin->session->fetch_userinfo();
$vbulletin->session->do_lastvisit_update($vbulletin->GPC[COOKIE_PREFIX . 'lastvisit'], $vbulletin->GPC[COOKIE_PREFIX . 'lastactivity']);
// put the sessionhash into contact-us links automatically if required (issueid 21522)
if ($vbulletin->session->visible and $vbulletin->options['contactuslink'] != '' and substr(strtolower($vbulletin->options['contactuslink']), 0, 7) != 'mailto:') {
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:init.php


示例19: mark_forums_read

/**
* Marks a forum, its child forums and all contained posts as read
*
* @param	integer	Forum ID to be marked as read - leave blank to mark all forums as read
*
* @return	array	Array of affected forum IDs
*/
function mark_forums_read($forumid = false)
{
    global $vbulletin;
    $db =& $vbulletin->db;
    $return_url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'];
    $return_phrase = 'markread';
    $return_forumids = array();
    if (!$forumid) {
        if ($vbulletin->userinfo['userid']) {
            // init user data manager
            $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
            $userdata->set_existing($vbulletin->userinfo);
            $userdata->set('lastactivity', TIMENOW);
            $userdata->set('lastvisit', TIMENOW - 1);
            $userdata->save();
            if ($vbulletin->options['threadmarking']) {
                $query = '';
                foreach ($vbulletin->forumcache as $fid => $finfo) {
                    // mark the forum and all child forums read
                    $query .= ", ({$fid}, " . $vbulletin->userinfo['userid'] . ", " . TIMENOW . ")";
                }
                if ($query) {
                    $query = substr($query, 2);
                    $db->query_write("\n\t\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "forumread\n\t\t\t\t\t\t\t(forumid, userid, readtime)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t{$query}\n\t\t\t\t\t");
                }
            }
        } else {
            vbsetcookie('lastvisit', TIMENOW);
        }
        $return_forumids = array_keys($vbulletin->forumcache);
    } else {
        // temp work around code, I need to find another way to mass set some values to the cookie
        $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'forum_view', TYPE_STR);
        global $bb_cache_forum_view;
        $bb_cache_forum_view = @unserialize(convert_bbarray_cookie($vbulletin->GPC[COOKIE_PREFIX . 'forum_view']));
        require_once DIR . '/includes/functions_misc.php';
        $childforums = fetch_child_forums($forumid, 'ARRAY');
        $return_forumids = $childforums;
        $return_forumids[] = $forumid;
        if ($vbulletin->options['threadmarking'] and $vbulletin->userinfo['userid']) {
            $query = "({$forumid}, " . $vbulletin->userinfo['userid'] . ", " . TIMENOW . ")";
            foreach ($childforums as $child_forumid) {
                // mark the forum and all child forums read
                $query .= ", ({$child_forumid}, " . $vbulletin->userinfo['userid'] . ", " . TIMENOW . ")";
            }
            $db->query_write("\n\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "forumread\n\t\t\t\t\t(forumid, userid, readtime)\n\t\t\t\tVALUES\n\t\t\t\t\t{$query}\n\t\t\t");
            require_once DIR . '/includes/functions_bigthree.php';
            $foruminfo = fetch_foruminfo($forumid);
            $parent_marks = mark_forum_read($foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
            if (is_array($parent_marks)) {
                $return_forumids = array_unique(array_merge($return_forumids, $parent_marks));
            }
        } else {
            foreach ($childforums as $child_forumid) {
                // mark the forum and all child forums read
                $bb_cache_forum_view["{$child_forumid}"] = TIMENOW;
            }
            set_bbarray_cookie('forum_view', $forumid, TIMENOW);
        }
        if ($vbulletin->forumcache["{$forumid}"]['parentid'] == -1) {
            $return_url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'];
        } else {
            $return_url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . 'f=' . $vbulletin->forumcache["{$forumid}"]['parentid'];
        }
        $return_phrase = 'markread_single';
    }
    return array('url' => $return_url, 'phrase' => $return_phrase, 'forumids' => $return_forumids);
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:75,代码来源:functions_misc.php


示例20: eval

                eval(standard_error(fetch_error('badlogin_strikes_passthru', vB5_Route::buildUrl('lostpw|fullurl'), $strikes + 1)));
            } else {
                admin_login_error('badlogin_passthru', array('strikes' => $strikes + 1));
                eval(standard_error(fetch_error('badlogin_passthru', vB5_Route::buildUrl('lostpw|fullurl'), $strikes + 1)));
            }
        }
    }
    vB_User::execUnstrikeUser($vbulletin->GPC['vb_login_username']);
    // create new session
    $res = vB_User::processNewLogin($auth, $vbulletin->GPC['logintype'], $vbulletin->GPC['cssprefs']);
    // set cookies (temp hack for admincp)
    if (isset($res['cpsession'])) {
        vbsetcookie('cpsession', $res['cpsession'], false, true, true);
    }
    vbsetcookie('userid', $res['userid'], false, true, true);
    vbsetcookie('password', $res['password'], false, true, true);
    vbsetcookie('sessionhash', $res['sessionhash'], false, false, true);
    // do redirect
    do_login_redirect();
} else {
    if ($_GET['do'] == 'login') {
        // add consistency with previous behavior
        exec_header_redirect(vB5_Route::buildUrl('home|fullurl'));
    }
}
/*=========================================================================*\
|| #######################################################################
|| # Downloaded: 15:45, Tue Sep 8th 2015
|| # CVS: $RCSfile$ - $Revision: 83432 $
|| #######################################################################
\*=========================================================================*/
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:31,代码来源:login.php



注:本文中的vbsetcookie函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP vbstrlen函数代码示例发布时间:2022-05-23
下一篇:
PHP vbrand函数代码示例发布时间: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