2001-01-11 10:52:33 +01:00
|
|
|
<?php
|
2010-01-28 05:22:37 +01:00
|
|
|
/**
|
2016-03-06 21:47:10 +01:00
|
|
|
* EGroupware API - Authentication based on HTTP auth
|
2010-01-28 05:22:37 +01:00
|
|
|
*
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Dan Kuykendall <seek3r@phpgroupware.org>
|
|
|
|
* @author Joseph Engo <jengo@phpgroupware.org>
|
|
|
|
* Copyright (C) 2000, 2001 Dan Kuykendall
|
|
|
|
* @license http://opensource.org/licenses/lgpl-license.php LGPL - GNU Lesser General Public License
|
|
|
|
* @package api
|
2016-03-06 21:47:10 +01:00
|
|
|
* @subpackage auth
|
2010-01-28 05:22:37 +01:00
|
|
|
* @version $Id$
|
|
|
|
*/
|
2001-01-11 10:52:33 +01:00
|
|
|
|
2016-03-06 21:47:10 +01:00
|
|
|
namespace EGroupware\Api\Auth;
|
|
|
|
|
2010-01-28 05:22:37 +01:00
|
|
|
/**
|
|
|
|
* Authentication based on HTTP auth
|
|
|
|
*/
|
2016-03-06 21:47:10 +01:00
|
|
|
class Http implements Backend
|
2010-01-28 05:22:37 +01:00
|
|
|
{
|
|
|
|
var $previous_login = -1;
|
2001-01-11 10:52:33 +01:00
|
|
|
|
2010-01-28 05:22:37 +01:00
|
|
|
/**
|
|
|
|
* password authentication
|
|
|
|
*
|
|
|
|
* @param string $username username of account to authenticate
|
|
|
|
* @param string $passwd corresponding password
|
2016-03-06 21:47:10 +01:00
|
|
|
* @param string $passwd_type ='text' 'text' for cleartext passwords (default)
|
2010-01-28 05:22:37 +01:00
|
|
|
* @return boolean true if successful authenticated, false otherwise
|
|
|
|
*/
|
|
|
|
function authenticate($username, $passwd, $passwd_type='text')
|
2001-03-26 23:36:32 +02:00
|
|
|
{
|
2016-07-26 17:07:16 +02:00
|
|
|
unset($passwd, $passwd_type); // not used, but required by interface
|
2016-03-06 21:47:10 +01:00
|
|
|
|
|
|
|
return isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] === $username;
|
2001-03-26 23:36:32 +02:00
|
|
|
}
|
2010-01-28 05:22:37 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* changes password
|
|
|
|
*
|
|
|
|
* @param string $old_passwd must be cleartext or empty to not to be checked
|
|
|
|
* @param string $new_passwd must be cleartext
|
|
|
|
* @param int $account_id account id of user whose passwd should be changed
|
|
|
|
* @return boolean true if password successful changed, false otherwise
|
|
|
|
*/
|
|
|
|
function change_password($old_passwd, $new_passwd, $account_id=0)
|
|
|
|
{
|
2016-03-06 21:47:10 +01:00
|
|
|
unset($old_passwd, $new_passwd, $account_id); // not used, but required by interface
|
|
|
|
|
2010-01-28 05:22:37 +01:00
|
|
|
return False;
|
|
|
|
}
|
|
|
|
}
|