Index: branches/5.2.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r15541 -r15590 --- branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15541) +++ branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15590) @@ -1,6 +1,6 @@ Application->ConfigValue('UseHTTPAuth')) { + if ( !$this->Application->ConfigValue('UseHTTPAuth') ) { // http authentification not required return true; } $super_admin_ips = defined('SA_IP') ? SA_IP : false; $auth_bypass_ips = $this->Application->ConfigValue('HTTPAuthBypassIPs'); - if (($auth_bypass_ips && kUtil::ipMatch($auth_bypass_ips)) || ($super_admin_ips && kUtil::ipMatch($super_admin_ips))) { + if ( ($auth_bypass_ips && kUtil::ipMatch($auth_bypass_ips)) || ($super_admin_ips && kUtil::ipMatch($super_admin_ips)) ) { // user ip is in ip bypass list return true; } - if (!array_key_exists('PHP_AUTH_USER', $_SERVER)) { + if ( !array_key_exists('PHP_AUTH_USER', $_SERVER) ) { // ask user to authentificate, when not authentificated before return $this->_httpAuthentificate(); } else { // validate user credentials (browsers remembers user/password // and sends them each time page is visited, so no need to save // authentification result in session) - if ($this->Application->ConfigValue('HTTPAuthUsername') != $_SERVER['PHP_AUTH_USER']) { + if ( $this->Application->ConfigValue('HTTPAuthUsername') != $_SERVER['PHP_AUTH_USER'] ) { // incorrect username return $this->_httpAuthentificate(); } $password_formatter = $this->Application->recallObject('kPasswordFormatter'); /* @var $password_formatter kPasswordFormatter */ - $password = $password_formatter->EncryptPassword($_SERVER['PHP_AUTH_PW'], 'b38'); - - if ($this->Application->ConfigValue('HTTPAuthPassword') != $password) { + if ( !$password_formatter->checkPasswordFromSetting('HTTPAuthPassword', $_SERVER['PHP_AUTH_PW']) ) { // incorrect password return $this->_httpAuthentificate(); } @@ -1101,7 +1100,7 @@ /** * Ask user to authentificate * - * @return false + * @return bool */ function _httpAuthentificate() {