![]() |
|
|
|||||||
For more information about the ads and why they're here, please see the FAQ
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
#1
|
||||
|
||||
|
Downloads: A new patch file has been added Qmail+Mysql+Vpopmail Password Change Patch v1.0 Note: Please follow the instruction before using Last edited by lucifer; 02-25-2009 at 07:38 PM. Reason: More Information |
|
#2
|
|||
|
|||
|
It Worked!
![]() This is really nice. but have some question. what would be the proper permission for the roundcube database user to use vpopmail database ?? can you make a vacation and forwarder for qmail. |
|
#3
|
||||
|
||||
|
for database just give select and update permission to roundcube db user.
I am working on vacation plug-in. soon you will get it.
|
|
#4
|
|||
|
|||
|
Hello,
Thanks so much for your excellent documentation and patch. I have a question about how to select and update one of multiple domain tables from the vpopmail mysql database. Is there a way to extract the domain from the $emailuser variable (in password.inc) and select and update the proper domain table contained in the vpopmail DB? In my vpopmail database the domains are stored as tables containing the user information fields (pw_name,pw_passwd...etc) The table names have an underscore substituted for the dot in the domain name. Example: email user domain= exdomain.com - vpopmail domain table name= exdomain_com I have tried my primitive abilities with php and regex and am unable to get this to work properly. Any help or direction that anyone can offer is much appreciated. Thanks again. Cheers |
|
#5
|
||||
|
||||
|
open /program/steps/settings/password.inc
and edit $passwordquery = "UPDATE vpopmail.domain_table SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$username';"; you can see red one is database name ie. vpopmail. and blue one is your table name ie. exdomain_com just upadte this two value, I hope it will work. |
|
#6
|
|||
|
|||
|
Thank you so much. That does work for one domain... but if the vpopmail DB has multiple domains and users within those domains using one Round Cube interface then for each domain the "domain_table" must be different. Since the $emailuser variable is set for each user after login can it be used to set the "domain_table" name within the vpopmail DB during a password change?
Perhaps there could be a section of code within the function rcube_save_password that takes the $emailuser variable, splits out the email username and domain as two variables - $username and $domain. then another line that replaces the dot(.) in the domain name variable $domain with an underscore and then assign it as variable $vdom. Then lastly set up the mysql query string using the $vdom variable as the vpopmail."domain_table" name and the $username variable as the $pw_name variable(similar to below). My poor regex, PHP and mysql skills prevent me from being able to modify this section properly. I have tried adding code something like with no success... just after the line- $cryptedpw = mkpasswd3($new_password,$crypted); list ($user,$domain) = split ( '@',$emailuser); my bad php and regex $vdom = preg_replace ("/^[a-zA-Z0-9]+[\.][a-zA-Z]+/", "/^[a-zA-Z0-9]+[_][a-zA-Z]+/", $domain); (I am soooo bad at regex) $username = preg_replace( "/^([^@]+)(@.*)$/", "$1", $emailuser); $passwordquery = "UPDATE vpopmail.'"$vdom"' SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$username';"; I can't figure out the php and regex necessary for substituting the "_ " in the place of the "." in the $domain variable? and calling it $vdom and then using this variable $vdom as the table name in the mysql query(or update) I have no clue if something like this will work and am not the person to figure this out but perhaps you can help. Any assistance with the regex and query string is greatly appreciated. Many thanks to you for your consideration. Cheers |
|
#7
|
||||
|
||||
|
Sorry I didn't notice that you are asking for multiple domain. Just give me some time i am fixing it. it should be dynamic and have to make another function. no porbs. give you the update soon. and thanks again for pointing this issue.
|
|
#8
|
|||
|
|||
|
It seems there is a problem patching latest myroundcube !!
patch -p1 <Qmail+Mysql+Vpopmail\ Password\ Change\ Patch\ v1.0.patch 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 |
|
#9
|
|||
|
|||
|
It worked for me. I think you have already updated something in your app.js file. It's better you use a fresh roundcube folder and use the patch! or you can do it manually and just replace the patched password.inc file
|
|
#10
|
||||
|
||||
|
UPDATE FOR MULTIPLE DOMAIN
just update the function. It will work for multiple domain. I will update my patch soon. 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); $dom_table = str_replace(".","_",$domain[1]); // ONLY CHANGE YOUR vpopmail DATABASE NAME !!!!! $passwordquery = "UPDATE vpopmail.$dom_table SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$domain[0]';"; $db->query($passwordquery); $_SESSION['password'] = encrypt_password($new_password); $OUTPUT->show_message('successfullysaved', 'confirmation'); } -Thanks Last edited by lucifer; 02-25-2009 at 07:25 AM. |
![]() |
LinkBacks (?)
LinkBack to this Thread: http://www.roundcubeforum.net/7-third-party-contributions/25-old-style-plug-ins/4286-new-file-added-qmail-mysql-vpopmail-password-change-patch-v1-0-a.html
|
||||
| Posted By | For | Type | Date | |
| wheaties.us || Andy and Natasha Wheatley's Blog | This thread | Refback | 02-22-2009 08:48 AM | |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|