From 5fb39bd0cb6df901d5d3936c1f6bbe5e800fca64 Mon Sep 17 00:00:00 2001 From: michag86 Date: Wed, 3 Aug 2016 11:52:15 +0200 Subject: [PATCH] Apply password policy on user creation --- lib/private/User/Database.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index 354609d0a98..e2cbebab2e4 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -83,6 +83,8 @@ class Database extends \OC\User\Backend implements \OCP\IUserBackend { */ public function createUser($uid, $password) { if (!$this->userExists($uid)) { + $event = new GenericEvent($password); + $this->eventDispatcher->dispatch('OCP\PasswordPolicy::validate', $event); $query = \OC_DB::prepare('INSERT INTO `*PREFIX*users` ( `uid`, `password` ) VALUES( ?, ? )'); $result = $query->execute(array($uid, \OC::$server->getHasher()->hash($password))); -- 2.39.5