Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ public function searchDisplayName($pattern, $limit = null, $offset = null) {
* @return bool|IUser the created user or false
*/
public function createUser($uid, $password) {
if (!$this->verifyUid($uid)) {
return false;
}

$localBackends = [];
foreach ($this->backends as $backend) {
if ($backend instanceof Database) {
Expand Down Expand Up @@ -599,4 +603,14 @@ public function getByEmail($email) {
return ($u instanceof IUser);
}));
}

private function verifyUid(string $uid): bool {
$appdata = 'appdata_' . $this->config->getSystemValue('instanceid');

if ($uid === '.htaccess' || $uid === 'files_external' || $uid === '.ocdata' || $uid === 'owncloud.log' || $uid === 'nextcloud.log' || $uid === $appdata) {
return false;
}

return true;
}
}