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

Revision 2, 2.1 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 PAM                                           *
4  * -------------------------------------------------------------------------*
5  * This library is part of the eGroupWare API                               *
6  * http://www.egroupware.org/api                                            *
7  * ------------------------------------------------------------------------ *
8  * This library is free software; you can redistribute it and/or modify it  *
9  * under the terms of the GNU Lesser General Public License as published by *
10  * the Free Software Foundation; either version 2.1 of the License,         *
11  * or any later version.                                                    *
12  * This library is distributed in the hope that it will be useful, but      *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of               *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     *
15  * See the GNU Lesser General Public License for more details.              *
16  * You should have received a copy of the GNU Lesser General Public License *
17  * along with this library; if not, write to the Free Software Foundation,  *
18  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA            *
19  \**************************************************************************/
20
21
22        class auth_
23        {
24                function authenticate($username, $passwd)
25                {
26                        if (pam_auth($username, get_magic_quotes_gpc() ? stripslashes($passwd) : $passwd, $error))
27                        {
28                                return True;
29                        }
30                        else
31                        {
32                                return False;
33                        }
34                }
35
36                function change_password($old_passwd, $new_passwd, $account_id='')
37                {
38                        // deny password changes.
39                        return( False );
40                }
41
42                function update_lastlogin($account_id, $ip)
43                {
44                        $account_id = get_account_id($account_id);
45       
46                        $GLOBALS['phpgw']->db->query('update phpgw_accounts set account_lastloginfrom='
47                                . $GLOBALS['phpgw']->db->quote($ip).', account_lastlogin=' . time()
48                                . ' where account_id='.(int)$account_id,__LINE__,__FILE__);
49                }
50        }
51?>
Note: See TracBrowser for help on using the repository browser.