From 357465eac9733530c8e78ff0d5e1abca04ac93db Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 24 Oct 2014 13:41:44 +0200 Subject: Add "postPasswordReset" hook --- core/lostpassword/controller/lostcontroller.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'core/lostpassword') diff --git a/core/lostpassword/controller/lostcontroller.php b/core/lostpassword/controller/lostcontroller.php index ec52108ad49..0a78063cc34 100644 --- a/core/lostpassword/controller/lostcontroller.php +++ b/core/lostpassword/controller/lostcontroller.php @@ -22,6 +22,8 @@ use OCP\Security\StringUtils; /** * Class LostController * + * Successfully changing a password will emit the post_passwordReset hook. + * * @package OC\Core\LostPassword\Controller */ class LostController extends Controller { @@ -47,13 +49,13 @@ class LostController extends Controller { * @param string $appName * @param IRequest $request * @param IURLGenerator $urlGenerator - * @param $userManager - * @param $defaults + * @param IUserManager $userManager + * @param OC_Defaults $defaults * @param IL10N $l10n * @param IConfig $config * @param ISecureRandom $secureRandom - * @param $from - * @param $isDataEncrypted + * @param string $from + * @param string $isDataEncrypted */ public function __construct($appName, IRequest $request, @@ -154,6 +156,8 @@ class LostController extends Controller { throw new \Exception(); } + \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', array($userId)); + $this->config->deleteUserValue($userId, 'owncloud', 'lostpassword'); @\OC_User::unsetMagicInCookie(); -- cgit v1.2.3