Commit 31bffd0c authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) more isset() cleanups

parent 90daae43
...@@ -1214,7 +1214,7 @@ function is_account_disabled($username) { ...@@ -1214,7 +1214,7 @@ function is_account_disabled($username) {
function auth_get_authserver($name) { function auth_get_authserver($name) {
global $config; global $config;
if (is_array($config['system']['authserver'])) { if (isset($config['system']['authserver']) && is_array($config['system']['authserver'])) {
foreach ($config['system']['authserver'] as $authcfg) { foreach ($config['system']['authserver'] as $authcfg) {
if ($authcfg['name'] == $name) if ($authcfg['name'] == $name)
return $authcfg; return $authcfg;
...@@ -1319,7 +1319,11 @@ function session_auth() { ...@@ -1319,7 +1319,11 @@ function session_auth() {
/* Validate incoming login request */ /* Validate incoming login request */
if (isset($_POST['login']) && !empty($_POST['usernamefld']) && !empty($_POST['passwordfld'])) { if (isset($_POST['login']) && !empty($_POST['usernamefld']) && !empty($_POST['passwordfld'])) {
if (isset($config['system']['webgui']['authmode'])) {
$authcfg = auth_get_authserver($config['system']['webgui']['authmode']); $authcfg = auth_get_authserver($config['system']['webgui']['authmode']);
} else {
$authcfg = null;
}
if (authenticate_user($_POST['usernamefld'], $_POST['passwordfld'], $authcfg) || if (authenticate_user($_POST['usernamefld'], $_POST['passwordfld'], $authcfg) ||
authenticate_user($_POST['usernamefld'], $_POST['passwordfld'])) { authenticate_user($_POST['usernamefld'], $_POST['passwordfld'])) {
// Generate a new id to avoid session fixation // Generate a new id to avoid session fixation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment