...
|
...
|
@@ -283,23 +283,21 @@ class AbstractAction extends Controller_Abstract |
|
|
*/
|
|
|
protected function getUid($useSession = false)
|
|
|
{
|
|
|
// @todo debug 因登录没有写老的SESSION会话,此处使用COOKIE
|
|
|
$useSession = false;
|
|
|
|
|
|
if (!$this->_uid) {
|
|
|
// 从SESSION获取
|
|
|
if ($useSession) {
|
|
|
$this->_uid = $this->getSession('_UID');
|
|
|
}
|
|
|
// 从COOKIE获取
|
|
|
else {
|
|
|
$cookie = $this->getCookie('_UID');
|
|
|
if (!empty($cookie)) {
|
|
|
$cookieList = explode('::', $cookie);
|
|
|
if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
|
|
|
$this->_uid = $cookieList[1];
|
|
|
$this->_uname = $cookieList[0];
|
|
|
$this->_vip = $cookieList[2];
|
|
|
$cookie = $this->getCookie('_UID');
|
|
|
if (!empty($cookie)) {
|
|
|
$uid = 0;
|
|
|
$cookieList = explode('::', $cookie);
|
|
|
if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
|
|
|
$uid = $cookieList[1];
|
|
|
$this->_uname = $cookieList[0];
|
|
|
$this->_vip = $cookieList[2];
|
|
|
}
|
|
|
// 服务端比较
|
|
|
if ($useSession && $uid) {
|
|
|
$token = $this->getSession('_TOKEN');
|
|
|
if ($token === Helpers::makeToken($uid)) {
|
|
|
$this->_uid = $uid;
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -335,6 +333,7 @@ class AbstractAction extends Controller_Abstract |
|
|
* @param bool $showMore 是否显示更多内容
|
|
|
* @return void
|
|
|
*/
|
|
|
|
|
|
protected function setTitle($title, $showMore = true, $sign = ' | ')
|
|
|
{
|
|
|
$this->_view->assign('title_more', $showMore);
|
...
|
...
|
@@ -399,29 +398,30 @@ class AbstractAction extends Controller_Abstract |
|
|
$header['navBtn'] = true;
|
|
|
}
|
|
|
|
|
|
$controller = $this->getRequest()->getControllerName();
|
|
|
if ($controller !== 'Home') {
|
|
|
// 根据COOKIE记录的频道进行导航定位
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
switch ($channel) {
|
|
|
default:
|
|
|
case 1:
|
|
|
$header['boys'] = true;
|
|
|
break;
|
|
|
case 2:
|
|
|
$header['girls'] = true;
|
|
|
break;
|
|
|
case 3:
|
|
|
$header['kids'] = true;
|
|
|
break;
|
|
|
case 4:
|
|
|
$header['lifeStyle'] = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
$controller = $this->getRequest()->getControllerName();
|
|
|
if ($controller !== 'Home') {
|
|
|
// 根据COOKIE记录的频道进行导航定位
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
switch ($channel) {
|
|
|
default:
|
|
|
case 1:
|
|
|
$header['boys'] = true;
|
|
|
break;
|
|
|
case 2:
|
|
|
$header['girls'] = true;
|
|
|
break;
|
|
|
case 3:
|
|
|
$header['kids'] = true;
|
|
|
break;
|
|
|
case 4:
|
|
|
$header['lifeStyle'] = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->_view->assign('pageHeader', $header);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置网站导航底部信息
|
|
|
*
|
...
|
...
|
|