mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-09-08 11:26:15 -04:00
Move the Basic Auth login code from skin.php to includes/auth.php
This commit is contained in:
1 parent
e3e9fd2bc1
commit
bd59ae8856
2 files changed
+6
-7
No files matched your search
@@ -263,8 +263,6 @@ if ( ZM_OPT_USE_AUTH ) {
|
||||
} else {
|
||||
// Non token based auth
|
||||
|
||||
$user = userFromSession();
|
||||
|
||||
if ( ZM_AUTH_HASH_LOGINS && empty($user) && !empty($_REQUEST['auth']) ) {
|
||||
$user = getAuthUser($_REQUEST['auth']);
|
||||
} else if (
|
||||
@@ -280,6 +278,12 @@ if ( ZM_OPT_USE_AUTH ) {
|
||||
return;
|
||||
}
|
||||
$user = $ret[0];
|
||||
} else if ( (ZM_AUTH_TYPE == 'remote') and !empty($_SERVER['REMOTE_USER']) ) {
|
||||
$sql = 'SELECT * FROM Users WHERE Enabled=1 AND Username=?';
|
||||
// local user, shouldn't affect the global user
|
||||
$user = dbFetchOne($sql, NULL, array($_SERVER['REMOTE_USER']));
|
||||
} else {
|
||||
$user = userFromSession();
|
||||
}
|
||||
|
||||
if ( !empty($user) ) {
|
||||
|
||||
@@ -39,11 +39,6 @@ if ( empty($view) ) {
|
||||
$view = isset($user)?'console':'login';
|
||||
}
|
||||
|
||||
if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == 'remote' && !empty( $_SERVER['REMOTE_USER']) ) {
|
||||
$view = 'postlogin';
|
||||
$action = 'login';
|
||||
$_REQUEST['username'] = $_SERVER['REMOTE_USER'];
|
||||
}
|
||||
|
||||
if ( isset($user) ) {
|
||||
// Bandwidth Limiter
|
||||
|
||||
Reference in new issue
Block a user