Skip to content

Commit

Permalink
Update cpanel.php
Browse files Browse the repository at this point in the history
Call $rcmail->config->get() only once per option by assigning variable inside the IF statement.
  • Loading branch information
julianmatz committed May 22, 2016
1 parent 8042955 commit 7ed0d33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/password/drivers/cpanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public function save($curpas, $newpass)
$this->xmlapi = new xmlapi($rcmail->config->get('password_cpanel_host'));
$this->xmlapi->set_port($rcmail->config->get('password_cpanel_port'));
// Hash auth
if (!empty($rcmail->config->get('password_cpanel_hash'))) {
$this->xmlapi->hash_auth( $this->cuser, $rcmail->config->get('password_cpanel_hash'));
if (!empty($cpanel_hash = $rcmail->config->get('password_cpanel_hash'))) {
$this->xmlapi->hash_auth( $this->cuser, $cpanel_hash);
}
// Pass auth
else if (!empty($rcmail->config->get('password_cpanel_password'))) {
$this->xmlapi->hash_auth( $this->cuser, $rcmail->config->get('password_cpanel_password'));
else if (!empty($cpanel_password = $rcmail->config->get('password_cpanel_password'))) {
$this->xmlapi->hash_auth( $this->cuser, $cpanel_password);
}
else {
return false;
Expand Down

0 comments on commit 7ed0d33

Please sign in to comment.