Subversion Repositories Applications.papyrus

Rev

Rev 320 | Rev 1713 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 320 Rev 1173
Line 1... Line 1...
1
<?php
1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
2
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
3
// +----------------------------------------------------------------------+
-
 
4
// | PHP Version 4                                                        |
-
 
5
// +----------------------------------------------------------------------+
-
 
6
// | Copyright (c) 1997-2003 The PHP Group                                |
-
 
7
// +----------------------------------------------------------------------+
-
 
8
// | This source file is subject to version 2.02 of the PHP license,      |
-
 
9
// | that is bundled with this package in the file LICENSE, and is        |
-
 
10
// | available at through the world-wide-web at                           |
-
 
11
// | http://www.php.net/license/2_02.txt.                                 |
-
 
12
// | If you did not receive a copy of the PHP license and are unable to   |
-
 
13
// | obtain it through the world-wide-web, please send a note to          |
-
 
14
// | license@php.net so we can mail you a copy immediately.               |
-
 
15
// +----------------------------------------------------------------------+
-
 
16
// | Authors: Michael Bretterklieber <michael@bretterklieber.com>         |
-
 
17
// +----------------------------------------------------------------------+
-
 
18
//
-
 
19
// $Id: SMBPasswd.php,v 1.1 2005-03-30 08:50:33 jpm Exp $
-
 
20
//
-
 
Line -... Line 3...
-
 
3
 
-
 
4
/**
-
 
5
 * Storage driver for use against Samba password files
-
 
6
 *
-
 
7
 * PHP versions 4 and 5
-
 
8
 *
-
 
9
 * LICENSE: This source file is subject to version 3.01 of the PHP license
-
 
10
 * that is available through the world-wide-web at the following URI:
-
 
11
 * http://www.php.net/license/3_01.txt.  If you did not receive a copy of
-
 
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.
-
 
14
 *
-
 
15
 * @category   Authentication
-
 
16
 * @package    Auth
-
 
17
 * @author     Michael Bretterklieber <michael@bretterklieber.com> 
-
 
18
 * @author     Adam Ashley <aashley@php.net>
-
 
19
 * @copyright  2001-2006 The PHP Group
-
 
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 $
-
 
22
 * @link       http://pear.php.net/package/Auth
-
 
23
 * @since      File available since Release 1.2.3
-
 
24
 */
-
 
25
 
-
 
26
/**
-
 
27
 * Include PEAR File_SMBPasswd
21
 
28
 */
-
 
29
require_once "File/SMBPasswd.php";
-
 
30
/**
-
 
31
 * Include Auth_Container Base file
22
require_once "File/SMBPasswd.php";
32
 */
-
 
33
require_once "Auth/Container.php";
-
 
34
/**
-
 
35
 * Include PEAR class for error handling
23
require_once "Auth/Container.php";
36
 */
Line 24... Line 37...
24
require_once "PEAR.php";
37
require_once "PEAR.php";
25
 
38
 
26
/**
39
/**
Line 34... Line 47...
34
 * if ($a->getAuth()) {
47
 * if ($a->getAuth()) {
35
 *     printf ("AUTH OK<br>\n");
48
 *     printf ("AUTH OK<br>\n");
36
 *     $a->logout();
49
 *     $a->logout();
37
 * }
50
 * }
38
 *
51
 *
-
 
52
 * @category   Authentication
-
 
53
 * @package    Auth
39
 * @author   Michael Bretterklieber <michael@bretterklieber.com>
54
 * @author     Michael Bretterklieber <michael@bretterklieber.com>
-
 
55
 * @author     Adam Ashley <aashley@php.net>
40
 * @package  Auth
56
 * @package    Auth
-
 
57
 * @copyright  2001-2006 The PHP Group
-
 
58
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
41
 * @version  $Revision: 1.1 $
59
 * @version    Release: 1.4.3  File: $Revision: 1.2 $
-
 
60
 * @link       http://pear.php.net/package/Auth
-
 
61
 * @since      Class available since Release 1.2.3
42
 */
62
 */
43
class Auth_Container_SMBPasswd extends Auth_Container
63
class Auth_Container_SMBPasswd extends Auth_Container
44
{
64
{
-
 
65
 
-
 
66
    // {{{ properties
-
 
67
 
45
    /**
68
    /**
46
     * File_SMBPasswd object
69
     * File_SMBPasswd object
47
     * @var object
70
     * @var object
48
     */
71
     */
49
    var $pwfile;
72
    var $pwfile;
Line -... Line 73...
-
 
73
 
-
 
74
    // }}}
50
 
75
 
Line 51... Line 76...
51
    // {{{ Constructor
76
    // {{{ Auth_Container_SMBPasswd() [constructor]
52
 
77
 
53
    /**
78
    /**
54
     * Constructor of the container class
79
     * Constructor of the container class
Line 127... Line 152...
127
        }
152
        }
128
        return $res;
153
        return $res;
129
    }
154
    }
Line 130... Line 155...
130
 
155
 
-
 
156
    // }}}
-
 
157
    // {{{ changePassword()
-
 
158
 
-
 
159
    /**
-
 
160
     * Change password for user in the storage container
-
 
161
     *
-
 
162
     * @param string Username
-
 
163
     * @param string The new password 
-
 
164
     */
-
 
165
    function changePassword($username, $password)
-
 
166
    {
-
 
167
         $res = $this->pwfile->modUser($username, '', $password);
-
 
168
         if ($res === true) {
-
 
169
             return $this->pwfile->save();
-
 
170
         }
-
 
171
         return $res;
-
 
172
    }
-
 
173
 
Line 131... Line 174...
131
    // }}}
174
    // }}}
132
 
175