SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class AdminAuth

Provides user authentication functions for the admin

Variables

NameVisibilityDescription
$category_cache (static) 

Functions

NameVisibilityDescription
changePasswordpublic (static)Sets the password for a operator, or the current operator if a operator-id is not specified.
checkLoginpublic (static)If the user is not logged, redirect them to a login page
checkPasswordpublic (static)Checks the password on the database matches the one provided
checkRateLimitpublic (static)Does a rate-limit check for admin logins against the login_attempts table
getAllCategoriespublic (static)Gets a list of all of the admin categories
getDetailspublic (static)Gets the id, name, username and email of the currently logged in operator.
getIdpublic (static)Returns the id of the currently logged in operator
getLocalIdpublic (static)Fetches the ID of current operator if and only if they're a local operator, otherwise 0.
getOperatorCategoriespublic (static)Returns an array of all categories the currently logged in operator is in
getPrimaryCategoryIdpublic (static)Get the ID of the 'Primary administrators' category
hasDatabaseRecordpublic (static)Does the record-id for this login correspond to a local database record?
inCategorypublic (static)Returns true if the currently logged in user is in the specified category.
injectLocalSuperConfpublic (static)Load the existing super-operators list from config, inject another operator, return new array
isLoggedInpublic (static)Check if the user is logged in or not
isSuperpublic (static)A super-operator -- has access to everything (dev tools, all permissions, etc)
logoutpublic (static)Logs an operator out
processLocalpublic (static)Process a local (developer) login, with details stored in a config file
processLoginpublic (static)Processes the login by a operator with the specified username and password
processOpenidpublic (static)Stub function for future development using OpenID
processRemotepublic (static)Process a remote (developer) login, as provided by the external web service
saveLoginAttemptpublic (static)Store a login attempt (used for rate checking)

public changePassword

unknown AdminAuth::changePassword ( string $new_password [, int $operator_id ] );

Sets the password for a operator, or the current operator if a operator-id is not specified.

public checkLogin

void AdminAuth::checkLogin ( );

If the user is not logged, redirect them to a login page

public checkPassword

unknown AdminAuth::checkPassword ( mixed $password [, mixed $operator_id ] );

Checks the password on the database matches the one provided
For re-authenticating certain actions of logged in operators

public checkRateLimit

bool|array AdminAuth::checkRateLimit ( mixed $username , mixed $ip );

Does a rate-limit check for admin logins against the login_attempts table

public getAllCategories

unknown AdminAuth::getAllCategories ( );

Gets a list of all of the admin categories
Returned as an array of id => name

public getDetails

bool|array AdminAuth::getDetails ( );

Gets the id, name, username and email of the currently logged in operator.
N.B. the id will be 0 for remote users

public getId

unknown AdminAuth::getId ( );

Returns the id of the currently logged in operator

public getLocalId

int AdminAuth::getLocalId ( );

Fetches the ID of current operator if and only if they're a local operator, otherwise 0.

public getOperatorCategories

unknown AdminAuth::getOperatorCategories ( );

Returns an array of all categories the currently logged in operator is in

public getPrimaryCategoryId

int AdminAuth::getPrimaryCategoryId ( );

Get the ID of the 'Primary administrators' category

i.e. the first category with permission to manage operators

public hasDatabaseRecord

bool AdminAuth::hasDatabaseRecord ( );

Does the record-id for this login correspond to a local database record?

public inCategory

unknown AdminAuth::inCategory ( int $category_id );

Returns true if the currently logged in user is in the specified category.
Always returns true for remotely-logged in users.

public injectLocalSuperConf

array AdminAuth::injectLocalSuperConf ( string $username , string $pass_hash , string $pass_salt );

Load the existing super-operators list from config, inject another operator, return new array

public isLoggedIn

boolean AdminAuth::isLoggedIn ( );

Check if the user is logged in or not

public isSuper

bool AdminAuth::isSuper ( );

A super-operator -- has access to everything (dev tools, all permissions, etc)

public logout

unknown AdminAuth::logout ( );

Logs an operator out

public processLocal

boolean AdminAuth::processLocal ( string $username , string $password );

Process a local (developer) login, with details stored in a config file

public processLogin

boolean AdminAuth::processLogin ( string $username , string $password );

Processes the login by a operator with the specified username and password

public processOpenid

boolean AdminAuth::processOpenid ( string $openid );

Stub function for future development using OpenID

public processRemote

boolean AdminAuth::processRemote ( string $username , string $password );

Process a remote (developer) login, as provided by the external web service

public saveLoginAttempt

void AdminAuth::saveLoginAttempt ( mixed $username , mixed $ip , mixed $success );

Store a login attempt (used for rate checking)