I don't know which mailer my isp is using but I asked for any support for users to change their passwords and my isp answered the only way would be their qmail web interface.
Thus I'm looking for a driver for the password plugin which simply sends a post with the three 4 needed entries (old pw) to that form and parses the error message or success message.
My ISPs password change form is located at
https://mail.bytecamp.net/cgi-bin/qmailadmin/qmailadmin/passwd/The form fields are:
address -> e.g. "someone@somedomain.com"
oldpass
newpass1
newpass2
When posting these fields one gets an answer page which should be parsed.
I tried to change the direct admin parser which seemed appropriate for that task but it didn't work. Here comes the changed code (communication class code afterwards not changed):
function password_save($curpass, $passwd){
$rcmail = rcmail::get_instance();
$Socket = new HTTPSocket;
$da_user = $_SESSION['username'];
$da_curpass = $curpass;
$da_newpass = $passwd;
$da_host = $rcmail->config->get('password_directadmin_host');
$da_port = $rcmail->config->get('password_directadmin_port');
$Socket->connect($da_host,$da_port);
$Socket->set_method('POST');
$Socket->query('/cgi-bin/qmailadmin/qmailadmin/passwd/',
array(
'address' => $da_user,
'oldpass' => $da_curpass,
'newpass1' => $da_newpass,
'newpass2' => $da_newpass
));
$response = $Socket->fetch_parsed_body();
//console("DA error response: $response[text] [$da_user]");
if($Socket->result_status_code <> 200)
return PASSWORD_CONNECT_ERROR;
elseif($response['error'] == 1){ //Error description: $response[text]
return PASSWORD_ERROR;
}else
return PASSWORD_SUCCESS;
}
I renamed the file to qmail.php and set the needed vars $da_host,$da_port in the config.inc.php within password directory.
Any ideas how I could get this to work? Thanks in advance...
Ingo