Login   Register  
PHP Classes
elePHPant
Icontem

File: authadmin.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Kevin Cadman  >  Authentication  >  authadmin.php  >  Download  
File: authadmin.php
Role: Example script
Content type: text/plain
Description: Included on "admin" pages
Class: Authentication
A session and cookie based authentication class
Author: By
Last change:
Date: 11 years ago
Size: 543 bytes
 

Contents

Class file image Download
<?php
/*
This file is included on "members admin" pages. 
*/
include 'common.php';
$auth = new Authentication($db);
if(!
$auth->CheckAuth() || !$auth->admin) {
/*
If we made it here, it means the Authentication has failed, or the user is not an admin user.
So we header them back to login.php, and we set the failed variable.

NOTE!
When using Windows 2003 Server, PHP will not see the $_GET variable failed as SET if you
call login.php?failed. Hence why I've used failed=1.
*/
    
header("Location:login.php?failed=1");
}
?>