mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
New hooks for admin page, for head, body, and before_page
+move LOGIN_POST to correct place
This commit is contained in:
parent
1166ddfe87
commit
3a3411c117
@ -70,7 +70,9 @@ if(!@file_exists($file)) {
|
||||
}
|
||||
|
||||
ob_start();
|
||||
include($file);
|
||||
if($hooks->trigger(HOOK_ADMIN_BEFORE_PAGE)) {
|
||||
require $file;
|
||||
}
|
||||
|
||||
$content .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
@ -2,6 +2,7 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<?php $hooks->trigger(HOOK_ADMIN_HEAD_START); ?>
|
||||
<?php echo template_header(true); ?>
|
||||
<title><?php echo (isset($title) ? $title . ' - ' : '') . $config['lua']['serverName'];?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
@ -16,8 +17,10 @@
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||
<?php $hooks->trigger(HOOK_ADMIN_HEAD_END); ?>
|
||||
</head>
|
||||
<body class="sidebar-mini ">
|
||||
<?php $hooks->trigger(HOOK_ADMIN_BODY_START); ?>
|
||||
<?php if ($logged && admin()) { ?>
|
||||
<div class="wrapper">
|
||||
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
|
||||
@ -195,5 +198,6 @@ if ($logged && admin()) {
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/datatables.bs.min.js"></script>
|
||||
<?php } ?>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/adminlte.min.js"></script>
|
||||
<?php $hooks->trigger(HOOK_ADMIN_BODY_END); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -55,7 +55,15 @@ define('HOOK_ACCOUNT_LOGIN_AFTER_PASSWORD', ++$i);
|
||||
define('HOOK_ACCOUNT_LOGIN_AFTER_REMEMBER_ME', ++$i);
|
||||
define('HOOK_ACCOUNT_LOGIN_AFTER_PAGE', ++$i);
|
||||
define('HOOK_ACCOUNT_LOGIN_POST', ++$i);
|
||||
define('HOOK_ADMIN_HEAD_END', ++$i);
|
||||
define('HOOK_ADMIN_HEAD_START', ++$i);
|
||||
define('HOOK_ADMIN_BODY_START', ++$i);
|
||||
define('HOOK_ADMIN_BODY_END', ++$i);
|
||||
define('HOOK_ADMIN_BEFORE_PAGE', ++$i);
|
||||
define('HOOK_ADMIN_MENU', ++$i);
|
||||
define('HOOK_ADMIN_LOGIN_AFTER_ACCOUNT', ++$i);
|
||||
define('HOOK_ADMIN_LOGIN_AFTER_PASSWORD', ++$i);
|
||||
define('HOOK_ADMIN_LOGIN_AFTER_SIGN_IN', ++$i);
|
||||
define('HOOK_EMAIL_CONFIRMED', ++$i);
|
||||
const HOOK_FIRST = HOOK_STARTUP;
|
||||
const HOOK_LAST = HOOK_EMAIL_CONFIRMED;
|
||||
|
@ -31,10 +31,6 @@ if(!$logged && isset($_POST['account_login'], $_POST['password_login']))
|
||||
$t = $tmp[$ip] ?? null;
|
||||
}
|
||||
|
||||
if (!$hooks->trigger(HOOK_ACCOUNT_LOGIN_POST)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$account_logged = new OTS_Account();
|
||||
if (config('account_login_by_email')) {
|
||||
$account_logged->findByEMail($login_account);
|
||||
@ -112,4 +108,6 @@ if(!$logged && isset($_POST['account_login'], $_POST['password_login']))
|
||||
|
||||
$hooks->trigger(HOOK_LOGIN_ATTEMPT, array('account' => $login_account, 'password' => $login_password, 'remember_me' => $remember_me));
|
||||
}
|
||||
|
||||
$hooks->trigger(HOOK_ACCOUNT_LOGIN_POST);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<input type="text" class="form-control" id="account-name-input" name="account_login" placeholder="{{ account_login_by }}" required autofocus>
|
||||
</div>
|
||||
|
||||
{{ hook('HOOK_ADMIN_LOGIN_AFTER_ACCOUNT') }}
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-key"></i></span>
|
||||
@ -33,6 +33,7 @@
|
||||
<input type="password" class="form-control" placeholder="Password" name="password_login"
|
||||
placeholder="Password" required>
|
||||
</div>
|
||||
{{ hook('HOOK_ADMIN_LOGIN_AFTER_PASSWORD') }}
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="icheck-primary">
|
||||
@ -45,6 +46,7 @@
|
||||
<button type="submit" class="btn btn-info btn-block">Sign In</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ hook('HOOK_ADMIN_LOGIN_AFTER_SIGN_IN') }}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user