From: Roland Häder Date: Fri, 30 Oct 2009 10:10:57 +0000 (+0000) Subject: Debug messages changed, isAdmin() added to isAdminCookieValid() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8c047496893bfafa7a366f050691f65fdc2fa11f;p=mailer.git Debug messages changed, isAdmin() added to isAdminCookieValid() --- diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 37af59ab4c..a1df0f2277 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -228,7 +228,7 @@ function ifAdminCookiesAreValid ($admin, $password) { //* DEBUG: */ outputHtml(__FUNCTION__."(".__LINE__."):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")
"); // Check if password matches - if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) { + if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass))) && (isAdmin())) { // Passwords matches! $ret = 'done'; } // END - if diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 7c8d7b4947..7088fec5ae 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -641,7 +641,7 @@ function isMember () { function isAdmin ($admin = '') { // Init variables $ret = false; $passCookie = ''; $valPass = ''; - //* DEBUG: */ print(__LINE__."ADMIN:".$admin."
"); + //* DEBUG: */ print(__FUNCTION__.':'.$admin."
"); // If admin login is not given take current from cookies... if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) { @@ -649,7 +649,7 @@ function isAdmin ($admin = '') { $admin = getSession('admin_login'); $passCookie = getSession('admin_md5'); } // END - if - //* DEBUG: */ print(__LINE__."ADMIN:".$admin.'/'.$passCookie."
"); + //* DEBUG: */ print(__FUNCTION__.':'.$admin.'/'.$passCookie."
"); // Search in array for entry if (isset($GLOBALS['admin_hash'])) { @@ -688,7 +688,7 @@ function isAdmin ($admin = '') { if (!empty($valPass)) { // Check if password is valid - //* DEBUG: */ print(__FUNCTION__ . ':' . $valPass . '/' . $passCookie . '
'); + //* DEBUG: */ print(__FUNCTION__ . ':(' . $valPass . '==' . $passCookie . ')='.intval($valPass == $passCookie).'
'); $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == '*FAILED*') && (!isExtensionActive('cache')))); } // END - if