/** * 必须登录检查,若未登录跳转至登录页 */ protected function mustLoginCheck() { if ($this->mustLogin) { if (!$this->isLogin()) { if (ComTool::isAjax()) { exit('not login'); } else { Cola_Response::redirect(ComTool::url("acc/super_login")); } } } }
/** * 必须登录检查,若未登录跳转至登录页 */ protected function mustLoginCheck() { if ($this->mustLogin) { if (!$this->isLogin()) { if (ComTool::isAjax()) { exit('not login'); } else { /* $token = trim ( $this->get ( 'token', '' ) ); */ Cola_Response::redirect(ComTool::url("acc/manage_login")); } } } }
/** * 必须登录检查,若未登录跳转至登录页 */ protected function mustLoginCheck() { if ($this->mustLogin) { if (!$this->isLogin()) { if (ComTool::isAjax()) { //ComTool::ajax ( Cola::getConfig ( '_error.mustlogin' ), '请先登录,即将跳转至登录页面' ); } else { $pathinfo = trim($_SERVER['PATH_INFO'], '/\\'); $returnUrl = urlencode(ComTool::urlRoot() . $pathinfo); Cola_Response::redirect(ComTool::url("acc/login?returnUrl={$returnUrl}")); } } } }
function showCodeAction() { $c = $this->get('c'); $isCode = intval($this->get('t')); $codeStr = json_decode(base64_decode($c), 1); Cola_Response::charset(); if ($isCode) { echo '{'; } else { echo "/**<br>"; } $codeStr2 = $isCode ? str_replace(chr(13), '<br>', $codeStr) : str_replace(chr(10), '<br>', $codeStr); $codeStr2 = str_replace(chr(32), ' ', $codeStr2); // $codeStr2 = str_replace(' ', '', $codeStr2); echo '* ' . $codeStr2; if ($isCode) { echo '}'; } else { echo "<br>*/"; } exit; }