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$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("
| %s (empty = unchanged) |
\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.