setServerServiceValidateURL() public static method

Used only in CAS 1.0 validations
public static setServerServiceValidateURL ( string $url = '' ) : void
$url string the serviceValidate URL
return void
Ejemplo n.º 1
0
    session_destroy();
}
/**
    Etablis le status de visiteur si non connecté
     **/
if (!isset($_SESSION['rang'])) {
    $_SESSION['rang'] = 0;
}
/**
		Récupération des informations sur la page actuelle
	**/
if ($currentPageData = getCurrentPageData()) {
    if ($currentPageData['fullRight'][$_SESSION['rang']] == 0) {
        // On invite l'utilisateur à se connecter au CAS
        phpCAS::client(CAS_VERSION_2_0, CAS_SERVER_URI, (int) constant('CAS_SERVER_PORT'), '');
        phpCAS::setServerServiceValidateURL(CAS_SERVER_VALIDATEURI);
        if (is_file(CAS_SERVER_CERTIFICATPATH)) {
            phpCAS::setCasServerCACert(CAS_SERVER_CERTIFICATPATH);
        } else {
            phpCAS::setNoCasServerValidation();
        }
        phpCAS::forceAuthentication();
        if (phpCAS::getUser()) {
            //Si l'utilisateur s'est connecté
            // Récupération des données serveur
            $test = phpCAS::checkAuthentication();
            // Récupération des données utilisateur
            $sql = 'SELECT * FROM user WHERE nbEtudiant = :nbEtu LIMIT 1';
            $res = $db->prepare($sql);
            $res->execute(array('nbEtu' => phpCAS::getUser()));
            if ($res_f = $res->fetch()) {
Ejemplo n.º 2
0
         $fichier_nom_fin = fabriquer_fin_nom_fichier__pseudo_alea($fichier_nom_debut);
         phpCAS::setDebug(PHPCAS_CHEMIN_LOGS . $fichier_nom_debut . '_' . $fichier_nom_fin . '.txt');
     }
 }
 // Initialiser la connexion avec CAS  ; le premier argument est la version du protocole CAS ; le dernier argument indique qu'on utilise la session existante
 phpCAS::client(CAS_VERSION_2_0, $cas_serveur_host, (int) $cas_serveur_port, $cas_serveur_root, FALSE);
 phpCAS::setLang(PHPCAS_LANG_FRENCH);
 // Surcharge éventuelle des URL
 if ($cas_serveur_url_login) {
     phpCAS::setServerLoginURL($cas_serveur_url_login);
 }
 if ($cas_serveur_url_logout) {
     phpCAS::setServerLogoutURL($cas_serveur_url_logout);
 }
 if ($cas_serveur_url_validate) {
     phpCAS::setServerServiceValidateURL($cas_serveur_url_validate);
 }
 // Suite à des attaques DDOS, Kosmos a décidé en avril 2015 de filtrer les requêtes en bloquant toutes celles sans User-Agent.
 // C'est idiot car cette valeur n'est pas fiable, n'importe qui peut présenter n'importe quel User-Agent !
 // En attendant qu'ils appliquent un remède plus intelligent, et au cas où un autre prestataire aurait la même mauvaise idée, on envoie un User-Agent bidon (défini dans le loader)...
 phpCAS::setExtraCurlOption(CURLOPT_USERAGENT, CURL_AGENT);
 // Appliquer un proxy si défini par le webmestre ; voir cURL::get_contents() pour les commentaires.
 if (defined('SERVEUR_PROXY_USED') && SERVEUR_PROXY_USED) {
     phpCAS::setExtraCurlOption(CURLOPT_PROXY, SERVEUR_PROXY_NAME);
     phpCAS::setExtraCurlOption(CURLOPT_PROXYPORT, (int) SERVEUR_PROXY_PORT);
     phpCAS::setExtraCurlOption(CURLOPT_PROXYTYPE, constant(SERVEUR_PROXY_TYPE));
     if (SERVEUR_PROXY_AUTH_USED) {
         phpCAS::setExtraCurlOption(CURLOPT_PROXYAUTH, constant(SERVEUR_PROXY_AUTH_METHOD));
         phpCAS::setExtraCurlOption(CURLOPT_PROXYUSERPWD, SERVEUR_PROXY_AUTH_USER . ':' . SERVEUR_PROXY_AUTH_PASS);
     }
 }
Ejemplo n.º 3
0
 /**
  * @todo make this options usable.
  * @todo move to other class
  *
  * @param string $providerName defined in Settings.yaml
  *
  * @throws \TYPO3\Flow\Exception
  *
  * @return void
  */
 private function setOptionalClientSettings($providerName)
 {
     $casClientSettings = $this->getClientSettingsByProviderName($providerName);
     try {
         if (!empty($casClientSettings['serverLoginURL'])) {
             \phpCAS::setServerLoginURL($casClientSettings['serverLoginURL']);
         }
         if (!empty($casClientSettings['serverLogoutURL'])) {
             \phpCAS::setServerLogoutURL($casClientSettings['serverLogoutURL']);
         }
         if (!empty($casClientSettings['serverProxyValidateURL'])) {
             \phpCAS::setServerProxyValidateURL($casClientSettings['serverProxyValidateURL']);
         }
         if (!empty($casClientSettings['serverSamlValidateURL'])) {
             \phpCAS::setServerSamlValidateURL($casClientSettings['serverSamlValidateURL']);
         }
         if (!empty($casClientSettings['serverServiceValidateURL'])) {
             \phpCAS::setServerServiceValidateURL($casClientSettings['serverServiceValidateURL']);
         }
         // since CAS 4.0 disbled
         if (!empty($casClientSettings['singleSignoutCallback'])) {
             \phpCAS::setSingleSignoutCallback($casClientSettings['singleSignoutCallback']);
         }
     } catch (\Exception $exc) {
         throw new \TYPO3\Flow\Exception('Can not set some optianal property in Jasigs phpCAS broken on: ' . $exc->getCode() . ' with message: ' . $exc->getMessage(), 1372519681);
     }
 }