Move the Basic Auth login code from skin.php to includes/auth.php

This commit is contained in:
Isaac Connor committed 2020-03-02 15:00:31 -05:00
1 parent e3e9fd2bc1
commit bd59ae8856
2 files changed
+6 -7

No files matched your search

+6 -2
View File
@@ -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) ) {
-5
View File
@@ -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