コード例 #1
0
 /**
  * 必须登录检查,若未登录跳转至登录页
  */
 protected function mustLoginCheck()
 {
     if ($this->mustLogin) {
         if (!$this->isLogin()) {
             if (ComTool::isAjax()) {
                 exit('not login');
             } else {
                 Cola_Response::redirect(ComTool::url("acc/super_login"));
             }
         }
     }
 }
コード例 #2
0
 /**
  * 必须登录检查,若未登录跳转至登录页
  */
 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"));
             }
         }
     }
 }
コード例 #3
0
 /**
  * 必须登录检查,若未登录跳转至登录页
  */
 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}"));
             }
         }
     }
 }
コード例 #4
0
ファイル: ApiDemoTest.php プロジェクト: soft456/php_tools
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), '&nbsp;', $codeStr2);
    //        $codeStr2 = str_replace('&nbsp;&nbsp;&nbsp;&nbsp;', '', $codeStr2);
    echo '* ' . $codeStr2;
    if ($isCode) {
        echo '}';
    } else {
        echo "<br>*/";
    }
    exit;
}