mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +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,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use SnappyMail\SensitiveString;
|
||||
|
||||
class ChangePasswordHestiaDriver
|
||||
{
|
||||
const
|
||||
|
|
@ -39,7 +41,7 @@ class ChangePasswordHestiaDriver
|
|||
);
|
||||
}
|
||||
|
||||
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', 'hestia_allowed_emails', ''))) {
|
||||
return false;
|
||||
|
|
@ -53,8 +55,8 @@ class ChangePasswordHestiaDriver
|
|||
$HTTP = \SnappyMail\HTTP\Request::factory();
|
||||
$postvars = array(
|
||||
'email' => $oAccount->Email(),
|
||||
'password' => $sPrevPassword,
|
||||
'new' => $sNewPassword,
|
||||
'password' => (string) $oPrevPassword,
|
||||
'new' => (string) $oNewPassword,
|
||||
);
|
||||
$response = $HTTP->doRequest('POST', 'https://'.$sHost.':'.$sPort.'/reset/mail/', \http_build_query($postvars));
|
||||
if (!$response) {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
|
||||
use \RainLoop\Exceptions\ClientException;
|
||||
use RainLoop\Exceptions\ClientException;
|
||||
|
||||
class ChangePasswordHestiaPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
const
|
||||
NAME = 'Change Password Hestia',
|
||||
AUTHOR = 'Jaap Marcus',
|
||||
VERSION = '1.2',
|
||||
RELEASE = '2023-05-16',
|
||||
REQUIRED = '2.16.3',
|
||||
VERSION = '2.36',
|
||||
RELEASE = '2024-03-17',
|
||||
REQUIRED = '2.36.0',
|
||||
CATEGORY = 'Security',
|
||||
DESCRIPTION = 'Extension to allow users to change their passwords through HestiaCP';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue