Documentation

Security
in package

Security related functions for Standaloneusers.

This is closely coupled with CRM_Utils_System_Standalone Many functions there started life here when Standalone was being resurrected.

Some of the generic user functions have been moved back to the System class so that they are more permanently available.

Things may yet move around in the codebase - particularly if alternative user extensions to Standaloneusers are developed as these would then need to share an interface with the System class

Table of Contents

Methods

checkPassword()  : int|null
Standaloneusers implementation of AuthxInterface::checkPassword
checkPermission()  : bool
CRM_Core_Permission_Standalone::check() delegates here.
hashPassword()  : string
High level function to encrypt password using the site-default mechanism.
singleton()  : Security
checkHashedPassword()  : bool
Check whether a password matches a hashed version.

Methods

checkPassword()

Standaloneusers implementation of AuthxInterface::checkPassword

public checkPassword(string $username, string $plaintextPassword) : int|null
Parameters
$username : string
$plaintextPassword : string
Tags
see
Standalone
Return values
int|null

The User id, if check was successful, otherwise NULL

checkPermission()

CRM_Core_Permission_Standalone::check() delegates here.

public checkPermission(string $permissionName[, int|null $userID = null ]) : bool
Parameters
$permissionName : string

The permission to check.

$userID : int|null = null

The User ID (not ContactID) to check. If NULL, current logged in user.

Return values
bool

true if yes, else false

hashPassword()

High level function to encrypt password using the site-default mechanism.

public hashPassword(string $plaintext) : string
Parameters
$plaintext : string
Return values
string

checkHashedPassword()

Check whether a password matches a hashed version.

protected checkHashedPassword(string $plaintextPassword, string $storedHashedPassword) : bool
Parameters
$plaintextPassword : string
$storedHashedPassword : string
Return values
bool

        
On this page

Search results