]> source.dussan.org Git - nextcloud-server.git/commitdiff
Apply password policy on user creation 711/head
authormichag86 <micha_g@arcor.de>
Wed, 3 Aug 2016 09:52:15 +0000 (11:52 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Aug 2016 09:52:15 +0000 (11:52 +0200)
lib/private/User/Database.php

index 354609d0a988ffb7c0a6574e8af2734ba572f41b..e2cbebab2e4d71a8e0670d89c5b59bbc202799a9 100644 (file)
@@ -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)));