本文整理汇总了PHP中AuthenticationController::authenticate方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthenticationController::authenticate方法的具体用法?PHP AuthenticationController::authenticate怎么用?PHP AuthenticationController::authenticate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthenticationController
的用法示例。
在下文中一共展示了AuthenticationController::authenticate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getValidUser
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);
}
示例2: session_start
<!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">