Overview

Packages

  • None
  • Passwd

Classes

  • Passwd
  • Passwd_Driver
  • Passwd_Driver_Adsi
  • Passwd_Driver_Composite
  • Passwd_Driver_Expect
  • Passwd_Driver_Expectpecl
  • Passwd_Driver_Horde
  • Passwd_Driver_Http
  • Passwd_Driver_Kolab
  • Passwd_Driver_Ldap
  • Passwd_Driver_Pine
  • Passwd_Driver_Poppassd
  • Passwd_Driver_Procopen
  • Passwd_Driver_Pspasswd
  • Passwd_Driver_Servuftp
  • Passwd_Driver_Smbldap
  • Passwd_Driver_Smbpasswd
  • Passwd_Driver_Soap
  • Passwd_Driver_Sql
  • Passwd_Driver_Vmailmgr
  • Passwd_Driver_Vpopmail
  • Passwd_Exception
  • Passwd_Factory_Driver
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * The vmailmgr class attempts to change a user's password on a local vmailmgr
 4:  * daemon
 5:  *
 6:  * Copyright 2002-2012 Horde LLC (http://www.horde.org/)
 7:  *
 8:  * See the enclosed file COPYING for license information (GPL). If you
 9:  * did not receive this file, see http://www.horde.org/licenses/gpl.php.
10:  *
11:  * @author  Marco Kaiser <bate@php.net>
12:  * @package Passwd
13:  */
14: class Passwd_Driver_Vmailmgr extends Passwd_Driver
15: {
16:     /**
17:      * Changes the user's password.
18:      *
19:      * @param string $username      The user for which to change the password.
20:      * @param string $old_password  The old (current) user password.
21:      * @param string $new_password  The new user password to set.
22:      *
23:      * @throws Passwd_Exception
24:      */
25:     public function changePassword($username, $old_password, $new_password)
26:     {
27:         if (isset($this->_params['vmailinc']) &&
28:             is_readable($this->_params['vmailinc'])) {
29:             include $this->_params['vmailinc'];
30:         } else {
31:             throw new Passwd_Exception('vmail.inc not found! (' . $this->_params['vmailinc'] . ')');
32:         }
33: 
34:         list($username, $domain) = explode('@', $username);
35:         $returnChange = vchpass($domain, $old_password, $username, $new_password);
36: 
37:         if ($returnChange[0]) {
38:             throw new Passwd_Exception(_("Incorrect old password."));
39:         }
40:     }
41: }
42: 
API documentation generated by ApiGen