Changeset 4546 in subversion
- Timestamp:
- Feb 15, 2011 7:26:26 AM (2 years ago)
- Location:
- trunk/plugins/password
- Files:
-
- 4 edited
-
README (modified) (1 diff)
-
config.inc.php.dist (modified) (1 diff)
-
drivers/virtualmin.php (modified) (2 diffs)
-
package.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/password/README
r4165 r4546 202 202 As in sasl driver this one allows to change password using shell 203 203 utility called "virtualmin". See drivers/chgvirtualminpasswd.c for 204 installation instructions. 204 installation instructions. See also config.inc.php.dist file. 205 205 206 206 -
trunk/plugins/password/config.inc.php.dist
r4545 r4546 286 286 ); 287 287 288 289 // Virtualmin Driver options 290 // ------------------------- 291 // Username format: 292 // 0: username@domain 293 // 1: username%domain 294 // 2: username.domain 295 // 3: domain.username 296 // 4: username-domain 297 // 5: domain-username 298 // 6: username_domain 299 // 7: domain_username 300 $rcmail_config['password_virtualmin_format'] = 0; -
trunk/plugins/password/drivers/virtualmin.php
r4199 r4546 11 11 * and requires shell access and gcc in order to compile the binary. 12 12 * 13 * @version 1.013 * @version 2.0 14 14 * @author Martijn de Munnik 15 15 */ … … 17 17 function password_save($currpass, $newpass) 18 18 { 19 $curdir = realpath(dirname(__FILE__)); 20 $username = escapeshellcmd($_SESSION['username']); 21 $domain = substr(strrchr($username, "@"), 1); 19 $rcmail = rcmail::get_instance(); 20 21 $format = $rcmail->config->get('password_virtualmin_format', 0); 22 $username = $_SESSION['username']; 23 24 switch ($format) { 25 case 1: // username%domain 26 $domain = substr(strrchr($username, "%"), 1); 27 break; 28 case 2: // username.domain (could be bogus) 29 $pieces = explode(".", $username); 30 $domain = $pieces[count($pieces)-2]. "." . end($pieces); 31 break; 32 case 3: // domain.username (could be bogus) 33 $pieces = explode(".", $username); 34 $domain = $pieces[0]. "." . $pieces[1]; 35 break; 36 case 4: // username-domain 37 $domain = substr(strrchr($username, "-"), 1); 38 break; 39 case 5: // domain-username 40 $domain = str_replace(strrchr($username, "-"), "", $username); 41 break; 42 case 6: // username_domain 43 $domain = substr(strrchr($username, "_"), 1); 44 break; 45 case 7: // domain_username 46 $pieces = explode("_", $username); 47 $domain = $pieces[0]; 48 break; 49 default: // username@domain 50 $domain = substr(strrchr($username, "@"), 1); 51 } 52 53 $username = escapeshellcmd($username); 54 $domain = escapeshellcmd($domain); 55 $newpass = escapeshellcmd($newpass); 56 $curdir = realpath(dirname(__FILE__)); 22 57 23 58 exec("$curdir/chgvirtualminpasswd modify-user --domain $domain --user $username --pass $newpass", $output, $returnvalue); -
trunk/plugins/password/package.xml
r4545 r4546 16 16 <active>yes</active> 17 17 </lead> 18 <date> </date>19 <time> </time>18 <date>2011-02-15</date> 19 <time>12:00</time> 20 20 <version> 21 21 <release>2.2</release> … … 38 38 - Fix double request when clicking on Password tab in Firefox 39 39 - Fix deprecated split() usage in xmail and directadmin drivers (#1487769) 40 - ldap/ldap_simple drivers: use password_ldap_samba_pwattr/password_ldap_samba_lchattr41 instead of password_ldap_samba option42 40 - Added option (password_log) for logging password changes 41 - Virtualmin driver: Add option for setting username format (#1487781) 43 42 </notes> 44 43 <contents>
Note: See TracChangeset
for help on using the changeset viewer.
