Exemple #1
0
          * ADA DB or had just been created by the above code
          */
         if (is_object($userObj) && $userObj instanceof ADALoggableUser) {
             /**
              * $selectedLanguage is coming from $_GET and is the
              * user selection in the login form. If the login provider
              * sets an ADA supported user language, set that instead of
              * user selection
              */
             if (!is_null($language)) {
                 $selectedLanguage = $language;
             }
             // WARNING!! only one set of options is supported on this login provider
             $hybridLogin->setSuccessfulOptionsID(1);
             // set session and redirect
             ADALoggableUser::setSessionAndRedirect($userObj, $remindme, $selectedLanguage, $hybridLogin);
         } else {
             // throw an exception
             $hybridLogin->logOutFromProvider();
             throw new Exception(null, 9);
         }
     }
 } catch (Exception $e) {
     require_once ROOT_DIR . '/browsing/include/browsing_functions.inc.php';
     switch ($e->getCode()) {
         case 0:
             $message = "Errore sconosciuto.";
             break;
         case 1:
             $message = "Errore di configurazione di Hybridauth.";
             break;
Exemple #2
0
                     if (is_object($lastTry) && $lastTry instanceof ADALoggableUser) {
                         $loginObj = null;
                         $userObj = $lastTry;
                     }
                 }
             }
         }
     }
     if (is_object($userObj) && $userObj instanceof ADALoggableUser) {
         if (isset($_SESSION['subscription_page'])) {
             $redirectURL = $_SESSION['subscription_page'];
             unset($_SESSION['subscription_page']);
         } else {
             $redirectURL = $navigationHistoryObj->lastModule();
         }
         if (!ADALoggableUser::setSessionAndRedirect($userObj, $p_remindme, $p_selected_language, $loginObj, $redirectURL)) {
             //  Utente non loggato perché stato <> ADA_STATUS_REGISTERED
             $login_error_message = translateFN("Utente non abilitato");
         }
     } else {
         if (is_object($userObj) && $userObj instanceof Exception) {
             $login_error_message = $userObj->getMessage();
             if ($userObj->getCode() !== 0) {
                 $login_error_message .= ' (' . $userObj->getCode() . ')';
             }
         } else {
             // Utente non loggato perché coppia username password non corretta
             $login_error_message = translateFN("Username  e/o password non valide");
         }
     }
 }