mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 14:57:26 +08:00
Merge pull request #2109 from dominikschulz/fix/rest
Fix RestChangePasswordDriver
This commit is contained in:
commit
9bf8fa5b63
2 changed files with 9 additions and 7 deletions
|
@ -38,8 +38,8 @@ class RestChangePasswordDriver implements \RainLoop\Providers\ChangePassword\Cha
|
|||
private $oLogger = null;
|
||||
|
||||
/**
|
||||
* @param string $sHost
|
||||
* @param int $iPort
|
||||
* @param string $sUrl
|
||||
* @param string $sKey
|
||||
*
|
||||
* @return \RestChangePasswordDriver
|
||||
*/
|
||||
|
@ -51,8 +51,6 @@ class RestChangePasswordDriver implements \RainLoop\Providers\ChangePassword\Cha
|
|||
return $this;
|
||||
}
|
||||
|
||||
$oProvider->SetFieldNames($sFieldEmail, $sFieldOldpassword, $sFieldNewpassword);
|
||||
|
||||
/**
|
||||
* @param string $sFieldEmail
|
||||
* @param string $sFieldOldpassword
|
||||
|
@ -120,12 +118,16 @@ class RestChangePasswordDriver implements \RainLoop\Providers\ChangePassword\Cha
|
|||
}
|
||||
|
||||
$bResult = false;
|
||||
if (!empty($this->sHost) && 0 < $this->iPort && $oAccount)
|
||||
if (!empty($this->sUrl) && $oAccount)
|
||||
{
|
||||
$sEmail = \trim(\strtolower($oAccount->Email()));
|
||||
|
||||
$sUrl = $this->sUrl;
|
||||
# Adding the REST Api key to the url, try to use always https
|
||||
$sUrl = str_replace('://', '://'+$this->sKey+"@", $this->sUrl);
|
||||
if (!empty($this->sKey))
|
||||
{
|
||||
$sUrl = str_replace('://', '://'+$this->sKey+"@", $this->sUrl);
|
||||
}
|
||||
|
||||
$iCode = 0;
|
||||
$oHttp = \MailSo\Base\Http::SingletonInstance();
|
||||
|
|
|
@ -24,7 +24,7 @@ class RestChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$sFieldOldpassword = \trim($this->Config()->Get('plugin', 'rest_field_oldpassword', ''));
|
||||
$sFieldNewpassword = \trim($this->Config()->Get('plugin', 'rest_field_newpassword', ''));
|
||||
|
||||
if (!empty($sHost) && (!empty($sKey)))
|
||||
if (!empty($sUrl))
|
||||
{
|
||||
include_once __DIR__.'/RestChangePasswordDriver.php';
|
||||
|
||||
|
|
Loading…
Reference in a new issue