Documentation

rex_backend_login extends rex_login
in package

Table of Contents

Constants

SESSION_ID  = 'REX_SESSID'
Session ID is saved in session under this key for session fixation prevention.
SESSION_IMPERSONATOR  = 'impersonator'
the userid of the impersonator user.
SESSION_LAST_ACTIVITY  = 'STAMP'
SESSION_PASSWORD  = 'password'
the encrypted user password.
SESSION_START_TIME  = 'starttime'
the timestamp when the session was initially started.
SESSION_USER_ID  = 'UID'
the id of the user.
SYSTEM_ID  = 'backend_login'

Properties

$cache  : bool
$DB  : positive-int
$idColumn  : string
$impersonateQuery  : string
$impersonator  : rex_sql|rex_user|null
$loginQuery  : string
$loginStatus  : int
$logout  : bool
$message  : string
$passwordColumn  : string
$sessionDuration  : int
A Session will be closed when not activly used for this timespan (seconds).
$sessionMaxOverallDuration  : int
A session cannot stay longer then this value, no matter its actively used once in a while (seconds).
$systemId  : string
$user  : rex_sql|rex_user
$userLogin  : string|null
$userPassword  : string|null
$userQuery  : string

Methods

__construct()  : mixed
changedPassword()  : void
checkLogin()  : bool
Prüft die mit setLogin() und setPassword() gesetzten Werte anhand des LoginQueries/UserQueries und gibt den Status zurück.
createUser()  : rex_user|null
Creates the user object if it does not already exist.
deleteSession()  : void
depersonate()  : void
getCookieParams()  : array{lifetime: ?int, path: ?string, domain: ?string, secure: ?bool, httponly: ?bool, samesite: ?string}
Einstellen der Cookie Paramter bevor die session gestartet wird.
getImpersonator()  : rex_sql|rex_user|null
getImpersonator()  : rex_user|null
getLoginPolicy()  : rex_login_policy
getMessage()  : string
Returns the message.
getPasskey()  : string|null
getSessionVar()  : mixed
Gibt den Wert einer Session-Variable zurück.
getStayLoggedInCookieName()  : string
getUser()  : rex_sql|rex_user|null
getUser()  : rex_user|null
getValue()  : mixed
Gibt einen Benutzer-Spezifischen Wert zurück.
hasSession()  : bool
impersonate()  : void
increaseLoginTries()  : void
isLoggedOut()  : bool
Prüft, ob die aktuelle Session ausgeloggt ist.
passwordHash()  : string
Verschlüsselt den übergebnen String.
passwordNeedsRehash()  : bool
passwordVerify()  : bool
regenerateSessionId()  : void
refresh session on permission elevation for security reasons.
requiresPasswordChange()  : bool
setCache()  : void
Setzt, ob die Ergebnisse der Login-Abfrage pro Seitenaufruf gecached werden sollen.
setIdColumn()  : void
Setzt den Namen der Spalte, der die User-Id enthält.
setImpersonateQuery()  : void
Setzt den ImpersonateQuery.
setLogin()  : void
Setzt den Login und das Password.
setLoginQuery()  : void
Setzt den LoginQuery.
setLogout()  : void
Markiert die aktuelle Session als ausgeloggt.
setPasskey()  : void
setPasswordColumn()  : void
Sets the password column.
setSessionDuration()  : void
Setzt das Session Timeout.
setSessionVar()  : void
Setzte eine Session-Variable.
setSqlDb()  : void
Setzt die Id der zu verwendenden SQL Connection.
setStayLoggedIn()  : void
setSystemId()  : void
Setzt eine eindeutige System Id, damit mehrere Sessions auf der gleichen Domain unterschieden werden können.
setUserQuery()  : void
Setzt den UserQuery.
startSession()  : void
starts a http-session if not already started.
getSessionNamespace()  : string
returns the backends session namespace.
setMessage()  : void
Setzt einen Meldungstext.

Constants

SESSION_ID

Session ID is saved in session under this key for session fixation prevention.

public mixed SESSION_ID = 'REX_SESSID'

SESSION_IMPERSONATOR

the userid of the impersonator user.

public mixed SESSION_IMPERSONATOR = 'impersonator'

SESSION_LAST_ACTIVITY

public mixed SESSION_LAST_ACTIVITY = 'STAMP'

SESSION_PASSWORD

the encrypted user password.

public mixed SESSION_PASSWORD = 'password'

SESSION_START_TIME

the timestamp when the session was initially started.

public mixed SESSION_START_TIME = 'starttime'

SESSION_USER_ID

the id of the user.

public mixed SESSION_USER_ID = 'UID'

Properties

$cache

protected bool $cache = \false

$DB

protected positive-int $DB = 1

$idColumn

protected string $idColumn = 'id'

$impersonateQuery

protected string $impersonateQuery

$loginQuery

protected string $loginQuery

$loginStatus

protected int $loginStatus = 0

$logout

protected bool $logout = \false

$message

protected string $message = ''

$passwordColumn

protected string $passwordColumn = 'password'

$sessionDuration

A Session will be closed when not activly used for this timespan (seconds).

protected int $sessionDuration

$sessionMaxOverallDuration

A session cannot stay longer then this value, no matter its actively used once in a while (seconds).

protected int $sessionMaxOverallDuration

$systemId

protected string $systemId = 'default'

$userLogin

protected string|null $userLogin

$userPassword

protected string|null $userPassword

$userQuery

protected string $userQuery

Methods

changedPassword()

public changedPassword([string|null $passwordHash = null ]) : void
Parameters
$passwordHash : string|null = null

checkLogin()

Prüft die mit setLogin() und setPassword() gesetzten Werte anhand des LoginQueries/UserQueries und gibt den Status zurück.

public checkLogin() : bool

Gibt true zurück bei erfolg, sonst false

Return values
bool

createUser()

Creates the user object if it does not already exist.

public static createUser() : rex_user|null

Helpful if you want to check permissions of the backend user in frontend. If you only want to know if there is any backend session, use .

Return values
rex_user|null

depersonate()

public depersonate() : void

getCookieParams()

Einstellen der Cookie Paramter bevor die session gestartet wird.

public static getCookieParams() : array{lifetime: ?int, path: ?string, domain: ?string, secure: ?bool, httponly: ?bool, samesite: ?string}
Return values
array{lifetime: ?int, path: ?string, domain: ?string, secure: ?bool, httponly: ?bool, samesite: ?string}

getMessage()

Returns the message.

public getMessage() : string
Return values
string

getPasskey()

public getPasskey() : string|null
Return values
string|null

getSessionVar()

Gibt den Wert einer Session-Variable zurück.

public getSessionVar(string $varname[, mixed $default = '' ]) : mixed
Parameters
$varname : string
$default : mixed = ''
Tags
psalm-return

( $varname is 'starttime' ? int|null : ($varname is 'STAMP' ? int|null : ($varname is 'UID' ? int|null : ($varname is 'password' ? string|null : ($varname is 'impersonator' ? int|null : ($varname is 'last_db_update' ? int|null : mixed ))))) )

getStayLoggedInCookieName()

public static getStayLoggedInCookieName() : string
Return values
string

getValue()

Gibt einen Benutzer-Spezifischen Wert zurück.

public getValue(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

hasSession()

public static hasSession() : bool
Return values
bool

impersonate()

public impersonate(int $id) : void
Parameters
$id : int

isLoggedOut()

Prüft, ob die aktuelle Session ausgeloggt ist.

public isLoggedOut() : bool
Return values
bool

passwordHash()

Verschlüsselt den übergebnen String.

public static passwordHash(string $password[, bool $isPreHashed = false ]) : string
Parameters
$password : string
$isPreHashed : bool = false
Return values
string

Returns the hashed password

passwordNeedsRehash()

public static passwordNeedsRehash(string $hash) : bool
Parameters
$hash : string
Return values
bool

returns TRUE if the hash should be rehashed to match the given algo and options, or FALSE otherwise

passwordVerify()

public static passwordVerify(string $password, string $hash[, bool $isPreHashed = false ]) : bool
Parameters
$password : string
$hash : string
$isPreHashed : bool = false
Return values
bool

returns TRUE if the password and hash match, or FALSE otherwise

regenerateSessionId()

refresh session on permission elevation for security reasons.

public static regenerateSessionId() : void

requiresPasswordChange()

public requiresPasswordChange() : bool
Return values
bool

setCache()

Setzt, ob die Ergebnisse der Login-Abfrage pro Seitenaufruf gecached werden sollen.

public setCache([bool $status = true ]) : void
Parameters
$status : bool = true

setIdColumn()

Setzt den Namen der Spalte, der die User-Id enthält.

public setIdColumn(string $idColumn) : void
Parameters
$idColumn : string

setImpersonateQuery()

Setzt den ImpersonateQuery.

public setImpersonateQuery(string $impersonateQuery) : void

Dieser wird benutzt, um den User abzurufen, dessen Identität ein Admin einnehmen möchte.

Parameters
$impersonateQuery : string

setLogin()

Setzt den Login und das Password.

public setLogin(string $login, string $password[, bool $isPreHashed = false ]) : void
Parameters
$login : string
$password : string
$isPreHashed : bool = false

setLoginQuery()

Setzt den LoginQuery.

public setLoginQuery(string $loginQuery) : void

Dieser wird benutzt, um den eigentlichne Loginvorgang durchzuführen. Hier wird das eingegebene Password und der Login eingesetzt.

Parameters
$loginQuery : string

setLogout()

Markiert die aktuelle Session als ausgeloggt.

public setLogout(bool $logout) : void
Parameters
$logout : bool

setPasskey()

public setPasskey(string|null $data) : void
Parameters
$data : string|null

setPasswordColumn()

Sets the password column.

public setPasswordColumn(string $passwordColumn) : void
Parameters
$passwordColumn : string

setSessionDuration()

Setzt das Session Timeout.

public setSessionDuration(int $sessionDuration) : void
Parameters
$sessionDuration : int

setSessionVar()

Setzte eine Session-Variable.

public setSessionVar(string $varname, scalar|array<string|int, mixed>|null $value) : void
Parameters
$varname : string
$value : scalar|array<string|int, mixed>|null

setSqlDb()

Setzt die Id der zu verwendenden SQL Connection.

public setSqlDb(positive-int $DB) : void
Parameters
$DB : positive-int

setStayLoggedIn()

public setStayLoggedIn([bool $stayLoggedIn = false ]) : void
Parameters
$stayLoggedIn : bool = false

setSystemId()

Setzt eine eindeutige System Id, damit mehrere Sessions auf der gleichen Domain unterschieden werden können.

public setSystemId(string $systemId) : void
Parameters
$systemId : string

setUserQuery()

Setzt den UserQuery.

public setUserQuery(string $userQuery) : void

Dieser wird benutzt, um einen bereits eingeloggten User im Verlauf seines Aufenthaltes auf der Webseite zu verifizieren

Parameters
$userQuery : string

startSession()

starts a http-session if not already started.

public static startSession() : void

getSessionNamespace()

returns the backends session namespace.

protected static getSessionNamespace() : string
Return values
string

setMessage()

Setzt einen Meldungstext.

protected setMessage(string $message) : void
Parameters
$message : string

        
On this page

Search results