From ce11aaea8d1512ca6a804a223d03fba48f3aa3bd Mon Sep 17 00:00:00 2001 From: michu2k Date: Sat, 6 Jun 2020 23:06:55 +0200 Subject: [PATCH] Login: Fixed count() error in dev mode --- inc/core/Admin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inc/core/Admin.php b/inc/core/Admin.php index 321ad9b..799fd11 100644 --- a/inc/core/Admin.php +++ b/inc/core/Admin.php @@ -82,7 +82,7 @@ class Admin extends Main private function loadLanguage($language) { $this->lang['name'] = $language; - + foreach (glob(MODULES.'/*/lang/admin/'.$language.'.ini') as $file) { $base = str_replace($language, 'en_english', $file); $module = str_replace([MODULES.'/', '/lang/admin/'.$language.'.ini'], null, $file); @@ -142,7 +142,7 @@ class Admin extends Main { $nav = []; $modules = $this->module->getArray(); - + if ($this->getUserInfo('access') != 'all') { $modules = array_intersect_key($modules, array_fill_keys(explode(',', $this->getUserInfo('access')), null)); } @@ -207,7 +207,7 @@ class Admin extends Main { $file = MODULES.'/'.$dir.'/Info.php'; $core = $this; - + if (file_exists($file)) { return include($file); } else { @@ -241,7 +241,7 @@ class Admin extends Main if (method_exists($this->module->{$name}, $method)) { return call_user_func_array([$this->module->{$name}, $method], array_values($params)); } - + $this->setNotify('failure', $this->lang['general']['unknown_method']); return false; } @@ -274,7 +274,7 @@ class Admin extends Main $row = $this->db('users')->where('username', $username)->oneArray(); - if (count($row) && password_verify(trim($password), $row['password'])) { + if ($row && count($row) && password_verify(trim($password), $row['password'])) { // Reset fail attempts for this IP $this->db('login_attempts')->where('ip', $_SERVER['REMOTE_ADDR'])->save(['attempts' => 0]);