mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-01 12:48:08 +09:00
Merge pull request #793 from FOSSBilling/fix/block-password-reset
Disable password reset via Hooks
This commit is contained in:
4 files changed
+5
-1
No files matched your search
@@ -171,6 +171,7 @@ class Guest extends \Api_Abstract
|
||||
*/
|
||||
public function reset_password($data)
|
||||
{
|
||||
$this->di['events_manager']->fire(['event' => 'onBeforePasswordResetClient']);
|
||||
$required = [
|
||||
'email' => 'Email required',
|
||||
];
|
||||
@@ -221,6 +222,7 @@ class Guest extends \Api_Abstract
|
||||
$required = [
|
||||
'hash' => 'Hash required',
|
||||
];
|
||||
$this->di['events_manager']->fire(['event' => 'onBeforePasswordResetClient']);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
$reset = $this->di['db']->findOne('ClientPasswordReset', 'hash = ?', [$data['hash']]);
|
||||
|
||||
@@ -79,6 +79,7 @@ class Client implements \Box\InjectionAwareInterface
|
||||
public function get_reset_password_confirm(\Box_App $app, $hash)
|
||||
{
|
||||
$api = $this->di['api_guest'];
|
||||
$this->di['events_manager']->fire(['event' => 'onBeforePasswordResetClient']);
|
||||
$data = [
|
||||
'hash' => $hash,
|
||||
];
|
||||
|
||||
@@ -99,6 +99,7 @@ class Guest extends \Api_Abstract
|
||||
}
|
||||
|
||||
public function passwordreset($data){
|
||||
$this->di['events_manager']->fire(['event' => 'onBeforePasswordResetStaff']);
|
||||
$required = [
|
||||
'email' => 'Email required',
|
||||
];
|
||||
|
||||
@@ -120,7 +120,7 @@ class Admin implements InjectionAwareInterface
|
||||
public function get_confirmation(\Box_App $app, $hash)
|
||||
{
|
||||
$service = $this->di['mod_service']('staff');
|
||||
|
||||
$this->di['events_manager']->fire(['event' => 'onBeforePasswordResetStaff']);
|
||||
// send confirmation email
|
||||
$service->sendPasswordResetConfirmation($hash);
|
||||
$this->di['logger']->info('Admin password reset request was approved');
|
||||
|
||||
Reference in new issue
Block a user