mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03:00
ChangePassword extensions use \SnappyMail\SensitiveString
This commit is contained in:
parent
9427b36633
commit
8c033f53fa
13 changed files with 70 additions and 56 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use MailSo\Net\ConnectSettings;
|
||||
use SnappyMail\SensitiveString;
|
||||
|
||||
class ChangePasswordPoppassdDriver extends \MailSo\Net\NetClient
|
||||
{
|
||||
|
|
@ -33,7 +34,7 @@ class ChangePasswordPoppassdDriver extends \MailSo\Net\NetClient
|
|||
);
|
||||
}
|
||||
|
||||
public function ChangePassword(\RainLoop\Model\Account $oAccount, string $sPrevPassword, string $sNewPassword) : bool
|
||||
public function ChangePassword(\RainLoop\Model\Account $oAccount, SensitiveString $oPrevPassword, SensitiveString $oNewPassword) : bool
|
||||
{
|
||||
if (!\RainLoop\Plugins\Helper::ValidateWildcardValues($oAccount->Email(), $this->oConfig->Get('plugin', 'poppassd_allowed_emails', ''))) {
|
||||
return false;
|
||||
|
|
@ -55,7 +56,7 @@ class ChangePasswordPoppassdDriver extends \MailSo\Net\NetClient
|
|||
try
|
||||
{
|
||||
$this->sendRequestWithCheck('user', $oAccount->IncLogin(), true);
|
||||
$this->sendRequestWithCheck('pass', $sPrevPassword, true);
|
||||
$this->sendRequestWithCheck('pass', $oPrevPassword, true);
|
||||
}
|
||||
catch (\Throwable $oException)
|
||||
{
|
||||
|
|
@ -65,7 +66,7 @@ class ChangePasswordPoppassdDriver extends \MailSo\Net\NetClient
|
|||
$this->bIsLoggined = true;
|
||||
|
||||
if ($this->bIsLoggined) {
|
||||
$this->sendRequestWithCheck('newpass', $sNewPassword);
|
||||
$this->sendRequestWithCheck('newpass', $oNewPassword);
|
||||
} else {
|
||||
$this->writeLogException(
|
||||
new \RuntimeException('Required login'),
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
|
||||
use \RainLoop\Exceptions\ClientException;
|
||||
use RainLoop\Exceptions\ClientException;
|
||||
|
||||
class ChangePasswordPoppassdPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
const
|
||||
NAME = 'Change Password Poppassd',
|
||||
VERSION = '2.20',
|
||||
RELEASE = '2023-12-08',
|
||||
REQUIRED = '2.28.0',
|
||||
VERSION = '2.36',
|
||||
RELEASE = '2024-03-17',
|
||||
REQUIRED = '2.36.0',
|
||||
CATEGORY = 'Security',
|
||||
DESCRIPTION = 'Extension to allow users to change their passwords through Poppassd';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue