Beispiel #1
0
 function handleSlo($ret)
 {
     //error_log("handleSlo");
     $r = $this->relayState;
     if ($this->currentHttpMethod == LASSO_HTTP_METHOD_GET && $this->currentHttpMethod == LASSO_HTTP_METHOD_POST) {
         $this->headerHtml("SLO endpoint", $r);
         if ($ret) {
             echo "Demande de slo échoué: " . strError($ret) . "({$ret})";
         } else {
             echo "Demande de slo réussie";
         }
         echo "Go to <a href='{$r}'>{$r}</a>";
         $this->footerHtml();
         lassospkit_clean();
         grr_closeSession($_GET['auto']);
     } else {
         # Specialized
         $id = lassospkit_userid();
         if (isset($id)) {
             //error_log("Trying to destroy session $id");
             chdir("..");
             global $dbsys;
             require_once "./include/config.inc.php";
             include "./include/connect.inc.php";
             require_once "./include/{$dbsys}.inc.php";
             require_once "./include/functions.inc.php";
             require_once "./include/session.inc.php";
             // See admin_view_connexions.php:67
             $sql = "SELECT session_id FROM " . TABLE_PREFIX . "_log\n                      WHERE login = '******'\n                      AND end > NOW()";
             $res = grr_sql_query($sql);
             if ($res) {
                 for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
                     $php_session_id = $row[0];
                     //error_log("Erasing GRR session $php_session_id");
                     session_id($php_session_id);
                     // delete spkitlasso session if necessary
                     @session_start();
                     lassospkit_set_nameid(@$_SESSION['lasso_nameid']);
                     lassospkit_clean();
                     // delete GRR session
                     $auto = 0;
                     grr_closeSession($auto);
                     // Done by grr_closeSession:
                     //session_start();
                     //session_destroy();
                 }
             }
         }
     }
     if ($ret) {
         error_log("Demande de slo échoué: {$ret}");
     } else {
         //error_log("Demande de slo réussie: $ret");
     }
     return $ret;
 }
Beispiel #2
0
 if ($attributes) {
     // Get infos from the Identity Provider
     $user_infos = array();
     // Nom Prénom
     list($tab_login['nom'], $tab_login['fullname']) = split(' ', $attributes['cn'][0]);
     $tab_login['email'] = $attributes['mail'][0];
     // Pour l'instant on ne redéfinit pas le login
     //$tab_login['???'] = $attributes['username'][0];
 }
 $result = grr_opensession($login, $password, $user_ext_authentifie, $tab_login);
 // Stocker le nameid dans la session pour se souvenir que c'est
 // un login lasso
 $_SESSION['lasso_nameid'] = lassospkit_nameid();
 // Ne plus réutiliser la session spkitlasso courante, pour
 // éviter les problèmes de nettoyage au logout distant
 lassospkit_set_nameid(null);
 lassospkit_clean();
 // On écrit les données de session et ferme la session
 session_write_close();
 $message = '';
 if ($result == "2") {
     $message = get_vocab("echec_connexion_GRR");
     $message .= " " . get_vocab("wrong_pwd");
 } else {
     if ($result == "3") {
         // L'utilisateur existe déjà
         $message = get_vocab("echec_connexion_GRR");
         $message .= "<br />" . get_vocab("importation_impossible");
     } else {
         if ($result == "4") {
             $message = get_vocab("echec_connexion_GRR");
Beispiel #3
0
// Paramètres langage
include "include/language.inc.php";

require_once("./include/session.inc.php");


if ((getSettingValue('sso_statut') == 'lasso_visiteur') or (getSettingValue('sso_statut') == 'lasso_utilisateur')) {
  require_once(SPKITLASSO.'/lassospkit_public_api.inc.php');
  session_name(SESSION_NAME);
  @session_start();
  if (@$_SESSION['lasso_nameid'] != NULL)
    {
      // Nous sommes authentifiés: on se déconnecte, puis on revient
      lassospkit_set_userid(getUserName()); // work-around
      lassospkit_set_nameid($_SESSION['lasso_nameid']);
      lassospkit_soap_logout();
      lassospkit_clean();
    }
}



grr_closeSession($_GET['auto']);

if (isset($_GET['url'])) {
  $url = rawurlencode($_GET['url']);
  header("Location: login.php?url=".$url);
  exit;
}