debut
This commit is contained in:
33
login.php
Normal file
33
login.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_POST["domain"]) || !isset($_POST["user"]) || !isset($_POST["password"])) {
|
||||
require_once "templates/login_form.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
$domain = rtrim($_POST["domain"]);
|
||||
$user = rtrim($_POST["user"]);
|
||||
$password = rtrim($_POST["password"]);
|
||||
|
||||
require_once "ldap.php";
|
||||
|
||||
$result = LdapConnect($domain, $user, $password, []);
|
||||
|
||||
ldap_parse_result($handle, $result, $error_code, $matched_dn, $error_message, $referrals, $controls);
|
||||
|
||||
|
||||
if ($error_code != 0) {
|
||||
require_once "templates/login_failed.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "view/View.php";
|
||||
|
||||
$info = LdapGetUserInfo($user);
|
||||
|
||||
$body = PrintLoginInfo($info);
|
||||
|
||||
require_once "templates/login_success.html.php";
|
||||
|
||||
// TODO: style
|
||||
// TODO: Mettre les tentatives dans la db
|
||||
Reference in New Issue
Block a user