Roundcube Community Forum

 

New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.1 (Updated)

Started by lucifer, February 20, 2009, 02:06:22 PM

Previous topic - Next topic

nadir

Who-ho!! i did it. Now my roundcube works with postfix+dovecot. :D
Just change this line:
$passwordquery = "UPDATE vpopmail.$dom_table SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$domain[0]';";

to:
$passwordquery = "UPDATE postfix.mailbox SET password = '$crypted'  WHERE username = '$domain[0]@$domain[1]' and domain = '$domain[1]';"

postfix version: 2.5.6,1

fritz001

it might be a good idea to modify password.inc to increase password complexity

something like that

rc_passwd_len
rc_passwd_uppcase_special_chars

to test somehow the password len and if password contains uppercases and special chars

tjm74

I guess I have an old version of vpopmail, my schema just has one table "vpopmail" but it has a pw_domain column and all users are stored there.

Also, I log in using an alias domain so for this to work it needs to resolve the domain alias.  I hacked together a new version of the function rcube_save_password (in program/steps/settings/password.inc) that works in my setup, maybe somebody else will find this useful:

function rcube_save_password($current_password,$new_password)
{
        global $OUTPUT, $RCMAIL;

        $emailuser=$_SESSION['username'];

        $db = rcmail::get_instance()->get_dbh();

        $crypted = '';
        $cryptedpw = mkpasswd3($new_password,$crypted);

        $domain = split("@",$emailuser);
        $true_domain = $domain[1];
        // resolve any domain aliasing (FIXME I should sanitize the dynamic part of this command)
        $true_domain = exec("/home/vpopmail/bin/vdominfo -n ".$true_domain);

        $dom_table = str_replace(".","_",$true_domain);

        // ONLY CHANGE YOUR vpopmail DATABASE NAME !!!!!

        $passwordquery = "UPDATE vpopmail.vpopmail SET "
            . "pw_passwd = " . $db->quote($crypted) . ","
            . "pw_clear_passwd = " . $db->quote($new_password)
            . " WHERE pw_domain = " . $db->quote($true_domain)
            . " AND pw_name = " . $db->quote($domain[0]) . ";";

        $db->query($passwordquery);

        $_SESSION['password'] = encrypt_password($new_password);

        $OUTPUT->show_message('successfullysaved', 'confirmation');
}


Watch out, I hardcoded the path to vdominfo (not sure how to grok it) and left a somewhat insecure "exec" call in there.

OTOH, the author should really use $db->quote as shown above to prevent SQL injection hacks (unlikely in this case but you never know).  But otherwise, nice mod!!!  Thanks,

 -tom

Unatine

Hi!
Some troubles with this patch (v1.1)
Use latest stable release of RoundCube.

After applying patch (app.js applied manualy), new tab appear in Settings, but when try click on Password tab, nothing happend.

If enter path like this: "?_task=settings&_action=password", password change form appear.

Unatine

Quote from: Unatine;18075Hi!
Some troubles with this patch (v1.1)
Use latest stable release of RoundCube.

After applying patch (app.js applied manualy), new tab appear in Settings, but when try click on Password tab, nothing happend.

If enter path like this: "?_task=settings&_action=password", password change form appear.

Solved. Sorry :)

nadir

hi. i have a same problem too... password tab not works on new stable verion :(
anybody can give me new patch?
thanks

nadir

Quote from: Unatine;18081Solved. Sorry :)

Hi, how did you fixed it?

alex_time

Quote from: nadir;18448Hi, how did you fixed it?

I too would like to know how Unatine has solved the problem with the lastest 0.2.1 version.

Furthermore, I have another, maybe Bigger problem. My mail server is not on the same machine roundcube run, so the Mysql database is not on local host but on the mail server. There is a way to manually specify the host where vpopmail database is, before open the connection to the mysql server?

demomm

Quote from: nadir;18448Hi, how did you fixed it?

I too would like to know how Unatine has solved the problem with the lastest 0.2.1 version.

I have the same problem :(
Anybody help me??

Thx.

xoma

try add file roundcube/skins/default/includes/settingscripts.html
<script type=&quot;text/javascript&quot;>

if (window.rcmail && rcmail.env.action)
  {
  var action = rcmail.env.action=='preferences' ? 'default' : (rcmail.env.action.indexOf('identity')>0 ? 'identities' : rcmail.env.action);
  var tab = document.getElementById('settingstab'+action);
  }
else
  var tab = document.getElementById('settingstabdefault');

if (tab)
  tab.className = 'tablink-selected';

</script>

EugeneXXX

Quote from: xoma;18648try add file roundcube/skins/default/includes/settingscripts.html
<script type=&quot;text/javascript&quot;>

if (window.rcmail && rcmail.env.action)
  {
  var action = rcmail.env.action=='preferences' ? 'default' : (rcmail.env.action.indexOf('identity')>0 ? 'identities' : rcmail.env.action);
  var tab = document.getElementById('settingstab'+action);
  }
else
  var tab = document.getElementById('settingstabdefault');

if (tab)
  tab.className = 'tablink-selected';

</script>

Doesn't work.

DJManas

Quote from: fritz001;17270It seems there is a problem patching latest myroundcube !!

patch -p1 patching file index.php
Hunk #1 succeeded at 293 (offset 100 lines).
patching file program/js/app.js
Hunk #1 FAILED at 235.
Hunk #2 FAILED at 904.
2 out of 2 hunks FAILED -- saving rejects to file program/js/app.js.rej
patching file program/localization/en_GB/labels.inc
patching file program/localization/en_GB/messages.inc
patching file program/localization/en_US/labels.inc
patching file program/localization/en_US/messages.inc
patching file program/steps/settings/password.inc
patching file skins/default/includes/settingstabs.html
patching file skins/default/templates/password.html

Same problem for me. Roundcube version roundcubemail-0.2.1 how to solve this problem? All files are fresh.

EugeneXXX

Quote from: DJManas;18709Same problem for me. Roundcube version roundcubemail-0.2.1 how to solve this problem? All files are fresh.

Replace a file app.js with my file

sport

Hi,

I've placed my roundcube installation with vpopmail and mysql.

The change password plugin works very well, but it has a problem with the domain with a " - " in the middle

Ex: [email protected]

I've make my solution to correct this bug

This in my code to replace in password.inc file


$dom_table_1 = str_replace(".","_",$domain[1]);
        $dom_table_2 = str_replace("-","_",$dom_table_1);

        // ONLY CHANGE YOUR vpopmail DATABASE NAME !!!!!

        $passwordquery = "UPDATE vpopmail.$dom_table_2 SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$domain[0]';";


Bye bye :)

nadir

Hi. can anybody help me? have the password change patch for new release?
old patch not works.
Why roundcube does not add this function to the project? :confused: