case 'FACEBOOK': unset($_SESSION['auth_method_try']); require 'lib/OAuth/login_with_facebook.php'; break; case 'GOOGLE': unset($_SESSION['auth_method_try']); require 'lib/OAuth/login_with_google.php'; break; } unset($_SESSION['auth_method_try']); } // Si une authentification externe a eu lieu, appel des méthodes : register/signin if (isset($_SESSION['auth_info_method']) && isset($_SESSION['auth_info_login']) && $_SESSION['auth_info_login'] > 0) { $userM = new userManager(); $userM->register($_SESSION['auth_info_method'], $_SESSION['auth_info_name'], $_SESSION['auth_info_login'], $_SESSION['auth_info_avatar_store'], $_SESSION['auth_info_lastname'], $_SESSION['auth_info_firstname'], $_SESSION['auth_info_mail']); $_SESSION['USER_ID'] = $userM->signIn($_SESSION['auth_info_method'], '', $_SESSION['auth_info_login']); unset($_SESSION['auth_info_method']); unset($_SESSION['OAUTH_ACCESS_TOKEN']); unset($_SESSION['auth_infos']); } // If user env is not already defined $user = new user($_SESSION['USER_ID']); $_SESSION['USER_NAME'] = $user->name; // Used for javascript and html uniq id $mtRand = mt_rand(); // On définit les variables php //ini_set("SMTP", "smtp.squarebrain.eu:587"); // Set the timezone date_default_timezone_set(get_ini('TIMEZONE')); // Include plugin function file if ($g != 'core' && is_file('plugins/' . $g . '/__functions.php')) {
$login = $_POST['login']; } else { // TODO ERROR } if (isset($_GET['pass'])) { $pass = $_GET['pass']; } elseif (isset($_POST['pass'])) { $pass = $_POST['pass']; } else { // TODO ERROR } if ($pass == '' || $login == '') { // TODO ERROR } else { $userM = new userManager(); $userId = $userM->signIn('LDAP', $login, $pass); if ($userId > 0) { $_SESSION['USER_ID'] = $userId; echo 'Welcome!'; echo '<script>location.reload();</script>'; } else { // TODO error echo 'Ce compte n\'est pas référencé sur ce serveur. Veuillez créer un compte ou contacter votre administrateur.'; } } break; case 'ldapResetPassword': echo ' The password is the same of your OS session. If you forget it, please call your desktop support. '; break;