Prev | Current Page 391 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

It just prepares the environment
and loads the store_admin Smarty componentized template.
??? store_admin is a componentized template (made of store_admin.php and store_admin.tpl) that is
loaded by admin.php to generate the skeleton for the catalog administration page. Different templates will
be plugged in when implementing various administrative features. For example, later in this chapter, you??™ll
add departments and categories administration features.
??? admin_login is a componentized template that implements the administrative authentication and authorization
feature. The template displays the login form and authenticates the visitor when necessary.
Of all the files you??™ve created, store_admin.php is perhaps the most interesting. First, it checks whether the visitor
has been authenticated as the administrator (by checking whether the admin_logged session variable is
true). If the visitor is not logged in as the administrator, the admin_login componentized template is loaded:
public function init()
{
// If admin is not logged in, load admin_login template
if (!(isset ($_SESSION['admin_logged'])) ||
$_SESSION['admin_logged'] != true)
$this->mContentsCell = 'admin_login.tpl';
The login mechanism in the AdminLogin presentation object stores the current authentication state in the visitor??™s
session under a variable named admin_logged.


Pages:
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403