Documentation

Horde_Registry_Application
in package
implements Horde_Shutdown_Task

Default class for the Horde Application API.

Tags
author

Michael Slusarz slusarz@horde.org

author

Jan Schneider jan@horde.org

category

Horde

copyright

2009-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

Interfaces

Horde_Shutdown_Task
Interface to enable a class to implement a shutdown task.

Properties

$auth  : array<string|int, mixed>
The list of available authentication capabilities handled by this application.
$features  : array<string|int, mixed>
List of features supported by this application.
$initParams  : array<string|int, mixed>
The init params used.
$version  : string
The application's version.
$_app  : string
Application identifier.
$_sessVars  : array<string|int, mixed>
Cached values to add to the session after authentication.

Methods

__construct()  : mixed
Constructor.
appInitFailure()  : mixed
Application-specific code to run if application auth fails.
authAddUser()  : mixed
Adds a user defined by authentication credentials.
authAuthenticate()  : mixed
Tries to authenticate with the server and create a session.
authenticated()  : mixed
Code run on successful authentication.
authLoginParams()  : array<string|int, mixed>
Return login parameters used on the login page.
authRemoveUser()  : mixed
Deletes a user defined by authentication credentials.
authResetPassword()  : string
Reset a user's password.
authTransparent()  : bool
Tries to transparently authenticate with the server and create a session.
authUpdateUser()  : mixed
Update an existing user's credentials.
authUserExists()  : bool
Does a user exist?
authUserList()  : array<string|int, mixed>
Lists all users in the system.
authValidate()  : bool
Validates an existing authentication.
backup()  : Users
Returns user data for specific (or all) users.
changeLanguage()  : mixed
Code to run if the language preference changes.
configSpecialValues()  : array<string|int, mixed>
Returns values for <configspecial> configuration settings.
download()  : array<string|int, mixed>
Prepare data to deliver to browser for download.
getInitialPage()  : mixed
Return the initial page to access.
hasPermission()  : mixed
Returns the specified permission for the given app permission.
init()  : mixed
Code run when the application is pushed on the stack for the first time in a page access.
listAlarms()  : array<string|int, mixed>
Lists alarms for a given moment.
logout()  : mixed
Tasks to perform at logout.
menu()  : mixed
Add additional items to the menu.
nosqlDrivers()  : array<string|int, mixed>
Return a list of NoSQL drivers used in the application.
perms()  : array<string|int, mixed>
Returns a list of available permissions.
removeUserData()  : mixed
Removes user data.
restore()  : mixed
Restores user data for a specific user.
restoreDependencies()  : array<string|int, mixed>
Returns restore dependencies, i.e. a list of collections types that require other collection types to be finished first.
setupNotification()  : mixed
Modifies the global notification handler.
shutdown()  : mixed
Shutdown tasks.
sidebar()  : mixed
Add additional items to the sidebar.
topbarCreate()  : mixed
Add node(s) to the topbar tree.
updateSessVars()  : mixed
Updates cached session variable information into the active session.
_addSessVars()  : mixed
Add session variables to the session.
_authenticated()  : mixed
Code to run on successful authentication. This will be called once per session, and the entire Horde framework will be available.
_backupPrefs()  : mixed
Extends a backup with some application's preferences.
_bootstrap()  : mixed
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()  : mixed
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.
_restorePrefs()  : int
Restores the preferences for an application.

Properties

$auth

The list of available authentication capabilities handled by this application.

public array<string|int, mixed> $auth = array()

The full capability list can be found in Horde_Core_Auth_Application.

$features

List of features supported by this application.

public array<string|int, mixed> $features = array( // View Handlers 'dynamicView' => \false, 'minimalView' => \false, 'smartmobileView' => \false, // Notification Handler 'notificationHandler' => \false, // Alarm Handler 'alarmHandler' => \false, )

$initParams

The init params used.

public array<string|int, mixed> $initParams = array()

$version

The application's version.

public string $version = 'unknown'

$_app

Application identifier.

protected string $_app

$_sessVars

Cached values to add to the session after authentication.

protected array<string|int, mixed> $_sessVars = array()

Methods

__construct()

Constructor.

public final __construct(string $app) : mixed

Global constants defined:

  • [APPNAME]_TEMPLATES - (string) Location of template files.
Parameters
$app : string

Application identifier.

authAddUser()

Adds a user defined by authentication credentials.

public authAddUser(string $userId, array<string|int, mixed> $credentials) : mixed
Parameters
$userId : string

The user ID to add.

$credentials : array<string|int, mixed>

An array of login credentials.

Tags
throws
Horde_Auth_Exception

authAuthenticate()

Tries to authenticate with the server and create a session.

public authAuthenticate(string $userId, array<string|int, mixed> $credentials) : mixed

Any session variables you want added should be set by calling _addSessVars() internally within this method.

Parameters
$userId : string

The username of the user.

$credentials : array<string|int, mixed>

Credentials of the user.

Tags
throws
Horde_Auth_Exception

authenticated()

Code run on successful authentication.

public final authenticated() : mixed

authLoginParams()

Return login parameters used on the login page.

public authLoginParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

See Horde_Core_Auth_Application#authLoginParams().

authRemoveUser()

Deletes a user defined by authentication credentials.

public authRemoveUser(string $userId) : mixed
Parameters
$userId : string

The user ID to delete.

Tags
throws
Horde_Auth_Exception

authResetPassword()

Reset a user's password.

public authResetPassword(string $userId) : string
Parameters
$userId : string

The user id for which to reset the password.

Tags
throws
Horde_Auth_Exception
Return values
string

The new password.

authTransparent()

Tries to transparently authenticate with the server and create a session.

public authTransparent(Horde_Core_Auth_Application $auth_ob) : bool

Any session variables you want added should be set by calling _addSessVars() internally within this method.

Parameters
$auth_ob : Horde_Core_Auth_Application

The authentication object.

Tags
throws
Horde_Auth_Exception
Return values
bool

Whether transparent login is supported.

authUpdateUser()

Update an existing user's credentials.

public authUpdateUser(string $oldId, string $newId, array<string|int, mixed> $credentials) : mixed
Parameters
$oldId : string

The old user ID.

$newId : string

The new user ID.

$credentials : array<string|int, mixed>

The new login credentials.

Tags
throws
Horde_Auth_Exception

authUserExists()

Does a user exist?

public authUserExists(string $userId) : bool
Parameters
$userId : string

The user ID to check.

Return values
bool

True if the user exists.

authUserList()

Lists all users in the system.

public authUserList() : array<string|int, mixed>
Tags
throws
Horde_Auth_Exception
Return values
array<string|int, mixed>

The array of user IDs.

authValidate()

Validates an existing authentication.

public authValidate() : bool
Return values
bool

Whether the authentication is still valid.

backup()

Returns user data for specific (or all) users.

public backup([array<string|int, mixed> $users = array() ]) : Users
Parameters
$users : array<string|int, mixed> = array()
Tags
since

Horde_Core 2.29.0

throws
Horde_Exception
Return values
Users

List of per-user data.

changeLanguage()

Code to run if the language preference changes.

public changeLanguage() : mixed

Called only in applications the user is currently authenticated to in the current session.

configSpecialValues()

Returns values for <configspecial> configuration settings.

public configSpecialValues(string $what) : array<string|int, mixed>
Parameters
$what : string

The configuration setting to return.

Return values
array<string|int, mixed>

The values for the requested configuration setting.

download()

Prepare data to deliver to browser for download.

public download(Horde_Variables $vars) : array<string|int, mixed>

IMPORTANT: Applications providing this method MUST implement authentication/permission checking themselves!

Parameters
$vars : Horde_Variables

Form variables provided to download script. The filename is available in the 'filename' parameter.

Return values
array<string|int, mixed>

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()

Return the initial page to access.

public getInitialPage() : mixed
Tags
since
2.12.0
Return values
mixed

URL of the initial page, or null to use Horde defaults.

hasPermission()

Returns the specified permission for the given app permission.

public hasPermission(string $permission, mixed $allowed[, array<string|int, mixed> $opts = array() ]) : mixed
Parameters
$permission : string

The permission to check.

$allowed : mixed

The allowed permissions.

$opts : array<string|int, mixed> = array()

Additional options ('value').

Return values
mixed

The value of the specified permission.

init()

Code run when the application is pushed on the stack for the first time in a page access.

public final init() : mixed

listAlarms()

Lists alarms for a given moment.

public listAlarms(int $time[, string $user = null ]) : array<string|int, mixed>
Parameters
$time : int

The time to retrieve alarms for.

$user : string = null

The user to retreive alarms for. All users if null.

Return values
array<string|int, mixed>

An array of UIDs.

logout()

Tasks to perform at logout.

public logout() : mixed

nosqlDrivers()

Return a list of NoSQL drivers used in the application.

public nosqlDrivers() : array<string|int, mixed>
Tags
since
2.5.0
Return values
array<string|int, mixed>

Array of NoSQL drivers.

perms()

Returns a list of available permissions.

public perms() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array describing all available permissions.

removeUserData()

Removes user data.

public removeUserData(string $user) : mixed
Parameters
$user : string

Name of user to remove data for.

Tags
throws
Horde_Exception

restore()

Restores user data for a specific user.

public restore(Collection $data) : mixed
Parameters
$data : Collection

User data to restore.

Tags
since

Horde_Core 2.29.0

throws
Horde_Exception

restoreDependencies()

Returns restore dependencies, i.e. a list of collections types that require other collection types to be finished first.

public restoreDependencies() : array<string|int, mixed>
Tags
since

Horde_Core 2.29.0

Return values
array<string|int, mixed>

A list of dependencies in the format [ 'type' => [ 'dependency' ] ]

setupNotification()

Modifies the global notification handler.

public setupNotification(Horde_Notification_Handler $handler) : mixed
Parameters
$handler : Horde_Notification_Handler

A notification handler.

shutdown()

Shutdown tasks.

public shutdown() : mixed

sidebar()

Add additional items to the sidebar.

public sidebar(Horde_View_Sidebar $sidebar) : mixed
Parameters
$sidebar : Horde_View_Sidebar

The sidebar object.

topbarCreate()

Add node(s) to the topbar tree.

public topbarCreate(Horde_Tree_Renderer_Base $tree[, string $parent = null ][, array<string|int, mixed> $params = array() ]) : mixed
Parameters
$tree : Horde_Tree_Renderer_Base

Tree object.

$parent : string = null

The current parent element.

$params : array<string|int, mixed> = array()

Additional parameters.

Tags
throws
Horde_Exception

updateSessVars()

Updates cached session variable information into the active session.

public final updateSessVars() : mixed

_addSessVars()

Add session variables to the session.

protected final _addSessVars(array<string|int, mixed> $vars) : mixed
Parameters
$vars : array<string|int, mixed>

Array of session variables to add to the session, once it becomes available.

_authenticated()

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

protected _authenticated() : mixed
Tags
throws
Horde_Exception

_backupPrefs()

Extends a backup with some application's preferences.

protected _backupPrefs(User $backup, string $app) : mixed
Parameters
$backup : User

A backup object to extend with preference information.

$app : string

An application name.

Tags
since

Horde_Core 2.31.0

_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.

protected _bootstrap() : mixed

_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.

protected _init() : mixed
Tags
throws
Horde_Exception

_restorePrefs()

Restores the preferences for an application.

protected _restorePrefs(Collection $data, string $app) : int
Parameters
$data : Collection

Backup data for the specified application.

$app : string

An application name.

Tags
since

Horde_Core 2.31.0

Return values
int

Number of restored preferences.


        
On this page

Search results