mirror of
https://github.com/wheelybird/ldap-user-manager.git
synced 2025-01-18 23:42:54 +01:00
86c82a402e
* Custom email body (#51) * get email body from ENV * read subject from env * html mail * replace special string with username and password * missing ; * more str_replace * utf8 in mail * typo * docs * fix var * count accounts * fix print * Add the ability to set the server path. Get directed to the appropriate module when you log in. * Fixes to allow overriding attribute labels properly * Fix server_path in various places, update to cookies use 'samesite', include boostrap and queryjs files so LUM can run without internet access. Co-authored-by: Monsieur X <xgaia@gmx.com>
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
set_include_path( ".:" . __DIR__ . "/../includes/");
|
|
|
|
include_once "web_functions.inc.php";
|
|
include_once "ldap_functions.inc.php";
|
|
|
|
if (isset($_POST["admin_password"])) {
|
|
|
|
$ldap_connection = open_ldap_connection();
|
|
$user_auth = ldap_setup_auth($ldap_connection,$_POST["admin_password"]);
|
|
ldap_close($ldap_connection);
|
|
|
|
if ($user_auth != FALSE) {
|
|
set_setup_cookie($user_auth);
|
|
header("Location: //${_SERVER["HTTP_HOST"]}${THIS_MODULE_PATH}/run_checks.php\n\n");
|
|
}
|
|
else {
|
|
header("Location: //${_SERVER["HTTP_HOST"]}${THIS_MODULE_PATH}/index.php?invalid\n\n");
|
|
}
|
|
|
|
}
|
|
else {
|
|
|
|
render_header("$ORGANISATION_NAME account manager setup - log in");
|
|
|
|
if (isset($_GET["invalid"])) {
|
|
?>
|
|
<div class="alert alert-warning">
|
|
<p class="text-center">The password was incorrect.</p>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
<div class="container">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading text-center">Password for <?php print $LDAP['admin_bind_dn']; ?></div>
|
|
<div class="panel-body text-center">
|
|
<form class="form-inline" action='' method='post'>
|
|
<div class="form-group">
|
|
<input type='password' class="form-control" name='admin_password'>
|
|
</div>
|
|
<div class="form-group">
|
|
<input type='submit' class="btn btn-default" value='Log in'>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
render_footer();
|
|
?>
|