Login   Register  
PHP Classes
elePHPant
Icontem

File: pop.and.basic.realm.auth.cls.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Md. Shahadat Hossain Khan Razon  >  Basic Realm Authentication Controller  >  pop.and.basic.realm.auth.cls.php  >  Download  
File: pop.and.basic.realm.auth.cls.php
Role: Example script
Content type: text/plain
Description: Example: Authentication by POP3 server
Class: Basic Realm Authentication Controller
Authenticate users with HTTP basic mechanism
Author: By
Last change: fix session hijacking & fixation
Date: 1 year ago
Size: 822 bytes
 

Contents

Class file image Download
<?php

/* basic realm auth by pop3 server */

/**
 * the following class (class.pop3.php) you found from phpmailer package
 * http://sourceforge.net/projects/phpmailer/
 * http://phpmailer.worxware.com/
 */
include_once 'class.pop3.php';
class 
checkHttpBasicAuthThroughPOP3 extends POP3{

    public function 
isUserAuthorized($p_user$p_pass){
        if(!isset(
$this->host)) trigger_error('you must set POP3 host before use this authentication system'E_USER_ERROR);
        return 
$this->Authorise($this->hostfalsefalse$p_user$p_pass);
    }

}

session_start();
include_once 
'http.auth.cls.php';
$pop3=new checkHttpBasicAuthThroughPOP3();
$pop3->host='mail.anydomain.tld';
$httpauth=new HTTPBasicRealmAuth('authentication by pop3 mail server'$pop3'isUserAuthorized');

include 
'secure.file.eg.php';