Nextcloud PHP API (stable18)

IUserSession

User session

Tags
since
6.0.0

Table of Contents

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

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 $user, string $password) : bool
Parameters
$user : 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
Return values
mixed

Search results