CAS_Client::getServerLoginURL PHP Метод

getServerLoginURL() публичный Метод

This method is used to retrieve the login URL of the CAS server.
public getServerLoginURL ( boolean $gateway = false, boolean $renew = false ) : a
$gateway boolean true to check authentication, false to force it
$renew boolean true to force the authentication with the CAS server
Результат a URL.
    public function getServerLoginURL($gateway = false, $renew = false)
    {
        phpCAS::traceBegin();
        // the URL is build only when needed
        if (empty($this->_server['login_url'])) {
            $this->_server['login_url'] = $this->_buildQueryUrl($this->_getServerBaseURL() . 'login', 'service=' . urlencode($this->getURL()));
        }
        $url = $this->_server['login_url'];
        if ($renew) {
            // It is recommended that when the "renew" parameter is set, its
            // value be "true"
            $url = $this->_buildQueryUrl($url, 'renew=true');
        } elseif ($gateway) {
            // It is recommended that when the "gateway" parameter is set, its
            // value be "true"
            $url = $this->_buildQueryUrl($url, 'gateway=true');
        }
        phpCAS::traceEnd($url);
        return $url;
    }

Usage Example

Пример #1
0
 /**
  * This method returns the URL to be used to login.
  * or phpCAS::isAuthenticated().
  *
  * @return the login name of the authenticated user
  */
 public static function getServerLoginURL()
 {
     phpCAS::_validateClientExists();
     return self::$_PHPCAS_CLIENT->getServerLoginURL();
 }
CAS_Client