From: michag86 Date: Wed, 3 Aug 2016 09:52:15 +0000 (+0200) Subject: Apply password policy on user creation X-Git-Tag: v11.0RC2~878^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5fb39bd0cb6df901d5d3936c1f6bbe5e800fca64;p=nextcloud-server.git Apply password policy on user creation --- 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)));