mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03: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;
|
private $oLogger = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sHost
|
* @param string $sUrl
|
||||||
* @param int $iPort
|
* @param string $sKey
|
||||||
*
|
*
|
||||||
* @return \RestChangePasswordDriver
|
* @return \RestChangePasswordDriver
|
||||||
*/
|
*/
|
||||||
|
|
@ -51,8 +51,6 @@ class RestChangePasswordDriver implements \RainLoop\Providers\ChangePassword\Cha
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oProvider->SetFieldNames($sFieldEmail, $sFieldOldpassword, $sFieldNewpassword);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sFieldEmail
|
* @param string $sFieldEmail
|
||||||
* @param string $sFieldOldpassword
|
* @param string $sFieldOldpassword
|
||||||
|
|
@ -120,12 +118,16 @@ class RestChangePasswordDriver implements \RainLoop\Providers\ChangePassword\Cha
|
||||||
}
|
}
|
||||||
|
|
||||||
$bResult = false;
|
$bResult = false;
|
||||||
if (!empty($this->sHost) && 0 < $this->iPort && $oAccount)
|
if (!empty($this->sUrl) && $oAccount)
|
||||||
{
|
{
|
||||||
$sEmail = \trim(\strtolower($oAccount->Email()));
|
$sEmail = \trim(\strtolower($oAccount->Email()));
|
||||||
|
|
||||||
|
$sUrl = $this->sUrl;
|
||||||
# Adding the REST Api key to the url, try to use always https
|
# 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;
|
$iCode = 0;
|
||||||
$oHttp = \MailSo\Base\Http::SingletonInstance();
|
$oHttp = \MailSo\Base\Http::SingletonInstance();
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class RestChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
$sFieldOldpassword = \trim($this->Config()->Get('plugin', 'rest_field_oldpassword', ''));
|
$sFieldOldpassword = \trim($this->Config()->Get('plugin', 'rest_field_oldpassword', ''));
|
||||||
$sFieldNewpassword = \trim($this->Config()->Get('plugin', 'rest_field_newpassword', ''));
|
$sFieldNewpassword = \trim($this->Config()->Get('plugin', 'rest_field_newpassword', ''));
|
||||||
|
|
||||||
if (!empty($sHost) && (!empty($sKey)))
|
if (!empty($sUrl))
|
||||||
{
|
{
|
||||||
include_once __DIR__.'/RestChangePasswordDriver.php';
|
include_once __DIR__.'/RestChangePasswordDriver.php';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue