2018-06-01 17:10:45 +01:00
|
|
|
<?php
|
|
|
|
|
2020-01-10 12:01:31 +00:00
|
|
|
set_include_path( ".:" . __DIR__ . "/../includes/");
|
|
|
|
|
|
|
|
include_once "web_functions.inc.php";
|
|
|
|
include_once "ldap_functions.inc.php";
|
2018-06-01 17:10:45 +01:00
|
|
|
|
|
|
|
if (isset($_POST["admin_password"])) {
|
|
|
|
|
|
|
|
$ldap_connection = open_ldap_connection();
|
|
|
|
$user_auth = ldap_setup_auth($ldap_connection,$_POST["admin_password"]);
|
|
|
|
ldap_close($ldap_connection);
|
2020-05-06 17:19:20 +01:00
|
|
|
|
2018-06-04 15:20:53 +01:00
|
|
|
if ($user_auth != FALSE) {
|
2018-06-01 17:10:45 +01:00
|
|
|
set_setup_cookie($user_auth);
|
2023-01-10 10:51:18 +01:00
|
|
|
header("Location: //{$_SERVER["HTTP_HOST"]}{$THIS_MODULE_PATH}/run_checks.php\n\n");
|
2018-06-01 17:10:45 +01:00
|
|
|
}
|
|
|
|
else {
|
2023-01-10 10:51:18 +01:00
|
|
|
header("Location: //{$_SERVER["HTTP_HOST"]}{$THIS_MODULE_PATH}/index.php?invalid\n\n");
|
2018-06-01 17:10:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
2021-07-22 09:12:55 +01:00
|
|
|
render_header("$ORGANISATION_NAME account manager setup - log in");
|
2018-06-01 17:10:45 +01:00
|
|
|
|
|
|
|
if (isset($_GET["invalid"])) {
|
|
|
|
?>
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
<p class="text-center">The password was incorrect.</p>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<div class="container">
|
2020-05-06 17:19:20 +01:00
|
|
|
<div class="panel panel-default">
|
2018-06-01 17:10:45 +01:00
|
|
|
<div class="panel-heading text-center">Password for <?php print $LDAP['admin_bind_dn']; ?></div>
|
2020-05-06 17:19:20 +01:00
|
|
|
<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>
|
2018-06-01 17:10:45 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
render_footer();
|
|
|
|
?>
|