phpCAS::setServerLoginURL PHP Méthode

setServerLoginURL() public static méthode

Set the login URL of the CAS server.
Since: 0.4.21 by Wyman Chan
public static setServerLoginURL ( string $url = '' ) : void
$url string the login URL
Résultat void
    public static function setServerLoginURL($url = '')
    {
        phpCAS::traceBegin();
        phpCAS::_validateClientExists();
        try {
            self::$_PHPCAS_CLIENT->setServerLoginURL($url);
        } catch (Exception $e) {
            phpCAS::error(get_class($e) . ': ' . $e->getMessage());
        }
        phpCAS::traceEnd();
    }

Usage Example

Exemple #1
1
 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('无权限访问');
             }
         }
     }
 }
All Usage Examples Of phpCAS::setServerLoginURL