2009-09-06 03:20:22 +02:00
|
|
|
<?php
|
|
|
|
|
2017-12-13 17:50:20 +01:00
|
|
|
// Load config and autoload class
|
|
|
|
require_once("lib/config.php");
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 17:50:20 +01:00
|
|
|
session_name('EVOADMIN_SESS');
|
|
|
|
session_start();
|
2009-09-06 03:20:22 +02:00
|
|
|
|
|
|
|
ob_start();
|
2017-12-13 17:50:20 +01:00
|
|
|
include('inc/haut.php');
|
2009-09-06 03:20:22 +02:00
|
|
|
|
|
|
|
if (isset($_SESSION['login'])) {
|
2017-12-13 17:50:20 +01:00
|
|
|
print "<div class='login-info bg-info'>Déconnecté</div>";
|
|
|
|
session_unset('EVOADMIN_SESS');
|
|
|
|
session_destroy();
|
2009-09-06 03:20:22 +02:00
|
|
|
}
|
|
|
|
|
2017-12-13 17:50:20 +01:00
|
|
|
if (!empty($_POST['login'])) {
|
2017-12-17 18:22:49 +01:00
|
|
|
try {
|
2017-12-17 21:44:10 +01:00
|
|
|
$login = htmlentities(strip_tags($_POST['login']),ENT_NOQUOTES);
|
|
|
|
$password = htmlentities(strip_tags($_POST['password']),ENT_NOQUOTES);
|
2018-01-27 18:11:57 +01:00
|
|
|
$server = new LdapServer($login, $config['ldap']);
|
2017-12-17 21:44:10 +01:00
|
|
|
$server->login($password);
|
2017-12-17 18:22:49 +01:00
|
|
|
$_SESSION['login'] = $server->getLogin();
|
|
|
|
header("location: superadmin.php\n\n");
|
|
|
|
exit(0);
|
|
|
|
} catch (Exception $e) {
|
|
|
|
print '<div class="alert alert-danger" role="alert">'.$e->getMessage().'</div>';
|
2009-09-06 03:20:22 +02:00
|
|
|
}
|
2017-12-13 17:50:20 +01:00
|
|
|
}
|
2017-10-11 19:39:22 +02:00
|
|
|
?>
|
2017-12-13 17:50:20 +01:00
|
|
|
|
|
|
|
<div class="loginpage">
|
|
|
|
<div class="loginbox">
|
|
|
|
<div class="illustration">
|
2018-01-27 23:30:25 +01:00
|
|
|
<img src="assets/<?php print VERSION; ?>/logo.png" class="img-responsive" alt="Responsive image">
|
2017-12-11 18:32:24 +01:00
|
|
|
</div>
|
2017-12-13 17:50:20 +01:00
|
|
|
<form method="POST" action="auth.php" method="post" name="auth">
|
|
|
|
<div class="form-group has-feedback has-feedback-left">
|
|
|
|
<input type="text" name="login" class="form-control" placeholder="Utilisateur" autofocus="autofocus"/>
|
|
|
|
<i class="glyphicon glyphicon-user form-control-feedback"></i>
|
|
|
|
</div>
|
|
|
|
<div class="form-group has-feedback has-feedback-left">
|
|
|
|
<input type="password" name="password" class="form-control" placeholder="Mot de passe" />
|
|
|
|
<i class="glyphicon glyphicon-lock form-control-feedback"></i>
|
|
|
|
</div>
|
|
|
|
<div class="form-group text-center">
|
|
|
|
<button type="submit" class="btn btn-primary" onclick="return submit_login();">Connexion</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2017-12-11 18:32:24 +01:00
|
|
|
</div>
|
2017-12-13 17:50:20 +01:00
|
|
|
</div>
|
2017-12-11 18:32:24 +01:00
|
|
|
|
2017-12-13 17:50:20 +01:00
|
|
|
<?php
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 17:50:20 +01:00
|
|
|
include('inc/fin.php');
|
2009-09-06 03:20:22 +02:00
|
|
|
ob_end_flush();
|
|
|
|
|
|
|
|
?>
|