From 005f88f2e70ba3cf651f1594dc858fdbc7c44910 Mon Sep 17 00:00:00 2001 From: phpipam <miha.petkovsek@telemach.si> Date: Mon, 29 Jan 2024 08:58:27 +0100 Subject: [PATCH] UI updates --- functions/classes/class.Common.php | 8 +++++++- functions/classes/class.User.php | 24 +++++++----------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/functions/classes/class.Common.php b/functions/classes/class.Common.php index b3471be2..6eac7082 100644 --- a/functions/classes/class.Common.php +++ b/functions/classes/class.Common.php @@ -36,6 +36,12 @@ class Common_functions { */ public $json_error = false; + /** + * Composer error flag + * @var bool + */ + public $composer_err = false; + /** * Default font * @@ -2324,7 +2330,7 @@ class Common_functions { } } // check - if (isset($this->composer_err)) { + if ($this->composer_err!==false) { return true; } } diff --git a/functions/classes/class.User.php b/functions/classes/class.User.php index 9b9fd309..b3f3b7df 100644 --- a/functions/classes/class.User.php +++ b/functions/classes/class.User.php @@ -824,10 +824,6 @@ class User extends Common_functions { $this->Log->write ( _("User login"), _('Error: Invalid authentication method'), 2 ); $this->Result->show("danger", _("Error: Invalid authentication method"), true); } - # disabled - we made separate check on this, therwise we reveal info before user is authenticated - // elseif ($this->user->disabled=="Yes") { - // $this->Result->show("danger", _("Your account has been disabled").".", true); - // } else { # set method name variable $authmethodtype = $this->authmethodtype; @@ -926,20 +922,14 @@ class User extends Common_functions { * @return void */ private function get_auth_method_type () { - # for older versions - only local is available! - if($this->settings->version=="1.1") { - $this->authmethodtype = "auth_local"; + try { $method = $this->Database->getObject("usersAuthMethod", $this->authmethodid); } + catch (Exception $e) { + $this->Result->show("danger", _("Error: ").$e->getMessage(), true); } - else { - try { $method = $this->Database->getObject("usersAuthMethod", $this->authmethodid); } - catch (Exception $e) { - $this->Result->show("danger", _("Error: ").$e->getMessage(), true); - } - # save method name if existing - if($method!==false) { - $this->authmethodtype = "auth_".$method->type; - $this->authmethodparams = $method->params; - } + # save method name if existing + if($method!==false) { + $this->authmethodtype = "auth_".$method->type; + $this->authmethodparams = $method->params; } } -- GitLab