Update of /cvsroot/phpslash/phpslash-dev/include/modules/auth/authtypes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29828/phpslash-dev/include/modules/auth/authtypes
Added Files:
slashAuthPAM.class slashAuthHTTP.class
Log Message:
add untested PAM and HTTP auth classes
--- NEW FILE: slashAuthPAM.class ---
<?php
/* $Id: slashAuthPAM.class,v 1.1 2004/09/21 11:18:17 joestewart Exp $
*
* pam_auth module - http://www.math.ohio-state.edu/~ccunning/pam_auth/
*/
class slashAuth extends slashAuth_base {
// pam authentication
function psl_validate($username, $password, $response='', $user_info='') {
if (pam_auth($username, $passwd, &$this->message)) {
if($user_info) {
// user exists in psl already
return true;
} elseif ($this->psl['auth.autoadd']) {
// if config allows for us to add external users
$ary['author_name'] = $username;
if($user_info = this->psl_register_authed($ary)) {
return $user_info;
}
}
}
return false;
}
}
?>
--- NEW FILE: slashAuthHTTP.class ---
<?php
/* $Id: slashAuthHTTP.class,v 1.1 2004/09/21 11:18:17 joestewart Exp $
*
* Authentication somewhat based on HTTP auth in phpgroupware
* Copyright (C) 2000, 2001 Dan Kuykendall
*
*/
class slashAuth extends slashAuth_base {
// http authentication
function psl_validate($username='', $password='', $response='', $user_info='') {
if (isset($_SERVER['PHP_AUTH_USER'])) {
return true;
} else {
return false;
}
}
// override the preauth to check PHP_AUTH_USER
function psl_preauth($username, $password, $user_info) {
return $this->psl_validate();
}
}
?>
|