@@ -82,9 +82,13 @@ public function createUser(string $uid, string $password): bool {
8282 }
8383
8484 /**
85+ * Deletes a user
86+ *
87+ * @param string $uid The username of the user to delete
88+ *
8589 * Deletes a user
8690 */
87- public function deleteUser (string $ uid ): bool {
91+ public function deleteUser ($ uid ): bool {
8892 // Delete user-group-relation
8993 $ query = $ this ->dbConn ->getQueryBuilder ();
9094 $ query ->delete ('guests_users ' )
@@ -168,18 +172,23 @@ public function setDisplayName(string $uid, string $displayName): bool {
168172
169173 /**
170174 * Get display name of the user
175+ *
176+ * @param string $uid user ID of the user
171177 */
172- public function getDisplayName (string $ uid ): string {
178+ public function getDisplayName ($ uid ): string {
173179 $ this ->loadUser ($ uid );
174180 return empty ($ this ->cache [$ uid ]['displayname ' ]) ? $ uid : $ this ->cache [$ uid ]['displayname ' ];
175181 }
176182
177183 /**
178184 * Get a list of all display names and user ids.
179185 *
186+ * @param string $search
187+ * @param int|null $limit
188+ * @param int|null $offset
180189 * @return array an array of all displayNames (value) and the corresponding uids (key)
181190 */
182- public function getDisplayNames (string $ search = '' , ? int $ limit = null , ? int $ offset = null ): array {
191+ public function getDisplayNames ($ search = '' , $ limit = null , $ offset = null ): array {
183192 if (!$ this ->allowListing ) {
184193 return [];
185194 } else {
@@ -221,8 +230,11 @@ public function getDisplayNames(string $search = '', ?int $limit = null, ?int $o
221230
222231 /**
223232 * Check if the password is correct without logging in the user
233+ * returns the user id or false
234+ *
235+ * @return string|false
224236 */
225- public function checkPassword (string | false $ loginName , string $ password ): string | false {
237+ public function checkPassword (string $ loginName , string $ password ) {
226238 if (strpos ($ loginName , '@ ' ) === false ) {
227239 return false ;
228240 }
@@ -255,8 +267,10 @@ public function checkPassword(string|false $loginName, string $password): string
255267
256268 /**
257269 * Load an user in the cache
270+ *
271+ * @param string $uid the username
258272 */
259- private function loadUser (string $ uid ): bool {
273+ private function loadUser ($ uid ): bool {
260274 // guests $uid could be NULL or ''
261275 // or is not an email anyway
262276 if (strpos ($ uid , '@ ' ) === false ) {
@@ -294,8 +308,13 @@ private function loadUser(string $uid): bool {
294308
295309 /**
296310 * Get a list of all users
311+ *
312+ * @param string $search
313+ * @param null|int $limit
314+ * @param null|int $offset
315+ * @return string[] an array of all uids
297316 */
298- public function getUsers (string $ search = '' , ? int $ limit = null , ? int $ offset = null ): array {
317+ public function getUsers ($ search = '' , $ limit = null , $ offset = null ): array {
299318 $ users = $ this ->getDisplayNames ($ search , $ limit , $ offset );
300319 $ userIds = array_map (function ($ uid ) {
301320 return (string )$ uid ;
@@ -305,32 +324,41 @@ public function getUsers(string $search = '', ?int $limit = null, ?int $offset =
305324 }
306325
307326 /**
308- * Check if user exists
327+ * Check if a user exists
328+ *
329+ * @param string $uid the username
309330 */
310- public function userExists (string $ uid ): bool {
331+ public function userExists ($ uid ): bool {
311332 $ this ->loadUser ($ uid );
312333 return $ this ->cache [$ uid ] !== false ;
313334 }
314335
315336 /**
316337 * Get the user's home directory
338+ *
339+ * @return string|false
317340 */
318- public function getHome (string $ uid ): string | false {
341+ public function getHome (string $ uid ) {
319342 if ($ this ->userExists ($ uid )) {
320343 return $ this ->config ->getHome ($ uid );
321344 }
322345
323346 return false ;
324347 }
325348
349+ /**
350+ * @return bool
351+ */
326352 public function hasUserListings (): bool {
327353 return true ;
328354 }
329355
330356 /**
331357 * Counts the users in the database
358+ *
359+ * @return int|false
332360 */
333- public function countUsers (): int | false {
361+ public function countUsers () {
334362 $ query = $ this ->dbConn ->getQueryBuilder ();
335363 $ query ->select ($ query ->func ()->count ('uid ' ))
336364 ->from ('guests_users ' );
@@ -341,8 +369,11 @@ public function countUsers(): int|false {
341369
342370 /**
343371 * Returns the username for the given login name in the correct casing
372+ *
373+ * @param string $loginName
374+ * @return string|false
344375 */
345- public function loginName2UserName (string $ loginName ): string | false {
376+ public function loginName2UserName ($ loginName ) {
346377 if ($ this ->userExists ($ loginName )) {
347378 return $ this ->cache [$ loginName ]['uid ' ];
348379 }
@@ -352,6 +383,8 @@ public function loginName2UserName(string $loginName): string|false {
352383
353384 /**
354385 * Backend name to be shown in user management
386+ *
387+ * @return string the name of the backend to be shown
355388 */
356389 public function getBackendName (): string {
357390 return 'Guests ' ;
0 commit comments