|
|
@ -46,18 +46,18 @@ class rcube_cpanel_password
|
|
|
|
$this->xmlapi = new xmlapi($rcmail->config->get('password_cpanel_host'));
|
|
|
|
$this->xmlapi = new xmlapi($rcmail->config->get('password_cpanel_host'));
|
|
|
|
$this->xmlapi->set_port($rcmail->config->get('password_cpanel_port'));
|
|
|
|
$this->xmlapi->set_port($rcmail->config->get('password_cpanel_port'));
|
|
|
|
// Hash auth
|
|
|
|
// Hash auth
|
|
|
|
if (!empty($rcmail->config->get('password_cpanel_hash'))) {
|
|
|
|
if (!empty($rcmail->config->get('password_cpanel_hash'))) {
|
|
|
|
$this->xmlapi->hash_auth( $this->cuser, $rcmail->config->get('password_cpanel_hash'));
|
|
|
|
$this->xmlapi->hash_auth( $this->cuser, $rcmail->config->get('password_cpanel_hash'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Pass auth
|
|
|
|
// Pass auth
|
|
|
|
else if (!empty($rcmail->config->get('password_cpanel_password'))) {
|
|
|
|
else if (!empty($rcmail->config->get('password_cpanel_password'))) {
|
|
|
|
$this->xmlapi->hash_auth( $this->cuser, $rcmail->config->get('password_cpanel_password'));
|
|
|
|
$this->xmlapi->hash_auth( $this->cuser, $rcmail->config->get('password_cpanel_password'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->xmlapi->set_output('json');
|
|
|
|
$this->xmlapi->set_output('json');
|
|
|
|
$this->xmlapi->set_debug(0);
|
|
|
|
$this->xmlapi->set_debug(0);
|
|
|
|
|
|
|
|
|
|
|
|
return $this->setPassword($_SESSION['username'], $newpass);
|
|
|
|
return $this->setPassword($_SESSION['username'], $newpass);
|
|
|
@ -81,14 +81,14 @@ class rcube_cpanel_password
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$data['password'] = $password;
|
|
|
|
$data['password'] = $password;
|
|
|
|
|
|
|
|
|
|
|
|
// Get the cPanel user
|
|
|
|
// Get the cPanel user
|
|
|
|
$query = $this->xmlapi->listaccts( 'domain', $data['domain'] );
|
|
|
|
$query = $this->xmlapi->listaccts( 'domain', $data['domain'] );
|
|
|
|
$query = json_decode( $query, true );
|
|
|
|
$query = json_decode( $query, true );
|
|
|
|
if ( $query['status'] != 1 ) {
|
|
|
|
if ( $query['status'] != 1 ) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$cpanel_user = $query['acct'][0]['user'];
|
|
|
|
$cpanel_user = $query['acct'][0]['user'];
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->xmlapi->api2_query($cpanel_user, 'Email', 'passwdpop', $data);
|
|
|
|
$query = $this->xmlapi->api2_query($cpanel_user, 'Email', 'passwdpop', $data);
|
|
|
|
$query = json_decode($query, true);
|
|
|
|
$query = json_decode($query, true);
|
|
|
|