source: trunk/phpgwapi/inc/class.auth_http.inc.php @ 2

Revision 2, 2.6 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /**************************************************************************\
3  * eGroupWare API - Auth from HTTP                                          *
4  * This file written by Dan Kuykendall <seek3r@phpgroupware.org>            *
5  * and Joseph Engo <jengo@phpgroupware.org>                                 *
6  * Authentication based on HTTP auth                                        *
7  * Copyright (C) 2000, 2001 Dan Kuykendall                                  *
8  * -------------------------------------------------------------------------*
9  * This library is part of the eGroupWare API                               *
10  * http://www.egroupware.org/api                                            *
11  * ------------------------------------------------------------------------ *
12  * This library is free software; you can redistribute it and/or modify it  *
13  * under the terms of the GNU Lesser General Public License as published by *
14  * the Free Software Foundation; either version 2.1 of the License,         *
15  * or any later version.                                                    *
16  * This library is distributed in the hope that it will be useful, but      *
17  * WITHOUT ANY WARRANTY; without even the implied warranty of               *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     *
19  * See the GNU Lesser General Public License for more details.              *
20  * You should have received a copy of the GNU Lesser General Public License *
21  * along with this library; if not, write to the Free Software Foundation,  *
22  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA            *
23  \**************************************************************************/
24
25
26        class auth_
27        {
28                var $previous_login = -1;
29
30                function authenticate($username, $passwd)
31                {
32                        if (isset($_SERVER['PHP_AUTH_USER']))
33                        {
34                                return True;
35                        }
36                        else
37                        {
38                                return False;
39                        }
40                }
41
42                function change_password($old_passwd, $new_passwd)
43                {
44                        return False;
45                }
46
47                // Since there account data will still be stored in SQL, this should be safe to do. (jengo)
48                function update_lastlogin($account_id, $ip)
49                {
50                        $GLOBALS['phpgw']->db->query("select account_lastlogin from phpgw_accounts where account_id='$account_id'",__LINE__,__FILE__);
51                        $GLOBALS['phpgw']->db->next_record();
52                        $this->previous_login = $GLOBALS['phpgw']->db->f('account_lastlogin');
53
54                        $GLOBALS['phpgw']->db->query("update phpgw_accounts set account_lastloginfrom='"
55                                . "$ip', account_lastlogin='" . time()
56                                . "' where account_id='$account_id'",__LINE__,__FILE__);
57                }
58        }
59?>
Note: See TracBrowser for help on using the repository browser.