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