1<?php 2 /** 3 * Authentication based on HTTP auth 4 * @author Dan Kuykendall <seek3r@phpgroupware.org> 5 * @author Joseph Engo <jengo@phpgroupware.org> 6 * @copyright Copyright (C) 2000-2004 Free Software Foundation, Inc http://www.fsf.org/ 7 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 8 * @package phpgwapi 9 * @subpackage accounts 10 * @version $Id: class.auth_http.inc.php 15142 2004-06-28 07:08:09Z powerstat $ 11 */ 12 13 /** 14 * Authentication based on HTTP auth 15 * 16 * @package phpgwapi 17 * @subpackage accounts 18 * @ignore 19 */ 20 class auth 21 { 22 var $previous_login = -1; 23 24 function authenticate($username, $passwd) 25 { 26 if (isset($GLOBALS['PHP_AUTH_USER'])) 27 { 28 return True; 29 } 30 else 31 { 32 return False; 33 } 34 } 35 36 function change_password($old_passwd, $new_passwd) 37 { 38 return False; 39 } 40 41 // Since there account data will still be stored in SQL, this should be safe to do. (jengo) 42 function update_lastlogin($account_id, $ip) 43 { 44 $GLOBALS['phpgw']->db->query("select account_lastlogin from phpgw_accounts where account_id='$account_id'",__LINE__,__FILE__); 45 $GLOBALS['phpgw']->db->next_record(); 46 $this->previous_login = $GLOBALS['phpgw']->db->f('account_lastlogin'); 47 48 $GLOBALS['phpgw']->db->query("update phpgw_accounts set account_lastloginfrom='" 49 . "$ip', account_lastlogin='" . time() 50 . "' where account_id='$account_id'",__LINE__,__FILE__); 51 } 52 } 53?> 54