Compare commits

...

2 Commits

Author SHA1 Message Date
513b7563b6 refactor 2025-03-27 20:38:02 +01:00
1521d8dec2 add README 2025-03-27 20:36:51 +01:00
9 changed files with 44 additions and 30 deletions

View File

@@ -0,0 +1,17 @@
# PHP LDAP
Page d'authentification :
[[screenshots/auth.png]]
Page d'erreur :
[[screenshots/error.png]]
Page utilisateur :
[[screenshots/success.png]]
Page admin (en se connectant avec l'utilisateur Administrateur):
[[screenshots/admin.png]]

View File

@@ -1,3 +1,27 @@
<?php
phpinfo();
?>
<?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 "src/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";

View File

@@ -1,27 +0,0 @@
<?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";

BIN
screenshots/admin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
screenshots/auth.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
screenshots/error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
screenshots/success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB