Check if the user exists before trying to set the quota
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
3345a72e7e
commit
f9832ff347
|
@ -498,11 +498,16 @@ class User {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$targetUser = $this->userManager->get($this->uid);
|
||||||
|
if ($targetUser) {
|
||||||
if($quota !== false) {
|
if($quota !== false) {
|
||||||
$this->userManager->get($this->uid)->setQuota($quota);
|
$targetUser->setQuota($quota);
|
||||||
} else {
|
} else {
|
||||||
$this->log->log('not suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', \OCP\Util::WARN);
|
$this->log->log('not suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', \OCP\Util::WARN);
|
||||||
$this->userManager->get($this->uid)->setQuota('default');
|
$targetUser->setQuota('default');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->log->log('trying to set a quota for user ' . $this->uid . ' but the user is missing', \OCP\Util::ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue