![]() |
|
|
|||||||
| For more information about the ads and why they're here, please see the FAQ |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
It's a nice way to change password /http://postfix.pentachron.net/.
If you want, you can patch roundcube a bit so that your users can change their password in their user preferences. To do so edit the following two files: First, open 'roundcube/program/steps/settings/func.inc' and search for 'function rcmail_user_prefs_form', then scroll down to the end of this function and add the following code before ' $out .= "\n</table>$form_end";' // CCC addition // show password form $field_id = 'rcmfd_password'; $input_password = new textfield(array('name' => '_password', 'id' => $field_id, 'size' => 20)); $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s (empty = unchanged)</td></tr>\n", $field_id, rep_specialchars_output(rcube_label('password')), $input_password->show($CONFIG['password'])); // end CCC addition Then open 'roundcube/program/steps/settings/save_prefs.inc' and insert the following after the line "$a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE;": // CCC addition if ($_POST['_password'] != "") { mysql_query("UPDATE ccc.emails SET password = '".$_POST['_password']."' WHERE concat(account, '@', domain) = '".$_SESSION['username']."'") or die(mysql_error()); $_SESSION['password'] = encrypt_passwd($_POST['_password']); } // end of CCC addition Notice: change ccc.emails to yourdatabase.emails if needed! Notice: the roundcubemail mysql user needs update permissions for the email table! |
|
#2
|
|||
|
|||
|
I appreciate the post....this is exactly what I'm looking for.....Pardon me, but I'm a total neub and need to ask a clarifying (probably dumb) question:
you say: Quote:
If you can clarify, I'd really appreciate it. Thanks in advance! |
|
#3
|
|||
|
|||
|
It doesn't work in an existing roundcube system, right? What do I need that it works? Can you make a detailled tutorial on that?
|
|
#4
|
|||
|
|||
|
Yes, I am very interested in this.
|
|
#5
|
|||
|
|||
|
I wrote a pacth to do this a few months ago : http://blog.julienwadin.be/index.php...dans-roundcube
|
|
#6
|
|||
|
|||
|
Quote:
|
|
#7
|
|||
|
|||
|
Quote:
|
|
#8
|
|||
|
|||
|
Can I use this patch with Plesk from SWSoft?
|
|
#9
|
|||
|
|||
|
Quote:
|
|
#10
|
|||
|
|||
|
Hello there, I just wanted to tell you that I slightly modified your code to make it work for RC2. Works smoothly
![]() Aproximately near line 29 in file "program\steps\settings\save_prefs.inc", there is a block where an array is declared. It starts with "$a_user_prefs = array(". Just add the following line under the "'prefer_html' => isset($_POST['_prefer_html']) ? TRUE : FALSE," line // Password MOD 'password' => isset($_POST['_password']) ? TRUE : FALSE, // End Password MOD Now just AFTER the "foreach ((array)$CONFIG['dont_override'] as $p) ..." near line 39, add the block which handles password saving to DB // Password MOD if (isset($_POST['_password'])) { $tmpEncPass = YourEncryptionFunctionHERE($_POST['_password'], ""); mysql_query("UPDATE CCC.TableWithPasswordHERE SET password = '".$tmpEncPass."' WHERE username = '".$_SESSION['username']."'") or die(mysql_error()); $_SESSION['password'] = encrypt_passwd($_POST['_password']); } // End Password MOD Now in "program\steps\settings\func.inc", around line 200, there is some code like "$out .= "\n</table>$form_end";". Just BEFORE this line, add the following block: // Password MOD $field_id = 'rcmfd_password'; $input_password = new textfield(array('name' => '_password', 'id' => $field_id, 'size' => 20)); $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s (empty = unchanged)</td></tr>\n", $field_id, rep_specialchars_output(rcube_label('password')), $input_password->show($CONFIG['password'])); // End Password MOD It should work One problem I'm experiencing is that the field is not empty when Preferences menu is opened, it has a "1" in it. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
| For more information about the ads and why they're here, please see the FAQ |