aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormichag86 <micha_g@arcor.de>2016-08-03 11:52:15 +0200
committerGitHub <noreply@github.com>2016-08-03 11:52:15 +0200
commit5fb39bd0cb6df901d5d3936c1f6bbe5e800fca64 (patch)
tree5f9a3299ac23086003387f0025826f7216a4dbcc /lib
parent223f3fa9d5b4f36ccd455a214d8b6cabcdb49d31 (diff)
downloadnextcloud-server-5fb39bd0cb6df901d5d3936c1f6bbe5e800fca64.tar.gz
nextcloud-server-5fb39bd0cb6df901d5d3936c1f6bbe5e800fca64.zip
Apply password policy on user creation
Diffstat (limited to 'lib')
-rw-r--r--lib/private/User/Database.php2
1 files changed, 2 insertions, 0 deletions
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)));