public function auth($isRedirect = true)
{
// 判断是否为退出操作
if ($this->ctrl == 'index' && $this->act == 'logout') {
$this->_logout();
} elseif ($this->ctrl == 'index' && $this->act == 'synlogout') {
$this->_synlogout();
} else {
if ($isRedirect) {
phpCAS::setServerLoginURL($this->loginUrl());
phpCAS::forceAuthentication();
$this->casInfo = $this->_getUser();
if ($backurl = $this->request->getQuery('backurl')) {
$backurl = 'http://' . $this->cfg['host'] . ':' . $this->cfg['port'] . '/index/sessid?backurl=' . urlencode($backurl) . '&st=' . session_id();
$this->response->redirect($backurl);
return;
}
if ($this->isAdmin && !$this->_checkPerm()) {
exit('无权限访问');
}
}
}
}