phpCAS::getServerLoginURL PHP Method

getServerLoginURL() public static method

or phpCAS::isAuthenticated().
public static getServerLoginURL ( ) : the
return the login name of the authenticated user
    public static function getServerLoginURL()
    {
        phpCAS::_validateClientExists();
        return self::$_PHPCAS_CLIENT->getServerLoginURL();
    }

Usage Example

    /**
     * [Put your description here]
     */
    function main($content, $conf)
    {
        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_USER_INT_obj = 1;
        // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
        $this->pi_loadLL();
        session_start();
        $this->typeExecution = "prod";
        $urlCas = "none";
        $portCas = "none";
        if ($this->typeExecution == "dev") {
            $urlCas = "xinf-devlinux.intranet.haras-nationaux.fr";
            $portCas = 7777;
        } else {
            if ($this->typeExecution == "prod") {
                $urlCas = "cerbere.haras-nationaux.fr";
                $portCas = 443;
            }
        }
        if (isset($_GET["userdebug"])) {
            include_once "typo3conf/ext/dlcube_hn_01/class.WebservicesCompte.php";
            include_once "typo3conf/ext/dlcube_hn_01/class.WebservicesAccess.php";
            $param[] = array("login" => $_GET["userdebug"], "ctx" => null);
            $ws = new WebservicesCompte();
            if (!$ws->connectIdent()) {
                $content = "ERROR:" . $ws->getErrorMessage();
                return $content;
            }
            $result = $ws->getPersonneByLogin($param);
            debug($result);
            print_r($result);
        }
        if (isset($_GET["action"]) && $_GET["action"] == "auth" && !isset($_GET["ticket"])) {
            phpCAS::setDebug();
            phpCAS::client(CAS_VERSION_2_0, $urlCas, $portCas, 'cas', 'true');
            $ur = phpCAS::getServerLoginURL(false);
            $content .= '<IFRAME src="' . $ur . '" frameborder="no" height="600" width="670"></IFRAME>';
            return $this->pi_wrapInBaseClass($content);
        }
        phpCAS::client(CAS_VERSION_2_0, $urlCas, $portCas, 'cas', 'true');
        phpCAS::checkAuthentication();
        $_SESSION["portalId"] = phpCAS::getUser();
        echo '<html><body><script type="text/javascript">
		    window.open( "' . $this->pi_getPageLink($_SESSION["service_id_auth"]) . '", "_top");
		</script></body>';
        exit;
    }
All Usage Examples Of phpCAS::getServerLoginURL