common_cadline_libraries (CRM hardlock/db/users classes; upstream cadline_web/cadcommonlib), maintenance/ (ARCHLine.XP license backend; upstream cadline_web/maintenance), maintenance2/. Vetted live files (byte-truth); upstream repos in PROVENANCE.md. NOTE: could be git submodules — kept as live files for byte-fidelity. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
97 lines
2.9 KiB
PHP
97 lines
2.9 KiB
PHP
<?php
|
|
if (!class_exists('Database')) require_once("common_cadline_libraries/crm_database.class.php");
|
|
|
|
error_reporting(E_ERROR | E_PARSE);
|
|
|
|
session_start();
|
|
|
|
if (isset($_SESSION['username'])) header("location: server_status.php");
|
|
|
|
$error = '';
|
|
|
|
if (isset($_POST['submit'])) {
|
|
require_once '../PasswordHash.php';
|
|
|
|
$query = "SELECT * FROM sync_crm.admins WHERE username = ?";
|
|
Database::getInstance()->query($query, array('s', $_POST["username"]));
|
|
$admin = Database::getInstance()->fetchNext();
|
|
|
|
$phpass = new PasswordHash(10, true);
|
|
$ok = $phpass->CheckPassword($_POST["password"], $admin['password']);
|
|
|
|
if ($ok) {
|
|
$_SESSION['username'] = $_POST["username"];
|
|
header("location: server_status.php");
|
|
} else {
|
|
$error = 'Hibás felhasználónév vagy jelszó';
|
|
}
|
|
}
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<style media="screen">
|
|
.col-centered {
|
|
float: none;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.alert {
|
|
margin-left: 3% !important;
|
|
}
|
|
|
|
#login-form {
|
|
margin-top: 15%;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 1rem;
|
|
}
|
|
</style>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
|
|
|
<title>Bejelentkezés</title>
|
|
</head>
|
|
|
|
<body>
|
|
<form action="" method="POST" id="login-form">
|
|
<div class="container">
|
|
<div class="col-md-6 col-centered">
|
|
<?php if ($error != "") : ?>
|
|
<div class="alert alert-danger col-md-8" role="alert">
|
|
<?= $error ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="row">
|
|
<div id="form-login-username" class="form-group col-md-9">
|
|
<input id="modlgn-username" type="text" name="username" class="form-control" tabindex="0" size="18" placeholder="Felhasználónév" required />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div id="form-login-password" class="form-group col-md-9">
|
|
<div class="controls">
|
|
<input id="modlgn-passwd" type="password" name="password" class="form-control" tabindex="0" size="18" placeholder="Jelszó" required />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<input type="submit" value="Bejelentkezés" class="btn btn-primary" id="loginbtn" name="submit" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<script>
|
|
document.getElementById("modlgn-username").focus();
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|