Nextcloud PHP API (stable18)

User

This class provides access to the user management. You can get information about the currently logged in user and the permissions for example

Tags
since
5.0.0
deprecated
13.0.0

Table of Contents

checkAdminUser()  : mixed
Check if the user is a admin, redirects to home if not
checkLoggedIn()  : mixed
Check if the user is logged in, redirects to home if not. With redirect URL parameter to the request URI.
getUser()  : string
Get the user id of the user currently logged in.
isLoggedIn()  : bool
Check if the user is logged in

Methods

checkAdminUser()

Check if the user is a admin, redirects to home if not

public static checkAdminUser() : mixed
Tags
since
5.0.0
deprecated
13.0.0

Use annotation based ACLs from the AppFramework instead

Return values
mixed

checkLoggedIn()

Check if the user is logged in, redirects to home if not. With redirect URL parameter to the request URI.

public static checkLoggedIn() : mixed
Tags
since
5.0.0
deprecated
13.0.0

Use annotation based ACLs from the AppFramework instead

Return values
mixed

getUser()

Get the user id of the user currently logged in.

public static getUser() : string
Tags
deprecated
8.0.0

Use \OC::$server->getUserSession()->getUser()->getUID()

since
5.0.0
Return values
string

uid or false

isLoggedIn()

Check if the user is logged in

public static isLoggedIn() : bool
Tags
since
5.0.0
deprecated
13.0.0

Use annotation based ACLs from the AppFramework instead

Return values
bool

Search results