userExists($username)) return false; // Check if the password can be validated by any enabled encryption class foreach ($config['firewall']['acceptEncryptionClasses'] as $encryptionClass) { /** @var $encryption EncryptionInterface */ $encryption = new $encryptionClass; if (!($encryption instanceof EncryptionInterface)) throw new Exception('The registered encryption-class <' . get_class($encryption) . '> does not implement the EncryptionInterface'); $result = $encryption->validateEncryptedString($_SERVER['PHP_AUTH_PW'], $userManager->getUserByName($username)->getPassword()); if ($result === true) return true; elseif ($result === false) return false; } return false; } /** * @return bool */ public function hasUserAccess() { global $userManager, $config; if ($userManager->getCurrentUser()->getUsername() === $config['firewall']['admin']) return true; else return false; } }