Subversion Repositories Applications.papyrus

Rev

Rev 1173 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1173 Rev 1713
Line 12... Line 12...
12
 * the PHP License and are unable to obtain it through the web, please
12
 * the PHP License and are unable to obtain it through the web, please
13
 * send a note to license@php.net so we can mail you a copy immediately.
13
 * send a note to license@php.net so we can mail you a copy immediately.
14
 *
14
 *
15
 * @category   Authentication
15
 * @category   Authentication
16
 * @package    Auth
16
 * @package    Auth
17
 * @author     Michael Bretterklieber <michael@bretterklieber.com> 
17
 * @author     Michael Bretterklieber <michael@bretterklieber.com>
18
 * @author     Adam Ashley <aashley@php.net>
18
 * @author     Adam Ashley <aashley@php.net>
19
 * @copyright  2001-2006 The PHP Group
19
 * @copyright  2001-2006 The PHP Group
20
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
20
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
21
 * @version    CVS: $Id: SMBPasswd.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
21
 * @version    CVS: $Id: SMBPasswd.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $
22
 * @link       http://pear.php.net/package/Auth
22
 * @link       http://pear.php.net/package/Auth
23
 * @since      File available since Release 1.2.3
23
 * @since      File available since Release 1.2.3
24
 */
24
 */
Line 25... Line 25...
25
 
25
 
Line 54... Line 54...
54
 * @author     Michael Bretterklieber <michael@bretterklieber.com>
54
 * @author     Michael Bretterklieber <michael@bretterklieber.com>
55
 * @author     Adam Ashley <aashley@php.net>
55
 * @author     Adam Ashley <aashley@php.net>
56
 * @package    Auth
56
 * @package    Auth
57
 * @copyright  2001-2006 The PHP Group
57
 * @copyright  2001-2006 The PHP Group
58
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
58
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
59
 * @version    Release: 1.4.3  File: $Revision: 1.2 $
59
 * @version    Release: 1.5.4  File: $Revision: 1.3 $
60
 * @link       http://pear.php.net/package/Auth
60
 * @link       http://pear.php.net/package/Auth
61
 * @since      Class available since Release 1.2.3
61
 * @since      Class available since Release 1.2.3
62
 */
62
 */
63
class Auth_Container_SMBPasswd extends Auth_Container
63
class Auth_Container_SMBPasswd extends Auth_Container
64
{
64
{
Line 102... Line 102...
102
     * @param   string Password
102
     * @param   string Password
103
     * @return  boolean
103
     * @return  boolean
104
     */
104
     */
105
    function fetchData($username, $password)
105
    function fetchData($username, $password)
106
    {
106
    {
-
 
107
        $this->log('Auth_Container_SMBPasswd::fetchData() called.', AUTH_LOG_DEBUG);
107
        return $this->pwfile->verifyAccount($username, $password);
108
        return $this->pwfile->verifyAccount($username, $password);
108
    }
109
    }
Line 109... Line 110...
109
 
110
 
110
    // }}}
111
    // }}}
111
    // {{{ listUsers()
112
    // {{{ listUsers()
112
    
113
 
113
    function listUsers()
114
    function listUsers()
-
 
115
    {
114
    {
116
        $this->log('Auth_Container_SMBPasswd::fetchData() called.', AUTH_LOG_DEBUG);
115
        return $this->pwfile->getAccounts();
117
        return $this->pwfile->getAccounts();
Line 116... Line 118...
116
    }
118
    }
117
 
119
 
Line 127... Line 129...
127
     *
129
     *
128
     * @return boolean
130
     * @return boolean
129
     */
131
     */
130
    function addUser($username, $password, $additional = '')
132
    function addUser($username, $password, $additional = '')
131
    {
133
    {
-
 
134
        $this->log('Auth_Container_SMBPasswd::addUser() called.', AUTH_LOG_DEBUG);
132
        $res = $this->pwfile->addUser($user, $additional['userid'], $pass);
135
        $res = $this->pwfile->addUser($user, $additional['userid'], $pass);
133
        if ($res === true) {
136
        if ($res === true) {
134
            return $this->pwfile->save();
137
            return $this->pwfile->save();
135
        }
138
        }
136
        return $res;
139
        return $res;
Line 144... Line 147...
144
     *
147
     *
145
     * @param string Username
148
     * @param string Username
146
     */
149
     */
147
    function removeUser($username)
150
    function removeUser($username)
148
    {
151
    {
-
 
152
        $this->log('Auth_Container_SMBPasswd::removeUser() called.', AUTH_LOG_DEBUG);
149
        $res = $this->pwfile->delUser($username);
153
        $res = $this->pwfile->delUser($username);
150
        if ($res === true) {
154
        if ($res === true) {
151
            return $this->pwfile->save();
155
            return $this->pwfile->save();
152
        }
156
        }
153
        return $res;
157
        return $res;
Line 158... Line 162...
158
 
162
 
159
    /**
163
    /**
160
     * Change password for user in the storage container
164
     * Change password for user in the storage container
161
     *
165
     *
162
     * @param string Username
166
     * @param string Username
163
     * @param string The new password 
167
     * @param string The new password
164
     */
168
     */
165
    function changePassword($username, $password)
169
    function changePassword($username, $password)
-
 
170
    {
166
    {
171
        $this->log('Auth_Container_SMBPasswd::changePassword() called.', AUTH_LOG_DEBUG);
167
         $res = $this->pwfile->modUser($username, '', $password);
172
        $res = $this->pwfile->modUser($username, '', $password);
168
         if ($res === true) {
173
        if ($res === true) {
169
             return $this->pwfile->save();
174
            return $this->pwfile->save();
170
         }
175
        }
171
         return $res;
176
        return $res;
Line 172... Line 177...
172
    }
177
    }
Line 173... Line 178...
173
 
178