![]() |
|
|
|||||||
| For more information about the ads and why they're here, please see the FAQ |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
REPOST
originally posted by poison this patch/plugin will allow you to change your password please note: i did not make/create this hack therefore i am not offering any support for this hack or any gurantee that this hack will work for you Quote:
Source: http://www.poison.be/?p=8
__________________
Don't click here!! |
|
#2
|
|||
|
|||
|
Thanks For posting this, It will be a good tool!
|
|
#3
|
|||
|
|||
|
I made a few changes in the original file to work with vpopmail (mysql).
Code:
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/settings/change_password.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Show edit form for a identity record or to add a new one |
| |
+-----------------------------------------------------------------------+
| Author: Nicolas Van Eenaeme <nicolas@poison.be> |
+-----------------------------------------------------------------------+
$Id: edit_identity.inc,v 1.1 2006/05/21 05:19:43 roundcube Exp $
*/
// The host of the database
define ('RCUBE_EXT_CHANGE_PASS_HOST', 'localhost');
// The username to connect to the database
define ('RCUBE_EXT_CHANGE_PASS_USER', 'user');
// The password to connect to the database
define ('RCUBE_EXT_CHANGE_PASS_PASS', 'password');
// The name of the database
define ('RCUBE_EXT_CHANGE_PASS_NAME', 'vpopmail');
// The update query. You can use '%clear%' for the clear password,
// '%md5%' for the md5 encrypted password,
// '%user%' for the username,
// '%old%' for the old password and
// '%oldmd5%' for the old md5 encrypted password.
define ('RCUBE_EXT_CHANGE_PASS_UPDATEQUERY', 'UPDATE vpopmail SET pw_clear_passwd = "%clear%", pw_passwd = "%md5%" WHERE pw_name = "%user%" AND pw_passwd = "%oldmd5%" AND pw_domain = "%domain%"');
// The select query (needed to verify the md5.
define ('RCUBE_EXT_CHANGE_PASS_SELECTQUERY', 'SELECT pw_passwd FROM vpopmail WHERE pw_name = "%user%" AND pw_domain = "%domain%"');
function split_user ($user)
{
list($s_user, $s_domain) = split('[@]', $user);
return array($s_user,$s_domain);
}
function change_password_function ($s_user, $currentpass, $newpass)
{
list ($user, $domain) = split_user ($s_user);
$dbh =& mysql_connect (RCUBE_EXT_CHANGE_PASS_HOST, RCUBE_EXT_CHANGE_PASS_USER, RCUBE_EXT_CHANGE_PASS_PASS);
if (!is_resource ($dbh))
return FALSE;
if (!mysql_select_db (RCUBE_EXT_CHANGE_PASS_NAME, $dbh))
return FALSE;
$q = str_replace (array ('%user%', '%domain%'), array ($user, $domain), RCUBE_EXT_CHANGE_PASS_SELECTQUERY);
$dbr =& mysql_query ($q, $dbh);
if (!is_resource ($dbr))
return FALSE;
$data = mysql_fetch_row ($dbr);
mysql_free_result ($dbr);
$newpassmd5 = crypt ($newpass, $data[0]);
$currentpassmd5 = crypt ($currentpass, $data[0]);
$q = str_replace (array ('%user%', '%domain%', '%clear%', '%md5%', '%old%', '%oldmd5%'), array ($user, $domain, $newpass, $newpassmd5, $currentpass, $currentpassmd5), RCUBE_EXT_CHANGE_PASS_UPDATEQUERY);
$dbr =& mysql_query ($q, $dbh);
if (!$dbr || mysql_affected_rows ($dbh) != 1)
return FALSE;
mysql_close ($dbh);
return TRUE;
}
?>
![]() |
|
#4
|
|||
|
|||
|
Here are the changes if you are using Roundcube with hMailServer...
Code:
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/settings/change_password.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Show edit form for a identity record or to add a new one |
| |
+-----------------------------------------------------------------------+
| Author: Nicolas Van Eenaeme <nicolas@poison.be> |
+-----------------------------------------------------------------------+
$Id: edit_identity.inc,v 1.1 2006/05/21 05:19:43 roundcube Exp $
*/
// The host of the database
define ('RCUBE_EXT_CHANGE_PASS_HOST', 'localhost');
// The username to connect to the database
define ('RCUBE_EXT_CHANGE_PASS_USER', 'user');
// The password to connect to the database
define ('RCUBE_EXT_CHANGE_PASS_PASS', 'password');
// The name of the database
define ('RCUBE_EXT_CHANGE_PASS_NAME', 'database');
// The update query. You can use '%clear%' for the clear password,
// '%md5%' for the md5 encrypted password,
// '%user%' for the username,
// '%old%' for the old password and
// '%oldmd5%' for the old md5 encrypted password.
define ('RCUBE_EXT_CHANGE_PASS_UPDATEQUERY', 'UPDATE hm_accounts SET accountpassword = "%md5%" WHERE accountaddress = "%user%" AND accountpassword = "%oldmd5%"');
// The select query (needed to verify the md5.
define ('RCUBE_EXT_CHANGE_PASS_SELECTQUERY', 'SELECT accountpassword FROM hm_accounts WHERE accountaddress = "%user%"');
function change_password_function ($user, $currentpass, $newpass)
{
$dbh =& mysql_connect (RCUBE_EXT_CHANGE_PASS_HOST, RCUBE_EXT_CHANGE_PASS_USER, RCUBE_EXT_CHANGE_PASS_PASS);
if (!is_resource ($dbh))
return FALSE;
if (!mysql_select_db (RCUBE_EXT_CHANGE_PASS_NAME, $dbh))
return FALSE;
$q = str_replace ('%user%', $user, RCUBE_EXT_CHANGE_PASS_SELECTQUERY);
$dbr =& mysql_query ($q, $dbh);
if (!is_resource ($dbr))
return FALSE;
$data = mysql_fetch_row ($dbr);
mysql_free_result ($dbr);
$newpassmd5 = md5($newpass);
$currentpassmd5 = md5($currentpass);
$q = str_replace (array ('%user%', '%clear%', '%md5%', '%old%', '%oldmd5%'), array ($user, $newpass, $newpassmd5, $currentpass, $currentpassmd5), RCUBE_EXT_CHANGE_PASS_UPDATEQUERY);
$dbr =& mysql_query ($q, $dbh);
if (!$dbr || mysql_affected_rows ($dbh) != 1)
return FALSE;
mysql_close ($dbh);
return TRUE;
}
?>
|
|
#5
|
|||
|
|||
|
I can use one of these Password patches if my server uses Qmail? I use a Virtual Server provided by a hosting company and can access the backend via Plesk configurations. The server comes with Horde (ugly interface) to handle "webmail functions." I am using RoundCube for my site members, but have to refer them to Horde to be able make a password change on their own. Can one of these patched noted here allow my members to change their email through RoundCube. If the change is made via RoundCube/MySQL, does it change it everywhere like Horde does or just on MySQL? Sorry, if I should know this. I would love to just forget Horde, but it is the only option I have at the moment to let members change their own PWs.
Any advice or suggestions will be greatly apprecaited. -- Rick |
|
#6
|
|||
|
|||
|
can someone tell how to install the patch ;/
when i press download i get this : Quote:
what i have to do next?? |
|
#7
|
|||
|
|||
|
Installed this patch with beta2, works well.
Quote:
|
|
#8
|
|||
|
|||
|
i have no idea what program to use. i use cpanel. maybe someone have seperate files of this plugin and know what changes must be done in other files?
|
|
#9
|
|||
|
|||
|
Quote:
But just one problem found: when i have applied the patch, i found one error in the result with the file program/include/main.inc.rej Code:
***************
*** 1072,1078 ****
'identityform' => 'rcube_identity_form',
'foldersubscription' => 'rcube_subscription_form',
'createfolder' => 'rcube_create_folder_form',
- 'composebody' => 'rcmail_compose_body'
);
--- 1072,1079 ----
'identityform' => 'rcube_identity_form',
'foldersubscription' => 'rcube_subscription_form',
'createfolder' => 'rcube_create_folder_form',
+ 'composebody' => 'rcmail_compose_body',
+ 'changepassform' => 'rcmail_change_pass_form'
);
Code:
'changepassform' => 'rcmail_change_pass_form' Code:
// USER SETTINGS
'userprefs' => 'rcmail_user_prefs_form',
'itentitieslist' => 'rcmail_identities_list',
'identityframe' => 'rcmail_identity_frame',
'identityform' => 'rcube_identity_form',
'foldersubscription' => 'rcube_subscription_form',
'createfolder' => 'rcube_create_folder_form',
'renamefolder' => 'rcube_rename_folder_form',
'composebody' => 'rcmail_compose_body',
'changepassform' => 'rcmail_change_pass_form'
Thanks you. |
|
#10
|
|||
|
|||
|
how to apply the patch? HELP please
![]() |
![]() |
| 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 |