protected function _getValidUser($userId, $password) { if ($userId == null) { header('WWW-Authenticate: Basic realm="' . Zend_Registry::getInstance()->config->application->id . '"'); header('HTTP/1.1 401 Unauthorized'); echo '<h1>401 Unauthorized</h1>'; exit; } require_once APPLICATION_PATH . '/controllers/AuthenticationController.php'; return AuthenticationController::authenticate($userId, $password); }
<!DOCTYPE HTML> <?php //require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/model/admin.php"); //require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/model/database.php"); //require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/model/job_applicant.php"); //require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/controller/admin/authentication/index.php"); require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/model/admin.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/model/database.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/model/job_applicant.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/controller/admin/authentication/index.php"; use model\Admin; use model\Database; use model\JobApplicant; session_start(); AuthenticationController::authenticate(); $database = new Database(); $connection = $database->get_connection(); $job_applicants = JobApplicant::get_all_job_applicant($connection); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Management System</title> <!-- stylesheets --> <link href="../../../stylesheet/reset.css" rel="stylesheet" type="text/css"> <link href="../../../stylesheet/icon.css" rel="stylesheet" type="text/css"> <link href="../../../stylesheet/default.css" rel="stylesheet" type="text/css"> <link href="../../../stylesheet/content.css" rel="stylesheet" type="text/css">