mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
remove unnecessary prefix on callable / rename.
This commit is contained in:
parent
ddf6019d8e
commit
66c472d346
@ -735,11 +735,11 @@ $CONF['password_expiration'] = 'YES';
|
|||||||
* If they return null, then it's assumed authentication failed.
|
* If they return null, then it's assumed authentication failed.
|
||||||
* IF they authentication succeeds they should return the id of a user in the postfixadmin database.
|
* IF they authentication succeeds they should return the id of a user in the postfixadmin database.
|
||||||
*/
|
*/
|
||||||
$CONF['postfixadmin_auth_admin_callback'] = null;
|
$CONF['auth_admin_callback'] = null;
|
||||||
$CONF['postfixadmin_auth_user_callback'] = null;
|
$CONF['auth_user_callback'] = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$CONF['postfixadmin_auth_admin_callback'] = function () {
|
$CONF['auth_admin_callback'] = function () {
|
||||||
if (!isset($_SERVER['REMOTE_USER'])) {
|
if (!isset($_SERVER['REMOTE_USER'])) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,10 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
|||||||
$config = Config::getInstance()->getAll();
|
$config = Config::getInstance()->getAll();
|
||||||
$authenticated = false;
|
$authenticated = false;
|
||||||
|
|
||||||
if (is_callable($config['postfixadmin_auth_admin_callback'])) {
|
$callable = $config['auth_admin_callback'] ?? null;
|
||||||
$fUsername = $config['postfixadmin_auth_admin_callback']();
|
|
||||||
|
if (is_callable($callable)) {
|
||||||
|
$fUsername = $callable();
|
||||||
$authenticated = is_string($fUsername);
|
$authenticated = is_string($fUsername);
|
||||||
} else {
|
} else {
|
||||||
$login = new Login('admin');
|
$login = new Login('admin');
|
||||||
|
Loading…
Reference in New Issue
Block a user