getenv('SERVER_NAME') .
getenv('REQUEST_URI'));
exit();
}
}
public function init()
{
// If admin is not logged in, load the admin_login template
if (!(isset ($_SESSION['admin_logged'])) ||
$_SESSION['admin_logged'] != true)
$this->mContentsCell = 'admin_login.tpl';
else
{
CHAPTER 10 ?– CATALOG ADMINISTRATION: DEPARTMENTS AND CATEGORIES 278
// If admin is logged in, load the admin menu page
$this->mMenuCell = 'admin_menu.tpl';
// If logging out ...
if (isset ($_GET['Page']) && ($_GET['Page'] == 'Logout'))
{
unset($_SESSION['admin_logged']);
header('Location: ' . Link::ToAdmin());
exit();
}
}
}
}
?>
6. Add the USE_SSL constant, and the administrator login information at the end of include/config.php. If
you prefer not to use SSL for now, simply set the USE_SSL constant to no. As you can see, the administrator
account is named by default tshirtshopadmin, and its password is also tshirtshopadmin. In a production
scenario, you??™ll want to change these values to something less obvious to a potential hacker.
// We enable and enforce SSL when this is set to anything else than 'no'
define('USE_SSL', 'yes');
// Administrator login information
define('ADMIN_USERNAME', 'tshirtshopadmin');
define('ADMIN_PASSWORD', 'tshirtshopadmin');
?– Note As stated earlier, in Chapter 16, you??™ll learn about hashing and how to work with hashed passwords
stored in the database.
Pages:
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398