-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticate.php
More file actions
22 lines (20 loc) · 844 Bytes
/
authenticate.php
File metadata and controls
22 lines (20 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/******************************************************************************
* Name: Dean Lorenzo
* Student number: 0367298
* Course: Web Development - 2008 (228566)
* Assignment: Final Project
* Created: Nov 22, 2022
* Updated: Nov 22, 2022
* Purpose: Logged in users can update food categories.
******************************************************************************/
define('ADMIN_LOGIN', 'thor');
define('ADMIN_PASSWORD', 'godofthunder');
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])
|| ($_SERVER['PHP_AUTH_USER'] != ADMIN_LOGIN)
|| ($_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD)){
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="Our Blog"');
exit("Access Denied: Username and password required.");
}
?>