28 lines
555 B
PHP
28 lines
555 B
PHP
<?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 = LdapIsConnected($domain, $user, $password, []);
|
|
|
|
if (!$result) {
|
|
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";
|