Compare commits
2 Commits
2a2a96a7b4
...
513b7563b6
| Author | SHA1 | Date | |
|---|---|---|---|
| 513b7563b6 | |||
| 1521d8dec2 |
17
README.md
17
README.md
@@ -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]]
|
||||||
28
index.php
28
index.php
@@ -1,3 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
phpinfo();
|
|
||||||
?>
|
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";
|
||||||
|
|||||||
27
login.php
27
login.php
@@ -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
BIN
screenshots/admin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 138 KiB |
BIN
screenshots/auth.png
Normal file
BIN
screenshots/auth.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
screenshots/error.png
Normal file
BIN
screenshots/error.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
screenshots/success.png
Normal file
BIN
screenshots/success.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
Reference in New Issue
Block a user