aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobiasKaminsky <tobias@kaminsky.me>2016-11-23 21:44:38 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-02-15 17:45:29 -0600
commitbe139c85a8ea7809a710a4be57b40a9001026117 (patch)
treed7b40eaf5491856b0dd66d8308e1e54555479a9b
parenta37f29964f86be5ec51fe33d32e290d3701828b2 (diff)
downloadnextcloud-server-be139c85a8ea7809a710a4be57b40a9001026117.tar.gz
nextcloud-server-be139c85a8ea7809a710a4be57b40a9001026117.zip
empty password only allowed if password link is sent
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r--lib/private/User/Manager.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php
index cb726b55eac..39845fba88d 100644
--- a/lib/private/User/Manager.php
+++ b/lib/private/User/Manager.php
@@ -281,10 +281,10 @@ class Manager extends PublicEmitter implements IUserManager {
if (strlen(trim($uid, "\t\n\r\0\x0B\xe2\x80\x8b")) !== strlen(trim($uid))) {
throw new \Exception($l->t('Username contains whitespace at the beginning or at the end'));
}
- // No empty password
-// if (trim($password) == '') {
-// throw new \Exception($l->t('A valid password must be provided'));
-// }
+ // empty password only allowed if password link is sent
+ if (trim($password) == '' && $this->config->getAppValue('core', 'umgmt_send_passwordlink', 'false') === 'false') {
+ throw new \Exception($l->t('A valid password must be provided'));
+ }
// Check if user already exists
if ($this->userExists($uid)) {