<?php
/* basic realm auth by ftp server */
/**
* the following myftp.cls.php found at
* http://www.phpclasses.org/package/3400-PHP-Send-files-to-an-FTP-server.html
* http://www.phpclasses.org/package/3400/
*/
include_once 'myftp.cls.php';
class httpBasicAuthThroughFTP extends myFtpWriter{
function __construct($p_ftpsettings=NULL){ parent::__construct($p_ftpsettings); }
public function isUserAuthorized($p_user, $p_pass){
$this->ftpInfo['ftpusername']=$p_user;
$this->ftpInfo['ftpuserpassword']=$p_pass;
$passok=$this->conServer();
$this->disconServer();
return $passok;
}
}
session_start();
include_once 'http.auth.cls.php';
$ftpuser=new httpBasicAuthThroughFTP(array('ftpserver'=>'www.yourftpserver.tld'));
$httpauth=new HTTPBasicRealmAuth('authentication by ftp users', $ftpuser, 'isUserAuthorized');
include 'secure.file.eg.php';
|