Changeset 2687 in subversion
- Timestamp:
- Jun 30, 2009 1:12:45 PM (4 years ago)
- Location:
- trunk/roundcubemail/plugins/password
- Files:
-
- 2 added
- 4 edited
-
config.inc.php (modified) (1 diff)
-
drivers/sasl.php (modified) (1 diff)
-
localization/de_CH.inc (added)
-
localization/de_DE.inc (added)
-
password.js (modified) (1 diff)
-
password.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/plugins/password/config.inc.php
r2679 r2687 19 19 // The SQL query used to change the password. 20 20 // The query can contain the following macros that will be expanded as follows: 21 // %p is replaced with the plaintext new password21 // %p is replaced with the plaintext new password 22 22 // %c is replaced with the crypt version of the new password, MD5 if available 23 // otherwise DES.23 // otherwise DES. 24 24 // %u is replaced with the username (from the session info) 25 25 // %o is replaced with the password before the change -
trunk/roundcubemail/plugins/password/drivers/sasl.php
r2664 r2687 23 23 24 24 if ($fh = popen("$curdir/chgsaslpasswd -p $username", 'w')) { 25 fwrite($fh, $newpass."\n");25 fwrite($fh, $newpass."\n"); 26 26 $code = pclose($fh); 27 27 28 if($code == 0) 29 return PASSWORD_SUCCESS; 30 } else 31 raise_error(array( 28 if ($code == 0) 29 return PASSWORD_SUCCESS; 30 } 31 else { 32 raise_error(array( 32 33 'code' => 600, 33 'type' => 'php', 34 'file' = __FILE__, 35 'message' => "Password plugin: Unable to execute $curdir/chgsaslpasswd" 36 ), true, false); 34 'type' => 'php', 35 'file' => __FILE__, 36 'message' => "Password plugin: Unable to execute $curdir/chgsaslpasswd" 37 ), true, false); 38 } 37 39 38 40 return PASSWORD_ERROR; -
trunk/roundcubemail/plugins/password/password.js
r2492 r2687 13 13 rcmail.register_command('plugin.password', function() { rcmail.goto_url('plugin.password') }, true); 14 14 rcmail.register_command('plugin.password-save', function() { 15 var input_curpasswd = rcube_find_object('_curpasswd');16 var input_newpasswd = rcube_find_object('_newpasswd');17 var input_confpasswd = rcube_find_object('_confpasswd');18 19 if (input_curpasswd && input_curpasswd.value=='') {20 alert(rcmail.gettext('nocurpassword', 'password'));21 input_curpasswd.focus();22 } else if (input_newpasswd && input_newpasswd.value=='') {23 alert(rcmail.gettext('nopassword', 'password'));24 input_newpasswd.focus();25 } else if (input_confpasswd && input_confpasswd.value=='') {26 alert(rcmail.gettext('nopassword', 'password'));27 input_confpasswd.focus();28 } else if ((input_newpasswd && input_confpasswd) && (input_newpasswd.value != input_confpasswd.value)) {29 alert(rcmail.gettext('passwordinconsistency', 'password'));30 input_newpasswd.focus();31 } else {32 rcmail.gui_objects.passform.submit();33 }15 var input_curpasswd = rcube_find_object('_curpasswd'); 16 var input_newpasswd = rcube_find_object('_newpasswd'); 17 var input_confpasswd = rcube_find_object('_confpasswd'); 18 19 if (input_curpasswd && input_curpasswd.value=='') { 20 alert(rcmail.gettext('nocurpassword', 'password')); 21 input_curpasswd.focus(); 22 } else if (input_newpasswd && input_newpasswd.value=='') { 23 alert(rcmail.gettext('nopassword', 'password')); 24 input_newpasswd.focus(); 25 } else if (input_confpasswd && input_confpasswd.value=='') { 26 alert(rcmail.gettext('nopassword', 'password')); 27 input_confpasswd.focus(); 28 } else if ((input_newpasswd && input_confpasswd) && (input_newpasswd.value != input_confpasswd.value)) { 29 alert(rcmail.gettext('passwordinconsistency', 'password')); 30 input_newpasswd.focus(); 31 } else { 32 rcmail.gui_objects.passform.submit(); 33 } 34 34 }, true); 35 35 }) -
trunk/roundcubemail/plugins/password/password.php
r2668 r2687 4 4 +-------------------------------------------------------------------------+ 5 5 | Password Plugin for Roundcube | 6 | Version 1.3 |7 | | 8 | Copyright (C) 2009, RoundCube Dev. - Switzerland|6 | Version 1.3.1 | 7 | | 8 | Copyright (C) 2009, RoundCube Dev. | 9 9 | | 10 10 | This program is free software; you can redistribute it and/or modify | … … 34 34 define('PASSWORD_SUCCESS', 0); 35 35 36 /** 37 * Change password plugin 38 * 39 * Plugin that adds functionality to change a users password. 40 * It provides common functionality and user interface and supports 41 * several backends to finally update the password. 42 * 43 * For installation and configuration instructions please read the README file. 44 * 45 * @version 1.3.1 46 * @author Aleksander Machniak 47 */ 36 48 class password extends rcube_plugin 37 49 { … … 69 81 $confirm = $rcmail->config->get('password_confirm_current'); 70 82 71 if (($confirm && !isset($_POST['_curpasswd'])) || !isset($_POST['_newpasswd'])) 83 if (($confirm && !isset($_POST['_curpasswd'])) || !isset($_POST['_newpasswd'])) { 72 84 $rcmail->output->command('display_message', $this->gettext('nopassword'), 'error'); 85 } 73 86 else { 74 87 $curpwd = get_input_value('_curpasswd', RCUBE_INPUT_POST); … … 95 108 // add some labels to client 96 109 $rcmail->output->add_label( 97 'password.nopassword',98 'password.nocurpassword',99 'password.passwordinconsistency'110 'password.nopassword', 111 'password.nocurpassword', 112 'password.passwordinconsistency' 100 113 ); 101 114 102 115 $rcmail->output->set_env('product_name', $rcmail->config->get('product_name')); 103 116 104 // allow the following attributes to be added to the <table> tag 105 $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); 106 107 // return the complete edit form as table 108 $out = '<table' . $attrib_str . ">\n\n"; 117 $table = new html_table(array('cols' => 2)); 109 118 110 119 if ($rcmail->config->get('password_confirm_current')) { 111 120 // show current password selection 112 121 $field_id = 'curpasswd'; 113 $input_ newpasswd = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id,114 'size' => 20, 'autocomplete' => 'off'));122 $input_curpasswd = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id, 123 'size' => 20, 'autocomplete' => 'off')); 115 124 116 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 117 $field_id, 118 rep_specialchars_output($this->gettext('curpasswd')), 119 $input_newpasswd->show($rcmail->config->get('curpasswd'))); 125 $table->add('title', html::label($field_id, Q($this->gettext('curpasswd')))); 126 $table->add(null, $input_curpasswd->show()); 120 127 } 121 128 … … 123 130 $field_id = 'newpasswd'; 124 131 $input_newpasswd = new html_passwordfield(array('name' => '_newpasswd', 'id' => $field_id, 125 'size' => 20, 'autocomplete' => 'off')); 126 127 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 128 $field_id, 129 rep_specialchars_output($this->gettext('newpasswd')), 130 $input_newpasswd->show($rcmail->config->get('newpasswd'))); 132 'size' => 20, 'autocomplete' => 'off')); 133 134 $table->add('title', html::label($field_id, Q($this->gettext('newpasswd')))); 135 $table->add(null, $input_newpasswd->show()); 131 136 132 137 // show confirm password selection 133 138 $field_id = 'confpasswd'; 134 139 $input_confpasswd = new html_passwordfield(array('name' => '_confpasswd', 'id' => $field_id, 135 'size' => 20, 'autocomplete' => 'off'));136 137 $ out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",138 $field_id,139 rep_specialchars_output($this->gettext('confpasswd')), 140 $input_confpasswd->show($rcmail->config->get('confpasswd')));141 142 $out .= "\n</table>";143 144 $out .= '<br />';145 146 $out .= $rcmail->output->button(array(147 'command' => 'plugin.password-save',148 'type' => 'input', 149 'class' => 'button mainaction', 150 'label' => 'save' 151 ) );140 'size' => 20, 'autocomplete' => 'off')); 141 142 $table->add('title', html::label($field_id, Q($this->gettext('confpasswd')))); 143 $table->add(null, $input_confpasswd->show()); 144 145 $out = html::div(array('class' => "settingsbox", 'style' => "margin:0"), 146 html::div(array('id' => "userprefs-title"), $this->gettext('changepasswd')) . 147 html::div(array('style' => "padding:15px"), $table->show() . 148 html::p(null, 149 $rcmail->output->button(array( 150 'command' => 'plugin.password-save', 151 'type' => 'input', 152 'class' => 'button mainaction', 153 'label' => 'save' 154 ))) 155 ) 156 ); 152 157 153 158 $rcmail->output->add_gui_object('passform', 'password-form'); 154 159 155 160 return $rcmail->output->form_tag(array( 156 'id' => 'password-form',157 'name' => 'password-form',158 'method' => 'post',159 'action' => './?_task=settings&_action=plugin.password-save',160 ), $out);161 'id' => 'password-form', 162 'name' => 'password-form', 163 'method' => 'post', 164 'action' => './?_task=settings&_action=plugin.password-save', 165 ), $out); 161 166 } 162 167 … … 169 174 raise_error(array( 170 175 'code' => 600, 171 'type' => 'php',172 'file' => __FILE__,173 'message' => "Password plugin: Unable to open driver file $driver"174 ), true, false);176 'type' => 'php', 177 'file' => __FILE__, 178 'message' => "Password plugin: Unable to open driver file $driver" 179 ), true, false); 175 180 return $this->gettext('internalerror'); 176 181 } … … 181 186 raise_error(array( 182 187 'code' => 600, 183 'type' => 'php',184 'file' => __FILE__,185 'message' => "Password plugin: Broken driver: $driver"186 ), true, false);188 'type' => 'php', 189 'file' => __FILE__, 190 'message' => "Password plugin: Broken driver: $driver" 191 ), true, false); 187 192 return $this->gettext('internalerror'); 188 193 }
Note: See TracChangeset
for help on using the changeset viewer.
