Nextcloud PHP API (master)

IUserSession

User session

Tags
since
6.0.0

Table of Contents

Methods

getImpersonatingUserID()  : string|null
get getImpersonatingUserID
getUser()  : IUser|null
get the current active user
isLoggedIn()  : bool
Checks whether the user is logged in
login()  : bool
Do a user login
logout()  : void
Logs the user out including all the session data Logout, destroys session
setImpersonatingUserID()  : void
set setImpersonatingUserID
setUser()  : mixed
set the currently active user
setVolatileActiveUser()  : void
Temporarily set the currently active user without persisting in the session

Methods

getImpersonatingUserID()

get getImpersonatingUserID

public getImpersonatingUserID() : string|null
Tags
since
18.0.0
Return values
string|null

getUser()

get the current active user

public getUser() : IUser|null
Tags
since
8.0.0
Return values
IUser|null

Current user, otherwise null

isLoggedIn()

Checks whether the user is logged in

public isLoggedIn() : bool
Tags
since
8.0.0
Return values
bool

if logged in

login()

Do a user login

public login(string $uid, string $password) : bool
Parameters
$uid : string

the username

$password : string

the password

Tags
since
6.0.0
Return values
bool

true if successful

logout()

Logs the user out including all the session data Logout, destroys session

public logout() : void
Tags
since
6.0.0

setImpersonatingUserID()

set setImpersonatingUserID

public setImpersonatingUserID([bool $useCurrentUser = true ]) : void
Parameters
$useCurrentUser : bool = true
Tags
since
18.0.0

setUser()

set the currently active user

public setUser(IUser|null $user) : mixed
Parameters
$user : IUser|null
Tags
since
8.0.0

setVolatileActiveUser()

Temporarily set the currently active user without persisting in the session

public setVolatileActiveUser(IUser|null $user) : void
Parameters
$user : IUser|null
Tags
since
29.0.0

        
On this page

Search results