Properties

$auth

$auth : array

The list of available authentication capabilities handled by this application.

The full capability list can be found in Horde_Core_Auth_Application.

Type

array

$features

$features : array

List of features supported by this application.

Type

array

$initParams

$initParams : array

The init params used.

Type

array

$version

$version : string

The application's version.

Type

string

$_app

$_app : string

Application identifier.

Type

string

$_sessVars

$_sessVars : array

Cached values to add to the session after authentication.

Type

array

Methods

__construct()

__construct(string  $app) 

Constructor.

Global constants defined:

  • [APPNAME]_TEMPLATES - (string) Location of template files.

Parameters

string $app

Application identifier.

authenticated()

authenticated() 

Code run on successful authentication.

init()

init() 

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

shutdown()

shutdown() 

Shutdown tasks.

appInitFailure()

appInitFailure(\Horde_Exception_PushApp  $e) 

Application-specific code to run if application auth fails.

Called from Horde_Registry::appInit().

Parameters

\Horde_Exception_PushApp $e

The exception object.

menu()

menu(\Horde_Menu  $menu) 

Add additional items to the menu.

Parameters

\Horde_Menu $menu

The menu object.

sidebar()

sidebar(\Horde_View_Sidebar  $sidebar) 

Add additional items to the sidebar.

Parameters

\Horde_View_Sidebar $sidebar

The sidebar object.

logout()

logout() 

Tasks to perform at logout.

removeUserData()

removeUserData(string  $user) 

Removes user data.

Parameters

string $user

Name of user to remove data for.

Throws

\Horde_Exception

backup()

backup(array  $users = array()) : \Horde\Backup\Users

Returns user data for specific (or all) users.

Parameters

array $users

Throws

\Horde_Exception

Returns

\Horde\Backup\Users —

List of per-user data.

restore()

restore(\Horde\Backup\Collection  $data) 

Restores user data for a specific user.

Parameters

\Horde\Backup\Collection $data

User data to restore.

Throws

\Horde_Exception

restoreDependencies()

restoreDependencies() : array

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

Returns

array —

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

getInitialPage()

getInitialPage() : mixed

Return the initial page to access.

Returns

mixed —

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

perms()

perms() : array

Returns a list of available permissions.

Returns

array —

An array describing all available permissions.

hasPermission()

hasPermission(string  $permission, mixed  $allowed, array  $opts = array()) : mixed

Returns the specified permission for the given app permission.

Parameters

string $permission

The permission to check.

mixed $allowed

The allowed permissions.

array $opts

Additional options ('value').

Returns

mixed —

The value of the specified permission.

download()

download(\Horde_Variables  $vars) : array

Prepare data to deliver to browser for download.

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

Parameters

\Horde_Variables $vars

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

Returns

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

setupNotification()

setupNotification(\Horde_Notification_Handler  $handler) 

Modifies the global notification handler.

Parameters

\Horde_Notification_Handler $handler

A notification handler.

listAlarms()

listAlarms(integer  $time, string  $user = null) : array

Lists alarms for a given moment.

Parameters

integer $time

The time to retrieve alarms for.

string $user

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

Returns

array —

An array of UIDs.

authLoginParams()

authLoginParams() : array

Return login parameters used on the login page.

Returns

array —

See Horde_Core_Auth_Application#authLoginParams().

authAuthenticate()

authAuthenticate(string  $userId, array  $credentials) 

Tries to authenticate with the server and create a session.

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

Parameters

string $userId

The username of the user.

array $credentials

Credentials of the user.

Throws

\Horde_Auth_Exception

authTransparent()

authTransparent(\Horde_Core_Auth_Application  $auth_ob) : boolean

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

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

Parameters

\Horde_Core_Auth_Application $auth_ob

The authentication object.

Throws

\Horde_Auth_Exception

Returns

boolean —

Whether transparent login is supported.

authValidate()

authValidate() : boolean

Validates an existing authentication.

Returns

boolean —

Whether the authentication is still valid.

authAddUser()

authAddUser(string  $userId, array  $credentials) 

Adds a user defined by authentication credentials.

Parameters

string $userId

The user ID to add.

array $credentials

An array of login credentials.

Throws

\Horde_Auth_Exception

authUpdateUser()

authUpdateUser(string  $oldId, string  $newId, array  $credentials) 

Update an existing user's credentials.

Parameters

string $oldId

The old user ID.

string $newId

The new user ID.

array $credentials

The new login credentials.

Throws

\Horde_Auth_Exception

authRemoveUser()

authRemoveUser(string  $userId) 

Deletes a user defined by authentication credentials.

Parameters

string $userId

The user ID to delete.

Throws

\Horde_Auth_Exception

authUserExists()

authUserExists(string  $userId) : boolean

Does a user exist?

Parameters

string $userId

The user ID to check.

Returns

boolean —

True if the user exists.

authUserList()

authUserList() : array

Lists all users in the system.

Throws

\Horde_Auth_Exception

Returns

array —

The array of user IDs.

authResetPassword()

authResetPassword(string  $userId) : string

Reset a user's password.

Parameters

string $userId

The user id for which to reset the password.

Throws

\Horde_Auth_Exception

Returns

string —

The new password.

updateSessVars()

updateSessVars() 

Updates cached session variable information into the active session.

configSpecialValues()

configSpecialValues(string  $what) : array

Returns values for <configspecial> configuration settings.

Parameters

string $what

The configuration setting to return.

Returns

array —

The values for the requested configuration setting.

topbarCreate()

topbarCreate(\Horde_Tree_Renderer_Base  $tree, string  $parent = null, array  $params = array()) 

Add node(s) to the topbar tree.

Parameters

\Horde_Tree_Renderer_Base $tree

Tree object.

string $parent

The current parent element.

array $params

Additional parameters.

Throws

\Horde_Exception

changeLanguage()

changeLanguage() 

Code to run if the language preference changes.

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

nosqlDrivers()

nosqlDrivers() : array

Return a list of NoSQL drivers used in the application.

Returns

array —

Array of NoSQL drivers.

_bootstrap()

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

_authenticated()

_authenticated() 

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

Throws

\Horde_Exception

_init()

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

Throws

\Horde_Exception

_backupPrefs()

_backupPrefs(\Horde\Backup\User  $backup, string  $app) 

Extends a backup with some application's preferences.

Parameters

\Horde\Backup\User $backup

A backup object to extend with preference information.

string $app

An application name.

_restorePrefs()

_restorePrefs(\Horde\Backup\Collection  $data, string  $app) : integer

Restores the preferences for an application.

Parameters

\Horde\Backup\Collection $data

Backup data for the specified application.

string $app

An application name.

Returns

integer —

Number of restored preferences.

_addSessVars()

_addSessVars(array  $vars) 

Add session variables to the session.

Parameters

array $vars

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