3434use OCA \UserSQL \Model \User ;
3535use OCA \UserSQL \Properties ;
3636use OCA \UserSQL \Repository \UserRepository ;
37- use OCP \EventDispatcher \IEventDispatcher ;
3837use OCP \IConfig ;
3938use OCP \IL10N ;
4039use OCP \ILogger ;
41- use OCP \Security \Events \ValidatePasswordPolicyEvent ;
4240use OCP \User \Backend \ABackend ;
4341use OCP \User \Backend \ICheckPasswordBackend ;
4442use OCP \User \Backend \ICountUsersBackend ;
@@ -98,10 +96,6 @@ final class UserBackend extends ABackend implements
9896 * @var EventDispatcher The event dispatcher.
9997 */
10098 private $ eventDispatcher ;
101- /**
102- * @var IEventDispatcher The new event dispatcher.
103- */
104- private $ newEventDispatcher ;
10599 /**
106100 * @var IUserAction[] The actions to execute.
107101 */
@@ -118,12 +112,11 @@ final class UserBackend extends ABackend implements
118112 * @param IL10N $localization The localization service.
119113 * @param IConfig $config The config instance.
120114 * @param EventDispatcher $eventDispatcher The event dispatcher.
121- * @param IEventDispatcher $newEventDispatcher The new event dispatcher.
122115 */
123116 public function __construct (
124117 $ AppName , Cache $ cache , ILogger $ logger , Properties $ properties ,
125118 UserRepository $ userRepository , IL10N $ localization , IConfig $ config ,
126- EventDispatcher $ eventDispatcher, IEventDispatcher $ newEventDispatcher
119+ EventDispatcher $ eventDispatcher
127120 ) {
128121 $ this ->appName = $ AppName ;
129122 $ this ->cache = $ cache ;
@@ -133,7 +126,6 @@ public function __construct(
133126 $ this ->localization = $ localization ;
134127 $ this ->config = $ config ;
135128 $ this ->eventDispatcher = $ eventDispatcher ;
136- $ this ->newEventDispatcher = $ newEventDispatcher ;
137129 $ this ->actions = [];
138130
139131 $ this ->initActions ();
@@ -523,8 +515,10 @@ public function setPassword(string $uid, string $password): bool
523515 return false ;
524516 }
525517
526- $ event = new ValidatePasswordPolicyEvent ($ password );
527- $ this ->newEventDispatcher ->dispatchTyped ($ event );
518+ $ event = new GenericEvent ($ password );
519+ $ this ->eventDispatcher ->dispatch (
520+ 'OCP\PasswordPolicy::validate ' , $ event
521+ );
528522
529523 $ user = $ this ->userRepository ->findByUid ($ uid );
530524 if (!($ user instanceof User)) {
0 commit comments