本文整理汇总了PHP中Cookie::v方法的典型用法代码示例。如果您正苦于以下问题:PHP Cookie::v方法的具体用法?PHP Cookie::v怎么用?PHP Cookie::v使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::v方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_skin
private function load_skin()
{
global $globals;
//Force h4ck3s (reloaded)
/*
$gf = new GroupFilter((Group::isId('h4ck3s')) ? new GFC_Id('h4ck3s') : new GFC_Name('h4ck3s'));
$group = $gf->get(true);
if(!S::user()->hasRights($group, new Rights('member')) && !isSmartphone()){
S::set('skin', 'default.h4ck3s');
}
*/
if (!S::has('skin') || S::v('skin') == "") {
if (Cookie::has('skin')) {
$skin = Cookie::v('skin');
} else {
$skin = isSmartphone() ? $globals->smartphone_skin : $globals->skin;
}
S::set('skin', $skin);
} else {
$skin = S::v('skin');
if (S::v('auth') >= AUTH_COOKIE && Cookie::v('skin') != $skin) {
Cookie::set('skin', $skin, 300);
}
}
return $skin;
}
示例2: tryCookie
/** Checks the cookie and set user_id according in cookie_uid variable
*/
private function tryCookie()
{
S::kill('cookie_uid');
//Remove previously stored id
if (!Cookie::has('uid') || !Cookie::has('hash')) {
return self::COOKIE_INCOMPLETE;
}
$res = XDB::query("SELECT uid, password\n FROM account\n WHERE uid = {?} AND state = 'active'", Cookie::i('uid'));
if ($res->numRows() == 1) {
list($uid, $password) = $res->fetchOneRow();
if (sha1($password) == Cookie::v('hash')) {
S::set('cookie_uid', $uid);
return self::COOKIE_SUCCESS;
} else {
return self::COOKIE_WRONG_HASH;
}
}
return self::COOKIE_WRONG_UID;
}
示例3: tryCookie
/** Check the cookie and set the associated uid in the auth_by_cookie session variable.
*/
private function tryCookie()
{
S::kill('auth_by_cookie');
if (Cookie::v('access') == '' || !Cookie::has('uid')) {
return self::NO_COOKIE;
}
$res = XDB::query('SELECT uid, password
FROM accounts
WHERE uid = {?} AND state = \'active\'', Cookie::i('uid'));
if ($res->numRows() != 0) {
list($uid, $password) = $res->fetchOneRow();
if (sha1($password) == Cookie::v('access')) {
S::set('auth_by_cookie', $uid);
return self::COOKIE_SUCCESS;
} else {
return self::INVALID_COOKIE;
}
}
return self::INVALID_USER;
}