PHP Classes

File: ex_auth.php

Recommend this page to a friend!
  Classes of Danny Tucker   EZ Framework   ex_auth.php   Download  
File: ex_auth.php
Role: Example script
Content type: text/plain
Description: Example
Class: EZ Framework
Framework providing several types of functionality
Author: By
Last change:
Date: 18 years ago
Size: 623 bytes
 

Contents

Class file image Download
<?php
# Version 1.0
require_once('../include/config.inc.php');

$auth = new auth();

// Check to see if someone is already logged in or not
if( $auth->check() )
    echo
'Logged In';
else
    echo
'Not Logged In';

// Log someone in
// Optional 2 params of login function are for using a cookie instead of a session
// Use a cookie and set it for 36 hours
// if( $auth->login( $f->method['login'], md5( $f->method['password'] ), 1, 36 ) )
if( $auth->login( $f->method['login'], md5( $f->method['password'] ) ) )
    echo
'Login Success';
else
    echo
'Login Failed';

// Log someone out
$auth->logout();
   
?>