PHP Class Horde_Registry_Application, horde

Copyright 2009-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Michael Slusarz ([email protected])
Inheritance: implements Horde_Shutdown_Task
Show file Open project: horde/horde

Public Properties

Property Type Description
$auth array The full capability list can be found in Horde_Core_Auth_Application.
$features array List of features supported by this application.
$initParams array The init params used.
$version string The application's version.

Protected Properties

Property Type Description
$_app string Application identifier.
$_sessVars array Cached values to add to the session after authentication.

Public Methods

Method Description
__construct ( string $app ) Constructor.
appInitFailure ( Horde_Exception_PushApp $e ) Application-specific code to run if application auth fails.
authAddUser ( string $userId, array $credentials ) Adds a user defined by authentication credentials.
authAuthenticate ( string $userId, array $credentials ) Tries to authenticate with the server and create a session.
authLoginParams ( ) : array Return login parameters used on the login page.
authRemoveUser ( string $userId ) Deletes a user defined by authentication credentials.
authResetPassword ( string $userId ) : string Reset a user's password.
authTransparent ( Horde_Core_Auth_Application $auth_ob ) : boolean Tries to transparently authenticate with the server and create a session.
authUpdateUser ( string $oldId, string $newId, array $credentials ) Update an existing user's credentials.
authUserExists ( string $userId ) : boolean Does a user exist?
authUserList ( ) : array Lists all users in the system.
authValidate ( ) : boolean Validates an existing authentication.
authenticated ( ) Code run on successful authentication.
changeLanguage ( ) Code to run if the language preference changes.
configSpecialValues ( string $what ) : array Returns values for configuration settings.
download ( Horde_Variables $vars ) : array Prepare data to deliver to browser for download.
getInitialPage ( ) : mixed Return the initial page to access.
hasPermission ( string $permission, mixed $allowed, array $opts = [] ) : mixed Returns the specified permission for the given app permission.
init ( ) Code run when the application is pushed on the stack for the first time in a page access.
listAlarms ( integer $time, string $user = null ) : array Lists alarms for a given moment.
logout ( ) Tasks to perform at logout.
menu ( Horde_Menu $menu ) Add additional items to the menu.
nosqlDrivers ( ) : array Return a list of NoSQL drivers used in the application.
perms ( ) : array Returns a list of available permissions.
removeUserData ( string $user ) Removes user data.
setupNotification ( Horde_Notification_Handler $handler ) Modifies the global notification handler.
shutdown ( ) Shutdown tasks.
sidebar ( Horde_View_Sidebar $sidebar ) Add additional items to the sidebar.
topbarCreate ( Horde_Tree_Renderer_Base $tree, string $parent = null, array $params = [] ) Add node(s) to the sidebar tree.
updateSessVars ( ) Updates cached session variable information into the active session.

Protected Methods

Method Description
_addSessVars ( array $vars ) Add session variables to the session.
_authenticated ( ) Code to run on successful authentication. This will be called once per session, and the entire Horde framework will be available.
_bootstrap ( ) Bootstrap code for an application. This is run when the application object is being created. The full Horde environment is not available in this method, and the user may not yet be authenticated. Only tasks necessary to setup the base application environment should be done here.
_init ( ) Code run when the application is pushed on the stack for the first time in a page access. The entire Horde framework will be available, but the user may not be authenticated.

Method Details

__construct() final public method

Global constants defined: - [APPNAME]_TEMPLATES - (string) Location of template files.
final public __construct ( string $app )
$app string Application identifier.

_addSessVars() final protected method

Add session variables to the session.
final protected _addSessVars ( array $vars )
$vars array Array of session variables to add to the session, once it becomes available.

_authenticated() protected method

Code to run on successful authentication. This will be called once per session, and the entire Horde framework will be available.
protected _authenticated ( )

_bootstrap() protected method

Bootstrap code for an application. This is run when the application object is being created. The full Horde environment is not available in this method, and the user may not yet be authenticated. Only tasks necessary to setup the base application environment should be done here.
protected _bootstrap ( )

_init() protected method

Code run when the application is pushed on the stack for the first time in a page access. The entire Horde framework will be available, but the user may not be authenticated.
protected _init ( )

appInitFailure() public method

Called from Horde_Registry::appInit().
public appInitFailure ( Horde_Exception_PushApp $e )
$e Horde_Exception_PushApp The exception object.

authAddUser() public method

Adds a user defined by authentication credentials.
public authAddUser ( string $userId, array $credentials )
$userId string The user ID to add.
$credentials array An array of login credentials.

authAuthenticate() public method

Any session variables you want added should be set by calling _addSessVars() internally within this method.
public authAuthenticate ( string $userId, array $credentials )
$userId string The username of the user.
$credentials array Credentials of the user.

authLoginParams() public method

Return login parameters used on the login page.
public authLoginParams ( ) : array
return array See Horde_Core_Auth_Application#authLoginParams().

authRemoveUser() public method

Deletes a user defined by authentication credentials.
public authRemoveUser ( string $userId )
$userId string The user ID to delete.

authResetPassword() public method

Reset a user's password.
public authResetPassword ( string $userId ) : string
$userId string The user id for which to reset the password.
return string The new password.

authTransparent() public method

Any session variables you want added should be set by calling _addSessVars() internally within this method.
public authTransparent ( Horde_Core_Auth_Application $auth_ob ) : boolean
$auth_ob Horde_Core_Auth_Application The authentication object.
return boolean Whether transparent login is supported.

authUpdateUser() public method

Update an existing user's credentials.
public authUpdateUser ( string $oldId, string $newId, array $credentials )
$oldId string The old user ID.
$newId string The new user ID.
$credentials array The new login credentials.

authUserExists() public method

Does a user exist?
public authUserExists ( string $userId ) : boolean
$userId string The user ID to check.
return boolean True if the user exists.

authUserList() public method

Lists all users in the system.
public authUserList ( ) : array
return array The array of user IDs.

authValidate() public method

Validates an existing authentication.
public authValidate ( ) : boolean
return boolean Whether the authentication is still valid.

authenticated() final public method

Code run on successful authentication.
final public authenticated ( )

changeLanguage() public method

Called only in applications the user is currently authenticated to in the current session.
public changeLanguage ( )

configSpecialValues() public method

Returns values for configuration settings.
public configSpecialValues ( string $what ) : array
$what string The configuration setting to return.
return array The values for the requested configuration setting.

download() public method

Prepare data to deliver to browser for download.
public download ( Horde_Variables $vars ) : array
$vars Horde_Variables Form variables provided to download script. The filename is available in the 'filename' parameter.
return array Download data: - data: [REQUIRED] (mixed) Data. Either a stream or a string. - name: (string) Filename that overrides 'filename' URL parameter. - size: (integer) If set, used as size. If null, no size will be sent to browser. If not set, size will be automatically determined from data. - type: (string) MIME type to send (default: application/octet-stream).

getInitialPage() public method

Return the initial page to access.
Since: 2.12.0
public getInitialPage ( ) : mixed
return mixed URL of the initial page, or null to use Horde defaults.

hasPermission() public method

Returns the specified permission for the given app permission.
public hasPermission ( string $permission, mixed $allowed, array $opts = [] ) : mixed
$permission string The permission to check.
$allowed mixed The allowed permissions.
$opts array Additional options ('value').
return mixed The value of the specified permission.

init() final public method

Code run when the application is pushed on the stack for the first time in a page access.
final public init ( )

listAlarms() public method

Lists alarms for a given moment.
public listAlarms ( integer $time, string $user = null ) : array
$time integer The time to retrieve alarms for.
$user string The user to retreive alarms for. All users if null.
return array An array of UIDs.

logout() public method

Tasks to perform at logout.
public logout ( )

menu() public method

Add additional items to the menu.
public menu ( Horde_Menu $menu )
$menu Horde_Menu The menu object.

nosqlDrivers() public method

Return a list of NoSQL drivers used in the application.
Since: 2.5.0
public nosqlDrivers ( ) : array
return array Array of NoSQL drivers.

perms() public method

Returns a list of available permissions.
public perms ( ) : array
return array An array describing all available permissions.

removeUserData() public method

Removes user data.
public removeUserData ( string $user )
$user string Name of user to remove data for.

setupNotification() public method

Modifies the global notification handler.
public setupNotification ( Horde_Notification_Handler $handler )
$handler Horde_Notification_Handler A notification handler.

shutdown() public method

Shutdown tasks.
public shutdown ( )

sidebar() public method

Add additional items to the sidebar.
public sidebar ( Horde_View_Sidebar $sidebar )
$sidebar Horde_View_Sidebar The sidebar object.

topbarCreate() public method

Add node(s) to the sidebar tree.
public topbarCreate ( Horde_Tree_Renderer_Base $tree, string $parent = null, array $params = [] )
$tree Horde_Tree_Renderer_Base Tree object.
$parent string The current parent element.
$params array Additional parameters.

updateSessVars() final public method

Updates cached session variable information into the active session.
final public updateSessVars ( )

Property Details

$_app protected property

Application identifier.
protected string $_app
return string

$_sessVars protected property

Cached values to add to the session after authentication.
protected array $_sessVars
return array

$auth public property

The full capability list can be found in Horde_Core_Auth_Application.
public array $auth
return array

$features public property

List of features supported by this application.
public array $features
return array

$initParams public property

The init params used.
public array $initParams
return array

$version public property

The application's version.
public string $version
return string