<?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->host, false, false, $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';
|