PHP Class Horde_Registry, horde

Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
Author: Anil Madhavapeddy ([email protected])
Author: Michael Slusarz ([email protected])
Inheritance: implements Horde_Shutdown_Task
显示文件 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$applications array Hash storing information on each registry-aware application.
$authException Exception Original authentication exception. Set if 'fallback' auth is used, and authentication fails.
$hordeInit boolean A flag that is set once the basic horde application has been minimally configured.
$initialApp string The application that called appInit().
$nlsconfig Horde_Registry_Nlsconfig NLS configuration.
$vhost string The current virtual host configuration file.

Protected Properties

Property Type Description
$_apiList array The list of APIs.
$_appStack array Stack of in-use applications.
$_appsInit array The list of applications initialized during this access.
$_args array The arguments that have been passed when instantiating the registry.
$_cache array Internal cached data.
$_interfaces array Interfaces list.
$_regmtime integer The last modified time of the newest modified registry file.

Public Methods

Method Description
__clone ( ) Clone should never be called on this object. If it is, die.
__construct ( integer $session_flags, array $args = [] ) Create a new Horde_Registry instance.
__get ( $api ) A property call to the registry object will return a Caller object.
__sleep ( ) serialize() should never be called on this object. If it is, die.
appInit ( string $app, array $args = [] ) : Horde_Registry_Application Application bootstrap initialization.
applicationFilePath ( string $path, string $app = null ) : string Replace any %application% strings with the filesystem path to the application.
applicationWebPath ( string $path, string $app = null ) : string Replace any %application% strings with the web path to the application.
call ( string $method, array $args = [] ) : mixed Return the hook corresponding to the default package that provides the functionality requested by the $method parameter.
callAppMethod ( string $app, string $call, array $options = [] ) : mixed Call a private Horde application method.
callByPackage ( string $app, string $call, array $args = [], array $options = [] ) : mixed Output the hook corresponding to the specific package named.
checkExistingAuth ( string $app = 'horde' ) : boolean Check existing auth for triggers that might invalidate it.
clearAuth ( boolean $destroy = true ) Clears any authentication tokens in the current session.
clearAuthApp ( $app ) : boolean Clears authentication tokens for a given application in the current session.
convertUsername ( string $userId, boolean $toHorde ) : string Converts an authentication username to a unique Horde username.
currentProcessAuth ( ) : boolean Checks whether this process required authentication.
downloadUrl ( string $filename, array $params = [] ) : Horde_Url Returns a URL to be used for downloading data.
get ( string $parameter, string $app = null ) : string Return the requested configuration parameter for the specified application. If no application is specified, the value of the current application is used. However, if the parameter is not present for that application, the Horde-wide value is used instead.
getApiInstance ( string $app, string $type ) : Horde_Registry_Api | Horde_Registry_Application Retrieve an API object.
getApp ( ) : string Return the current application - the app at the top of the application stack.
getAppDrivers ( string $app, string $prefix ) : array Returns a list of available drivers for a library that are available in an application.
getAuth ( string $format = null ) : mixed Returns the currently logged in user, if there is one.
getAuthApps ( ) : array Returns the list of applications currently authenticated to.
getAuthCredential ( string $credential = null, string $app = null ) : mixed Returns the requested credential for the currently logged in user, if present.
getAuthInfo ( ) : array Returns authentication metadata information.
getEmailCharset ( ) : string Returns the charset to use for outgoing emails.
getInitialPage ( string $app = null ) : string Query the initial page for an application - the webroot, if there is no initial_page set, and the initial_page, if it is set.
getLanguageCharset ( ) : string Returns the charset for the current language.
getLogoutUrl ( array $options = [] ) : Horde_Url Returns a URL to the login screen, adding the necessary logout parameters.
getServiceLink ( string $type, string $app = null, boolean $full = false ) : Horde_Url Returns the URL to access a Horde service.
getVersion ( string $app = null, boolean $number = false ) : string Return the version string for a given application.
getView ( ) : integer Get current view.
hasFeature ( string $id, string $app = null ) : boolean Does the application have the queried feature?
hasInterface ( string $interface ) : mixed Determine if an interface is implemented by an active application.
hasLink ( string $method, string $app = null ) : mixed Determine if a link has been registered with the registry.
hasMethod ( string $method, string $app = null ) : mixed Determine if a method has been registered with the registry.
hasPermission ( string $app, integer $perms = Horde_Perms::READ, array $params = [] ) : boolean Check permissions on an application.
hasView ( integer $view, string $app = null ) : boolean Does the given application have the queried view?
importConfig ( string $app ) Reads the configuration values for the given application and imports them into the global $conf variable.
isAdmin ( array $options = [] ) : boolean Is a user an administrator?
isAuthenticated ( array $opts = [] ) : boolean Checks if there is a session with valid auth information. If there isn't, but the configured Auth driver supports transparent authentication, then we try that.
isInactive ( string $app ) : boolean Is the given application inactive?
isTest ( ) : boolean Is the registry in 'test' mode?
link ( string $method, array $args = [], mixed $extra = '' ) : string Returns the link corresponding to the default package that provides the functionality requested by the $method parameter.
linkByPackage ( string $app, string $call, array $args = [], mixed $extra = '' ) : string Returns the link corresponding to the specific package named.
listAPIs ( ) : array Returns all available registry APIs.
listAllApps ( ) : array Return a list of all applications, ignoring permissions.
listApps ( array $filter = null, boolean $assoc = false, integer $perms = Horde_Perms::SHOW ) : array Return a list of the installed and registered applications.
listMethods ( string $api = null ) : array Returns all of the available registry methods, or alternately only those for a specified API.
loadConfigFile ( string $conf_file, mixed $vars = null, string $app = null ) : Horde_Registry_Loadconfig Load a configuration file from a Horde application's config directory.
loadPrefs ( string $app = null ) Loads the preferences for the current user for the current application and imports them into the global $prefs variable.
passwordChangeRequested ( ) : boolean Return whether the authentication backend requested a password change.
popApp ( ) : string Remove the current app from the application stack, setting the current app to whichever app was current before this one took over.
preferredLang ( string $lang = null ) : string Selects the most preferred language for the current client session.
pushApp ( string $app, array $options = [] ) : boolean Set the current application, adding it to the top of the Horde application stack. If this is the first application to be pushed, retrieve session information as well.
rebuild ( ) Rebuild the registry configuration.
remoteHost ( ) : object Returns information about the remote host.
removeUser ( string $userId ) Removes a user from the authentication backend and calls all applications' removeUserData API methods.
removeUserData ( string $user, string $app = null ) Removes user's application data.
setAuth ( string $authId, array $credentials, array $options = [] ) Sets data in the session saying that authorization has succeeded, note which userId was authorized, and note when the login took place.
setAuthCredential ( mixed $credential, string $value = null, string $app = null ) Sets the requested credential for the currently logged in user.
setAuthenticationSetting ( string $authentication ) (Re)set the authentication parameter. Useful for requests, such as Rpc requests where we actually don't perform authentication until later in the request, but still need Horde bootstrapped early in the request. Also clears the local app/api cache since applications will probably already have been initialized during Notification polling.
setLanguage ( string $lang = null ) : string Sets the language.
setLanguageEnvironment ( string $lang = null, string $app = null ) Sets the language and reloads the whole NLS environment.
setTextdomain ( string $app, string $directory ) Sets the gettext domain.
setTimeZone ( ) Sets the current timezone, if available.
setView ( integer $view = self::VIEW_BASIC ) Set current view.
showService ( string $type ) : boolean TODO
shutdown ( ) Events to do on shutdown.

Protected Methods

Method Description
_cacheId ( string $hash = null ) Get the cache ID for the registry information.
_doHasSearch ( $method, $app, string $func ) : mixed Do the has*() search.
_getAuthCredentials ( string $app ) : mixed Get the list of credentials for a given app.
_loadApi ( string $app ) : Horde_Registry_Api Load an application's API object.
_loadApplications ( ) Load application information from registry config files.
_mapLang ( string $language ) : string Maps languages with common two-letter codes (such as nl) to the full locale code (in this case, nl_NL). Returns the language unmodified if it isn't an alias.
_methodLookup ( string $method ) : mixed Do a lookup of method name -> app call.
_pushAppError ( Exception $e, integer $error ) Process Exceptions thrown when pushing app on stack.

Method Details

__clone() public method

Clone should never be called on this object. If it is, die.
public __clone ( )

__construct() public method

Create a new Horde_Registry instance.
public __construct ( integer $session_flags, array $args = [] )
$session_flags integer Any session flags.
$args array See appInit().

__get() public method

A property call to the registry object will return a Caller object.
public __get ( $api )

__sleep() public method

serialize() should never be called on this object. If it is, die.
public __sleep ( )

_cacheId() protected method

Get the cache ID for the registry information.
protected _cacheId ( string $hash = null )
$hash string If set, hash this value and use as the hash of the registry. If false, uses session stored value.

_doHasSearch() protected method

Do the has*() search.
See also: hasMethod
See also: hasLink
protected _doHasSearch ( $method, $app, string $func ) : mixed
$func string The API function to call to get the list of elements to search. Either 'methods' or 'links'.
return mixed The application implementing $method, false if it doesn't exist;

_getAuthCredentials() protected method

Get the list of credentials for a given app.
protected _getAuthCredentials ( string $app ) : mixed
$app string The application name.
return mixed True, false, or the credential list.

_loadApi() protected method

Load an application's API object.
protected _loadApi ( string $app ) : Horde_Registry_Api
$app string The application to load.
return Horde_Registry_Api The API object, or null if not available.

_loadApplications() protected method

Load application information from registry config files.
protected _loadApplications ( )

_mapLang() protected method

Maps languages with common two-letter codes (such as nl) to the full locale code (in this case, nl_NL). Returns the language unmodified if it isn't an alias.
protected _mapLang ( string $language ) : string
$language string The language code to map.
return string The mapped language code.

_methodLookup() protected method

Do a lookup of method name -> app call.
protected _methodLookup ( string $method ) : mixed
$method string The method name.
return mixed An array containing the app and method call, or false if not found.

_pushAppError() protected method

Process Exceptions thrown when pushing app on stack.
protected _pushAppError ( Exception $e, integer $error )
$e Exception The thrown Exception.
$error integer The pushApp() error type.

appInit() public static method

Solves chicken-and-egg problem - need a way to init Horde environment from application without an active Horde_Registry object. Page compression will be started (if configured). Global variables defined:
  - $browser: Horde_Browser object
  - $cli: Horde_Cli object (if 'cli' is true)
  - $conf: Configuration array
  - $injector: Horde_Injector object
  - $language: Language
  - $notification: Horde_Notification object
  - $page_output: Horde_PageOutput object
  - $prefs: Horde_Prefs object
  - $registry: Horde_Registry object
  - $session: Horde_Session object
public static appInit ( string $app, array $args = [] ) : Horde_Registry_Application
$app string The application to initialize.
$args array Optional arguments:
  - admin: (boolean) Require authenticated user to be an admin?
           DEFAULT: false
  - authentication: (string) The type of authentication to use:
    - none: Do not authenticate
    - fallback: Attempt to authenticate; if failure, then don't auth
                (@since 2.11.0).
    - [DEFAULT]: Authenticate; on no auth redirect to login screen
  - cli: (boolean) Initialize a CLI interface. Setting this to true
         implicitly sets 'authentication' to 'none' and 'admin' and
         'nocompress' to true.
         DEFAULT: false
  - nocompress: (boolean) If set, the page will not be compressed.
                DEFAULT: false
  - nologintasks: (boolean) If set, don't perform logintasks (never
                  performed if authentication is 'none').
                  DEFAULT: false
  - nonotificationinit: (boolean) If set, don't initialize the
                        application handlers for the notification
                        system (@since 2.12.0).
  - permission: (array) The permission required by the user to access
                the page. The first element (REQUIRED) is the permission
                name. The second element (OPTION; defaults to SHOW) is
                the permission level.
  - session_cache_limiter: (string) Use this value for the session
                           cache limiter.
                           DEFAULT: Uses the value in the config.
  - session_control: (string) Special session control limitations:
    - netscape: TODO; start read/write session
    - none: Do not start a session
    - readonly: Start session readonly
    - [DEFAULT] - Start read/write session
  - test: (boolean) Is this the test script? If so, we relax several
          sanity checks and don't load things from the cache.
          DEFAULT: false
  - timezone: (boolean) Set the time zone?
              DEFAULT: false
  - user_admin: (boolean) Set authentication to an admin user?
                DEFAULT: false
return Horde_Registry_Application The application object.

applicationFilePath() public method

Replace any %application% strings with the filesystem path to the application.
public applicationFilePath ( string $path, string $app = null ) : string
$path string The application string.
$app string The application being called.
return string The application file path.

applicationWebPath() public method

Replace any %application% strings with the web path to the application.
public applicationWebPath ( string $path, string $app = null ) : string
$path string The application string.
$app string The application being called.
return string The application web path.

call() public method

$method is a string consisting of "packagetype/methodname".
public call ( string $method, array $args = [] ) : mixed
$method string The method to call.
$args array Arguments to the method.
return mixed Return from method call.

callAppMethod() public method

Call a private Horde application method.
public callAppMethod ( string $app, string $call, array $options = [] ) : mixed
$app string The application name.
$call string The method to call.
$options array Additional options: - args: (array) Additional parameters to pass to the method. - check_missing: (boolean) If true, throws an Exception if method does not exist. Otherwise, will return null. - noperms: (boolean) If true, don't check the perms.
return mixed Various.

callByPackage() public method

Output the hook corresponding to the specific package named.
public callByPackage ( string $app, string $call, array $args = [], array $options = [] ) : mixed
$app string The application being called.
$call string The method to call.
$args array Arguments to the method.
$options array Additional options: - noperms: (boolean) If true, don't check the perms.
return mixed Return from application call.

checkExistingAuth() public method

Check existing auth for triggers that might invalidate it.
public checkExistingAuth ( string $app = 'horde' ) : boolean
$app string Check authentication for this app too.
return boolean Is existing auth valid?

clearAuth() public method

Clears any authentication tokens in the current session.
public clearAuth ( boolean $destroy = true )
$destroy boolean Destroy the session?

clearAuthApp() public method

Clears authentication tokens for a given application in the current session.
public clearAuthApp ( $app ) : boolean
return boolean If false, did not remove authentication token because the application is in control of Horde's auth.

convertUsername() public method

Converts an authentication username to a unique Horde username.
public convertUsername ( string $userId, boolean $toHorde ) : string
$userId string The username to convert.
$toHorde boolean If true, convert to a Horde username. If false, convert to the auth username.
return string The converted username.

currentProcessAuth() public method

Checks whether this process required authentication.
Since: 2.11.0
public currentProcessAuth ( ) : boolean
return boolean True if the current process required authentication.

downloadUrl() public method

Returns a URL to be used for downloading data.
public downloadUrl ( string $filename, array $params = [] ) : Horde_Url
$filename string The filename of the download data.
$params array Additional URL parameters needed.
return Horde_Url The download URL. This URL should be used as-is, since the filename MUST be the last parameter added to the URL.

get() public method

If that is not present, we return null.
public get ( string $parameter, string $app = null ) : string
$parameter string The configuration value to retrieve.
$app string The application to get the value for.
return string The requested parameter, or null if it is not set.

getApiInstance() public method

Retrieve an API object.
public getApiInstance ( string $app, string $type ) : Horde_Registry_Api | Horde_Registry_Application
$app string The application to load.
$type string Either 'application' or 'api'.
return Horde_Registry_Api | Horde_Registry_Application The API object.

getApp() public method

Return the current application - the app at the top of the application stack.
public getApp ( ) : string
return string The current application.

getAppDrivers() public method

Returns a list of available drivers for a library that are available in an application.
public getAppDrivers ( string $app, string $prefix ) : array
$app string The application name.
$prefix string The library prefix.
return array The list of available class names.

getAuth() public method

Returns the currently logged in user, if there is one.
public getAuth ( string $format = null ) : mixed
$format string The return format, defaults to the unique Horde ID. Alternative formats: - bare: (string) Horde ID without any domain information. EXAMPLE: [email protected] would be returned as 'foo'. - domain: (string) Domain of the Horde ID. EXAMPLE: [email protected] would be returned as 'example.com'. - original: (string) The username used to originally login to Horde.
return mixed The user ID or false if no user is logged in.

getAuthApps() public method

Returns the list of applications currently authenticated to.
Since: 2.12.0
public getAuthApps ( ) : array
return array List of authenticated applications.

getAuthCredential() public method

Returns the requested credential for the currently logged in user, if present.
public getAuthCredential ( string $credential = null, string $app = null ) : mixed
$credential string The credential to retrieve.
$app string The app to query. Defaults to Horde.
return mixed The requested credential, all credentials if $credential is null, or false if no user is logged in.

getAuthInfo() public method

Returns authentication metadata information.
Since: 2.12.0
public getAuthInfo ( ) : array
return array Authentication metadata: - authId: (string) The username used during the original auth. - browser: (string) The remote browser string. - change: (boolean) Is a password change requested? - credentials: (string) The 'auth_app' entry that contains the Horde credentials. - remoteAddr: (string) The remote IP address of the user. - timestamp: (integer) The login time. - userId: (string) The unique Horde username.

getEmailCharset() public method

Returns the charset to use for outgoing emails.
public getEmailCharset ( ) : string
return string The preferred charset for outgoing mails based on the user's preferences and the current language.

getInitialPage() public method

Query the initial page for an application - the webroot, if there is no initial_page set, and the initial_page, if it is set.
public getInitialPage ( string $app = null ) : string
$app string The name of the application.
return string URL pointing to the initial page of the application.

getLanguageCharset() public method

Returns the charset for the current language.
public getLanguageCharset ( ) : string
return string The character set that should be used with the current locale settings.

getLogoutUrl() public method

If no reason/msg is passed in, uses the current global authentication error message.
public getLogoutUrl ( array $options = [] ) : Horde_Url
$options array Additional options: - app: (string) Authenticate to this application DEFAULT: Horde - msg: (string) If reason is Horde_Auth::REASON_MESSAGE, the message to display to the user. DEFAULT: None - params: (array) Additional params to add to the URL (not allowed: 'app', 'horde_logout_token', 'msg', 'reason', 'url'). DEFAULT: None - reason: (integer) The reason for logout DEFAULT: None
return Horde_Url The formatted URL.

getVersion() public method

Return the version string for a given application.
public getVersion ( string $app = null, boolean $number = false ) : string
$app string The application to get the value for.
$number boolean Return the raw version number, suitable for comparison purposes.
return string The version string for the application.

getView() public method

Get current view.
public getView ( ) : integer
return integer The view type.

hasFeature() public method

Does the application have the queried feature?
public hasFeature ( string $id, string $app = null ) : boolean
$id string Feature ID.
$app string The application to check (defaults to current app).
return boolean True if the application has the feature.

hasInterface() public method

Determine if an interface is implemented by an active application.
public hasInterface ( string $interface ) : mixed
$interface string The interface to check for.
return mixed The application implementing $interface if we have it, false if the interface is not implemented.

hasMethod() public method

Determine if a method has been registered with the registry.
public hasMethod ( string $method, string $app = null ) : mixed
$method string The full name of the method to check for.
$app string Only check this application.
return mixed The application implementing $method if we have it, false if the method doesn't exist.

hasPermission() public method

Check permissions on an application.
public hasPermission ( string $app, integer $perms = Horde_Perms::READ, array $params = [] ) : boolean
$app string The name of the application
$perms integer The permission level to check for.
$params array Additional options: - notransparent: (boolean) Do not attempt transparent authentication. DEFAULT: false
return boolean Whether access is allowed.

hasView() public method

Does the given application have the queried view?
public hasView ( integer $view, string $app = null ) : boolean
$view integer The view type (VIEW_* constant).
$app string The application to check (defaults to current app).
return boolean True if the view is available in the application.

importConfig() public method

Reads the configuration values for the given application and imports them into the global $conf variable.
public importConfig ( string $app )
$app string The application name.

isAdmin() public method

Is a user an administrator?
public isAdmin ( array $options = [] ) : boolean
$options array Options: - permission: (string) Allow users with this permission admin access in the current context. - permlevel: (integer) The level of permissions to check for. Defaults to Horde_Perms::EDIT. - user: (string) The user to check. Defaults to self::getAuth().
return boolean Whether or not this is an admin user.

isAuthenticated() public method

Checks if there is a session with valid auth information. If there isn't, but the configured Auth driver supports transparent authentication, then we try that.
public isAuthenticated ( array $opts = [] ) : boolean
$opts array Additional options: - app: (string) Check authentication for this app. DEFAULT: Checks horde-wide authentication. - notransparent: (boolean) Do not attempt transparent authentication. DEFAULT: false
return boolean Whether or not the user is authenticated.

isInactive() public method

Is the given application inactive?
public isInactive ( string $app ) : boolean
$app string The application to check.
return boolean True if inactive.

isTest() public method

Is the registry in 'test' mode?
Since: 2.12.0
public isTest ( ) : boolean
return boolean True if in testing mode.

linkByPackage() public method

Returns the link corresponding to the specific package named.
public linkByPackage ( string $app, string $call, array $args = [], mixed $extra = '' ) : string
$app string The application being called.
$call string The method to link to.
$args array Arguments to the method.
$extra mixed Extra, non-standard arguments to the method.
return string The link for that method.

listAPIs() public method

Returns all available registry APIs.
public listAPIs ( ) : array
return array The API list.

listAllApps() public method

Return a list of all applications, ignoring permissions.
public listAllApps ( ) : array
return array List of all apps registered with Horde.

listApps() public method

Return a list of the installed and registered applications.
public listApps ( array $filter = null, boolean $assoc = false, integer $perms = Horde_Perms::SHOW ) : array
$filter array An array of the statuses that should be returned. Defaults to non-hidden.
$assoc boolean Return hash with app names as keys and config parameters as values?
$perms integer The permission level to check for in the list. If null, skips permission check.
return array List of apps registered with Horde. If no applications are defined returns an empty array.

listMethods() public method

Returns all of the available registry methods, or alternately only those for a specified API.
public listMethods ( string $api = null ) : array
$api string Defines the API for which the methods shall be returned. If null, returns all methods.
return array The method list.

loadConfigFile() public method

This call is cached (a config file is only loaded once, regardless of the $vars value).
Since: 2.12.0
public loadConfigFile ( string $conf_file, mixed $vars = null, string $app = null ) : Horde_Registry_Loadconfig
$conf_file string Configuration file name.
$vars mixed List of config variables to load.
$app string Application.
return Horde_Registry_Loadconfig The config object.

loadPrefs() public method

$app will be the active application after calling this function.
public loadPrefs ( string $app = null )
$app string The name of the application.

passwordChangeRequested() public method

Return whether the authentication backend requested a password change.
public passwordChangeRequested ( ) : boolean
return boolean Whether the backend requested a password change.

popApp() public method

Remove the current app from the application stack, setting the current app to whichever app was current before this one took over.
public popApp ( ) : string
return string The name of the application that was popped.

preferredLang() public method

Selects the most preferred language for the current client session.
public preferredLang ( string $lang = null ) : string
$lang string Force to use this language.
return string The selected language abbreviation.

pushApp() public method

pushApp() also reads the application's configuration file and sets up its global $conf hash.
public pushApp ( string $app, array $options = [] ) : boolean
$app string The name of the application to push.
$options array Additional options: - check_perms: (boolean) Make sure that the current user has permissions to the application being loaded. Should ONLY be disabled by system scripts (cron jobs, etc.) and scripts that handle login. DEFAULT: true - logintasks: (boolean) Perform login tasks? Only performed if 'check_perms' is also true. System tasks are always peformed if the user is authorized. DEFAULT: false - notransparent: (boolean) Do not attempt transparent authentication. DEFAULT: false
return boolean Whether or not the _appStack was modified.

rebuild() public method

Rebuild the registry configuration.
public rebuild ( )

remoteHost() public method

Returns information about the remote host.
Since: 2.17.0
public remoteHost ( ) : object
return object An object with the following properties:
  - addr: (string) Remote IP address.
  - host: (string) Remote hostname (if resolvable; otherwise, this value
          is identical to 'addr').
  - proxy: (boolean) True if this user is connecting through a proxy.

removeUser() public method

Removes a user from the authentication backend and calls all applications' removeUserData API methods.
public removeUser ( string $userId )
$userId string The userId to delete.

removeUserData() public method

Removes user's application data.
public removeUserData ( string $user, string $app = null )
$user string The user ID to delete.
$app string If set, only removes data from this application. By default, removes data from all apps.

setAuth() public method

If a user name hook was defined in the configuration, it gets applied to the $userId at this point.
public setAuth ( string $authId, array $credentials, array $options = [] )
$authId string The userId that has been authorized.
$credentials array The credentials of the user.
$options array Additional options: - app: (string) The app to set authentication credentials for. DEFAULT: 'horde' - change: (boolean) Whether to request that the user change their password. DEFAULT: No - language: (string) The preferred language. DEFAULT: null - no_convert: (boolean) Don't convert the user name with the authusername hook. DEFAULT: false

setAuthCredential() public method

Sets the requested credential for the currently logged in user.
public setAuthCredential ( mixed $credential, string $value = null, string $app = null )
$credential mixed The credential to set. If an array, overwrites the current credentials array.
$value string The value to set the credential to. If $credential is an array, this value is ignored.
$app string The app to update. Defaults to Horde.

setAuthenticationSetting() public method

(Re)set the authentication parameter. Useful for requests, such as Rpc requests where we actually don't perform authentication until later in the request, but still need Horde bootstrapped early in the request. Also clears the local app/api cache since applications will probably already have been initialized during Notification polling.
See also: appInit()
public setAuthenticationSetting ( string $authentication )
$authentication string The authentication setting.

setLanguage() public method

Sets the language.
public setLanguage ( string $lang = null ) : string
$lang string The language abbreviation.
return string The current language (since 2.5.0).

setLanguageEnvironment() public method

When setting the language, the gettext catalogs have to be reloaded too, charsets have to be updated etc. This method takes care of all this.
public setLanguageEnvironment ( string $lang = null, string $app = null )
$lang string The new language.
$app string The application for reloading the gettext catalog. Uses current application if null.

setTextdomain() public method

Sets the gettext domain.
public setTextdomain ( string $app, string $directory )
$app string The application name.
$directory string The directory where the application's LC_MESSAGES directory resides.

setTimeZone() public method

Sets the current timezone, if available.
public setTimeZone ( )

setView() public method

Set current view.
public setView ( integer $view = self::VIEW_BASIC )
$view integer The view type.

showService() public method

TODO
public showService ( string $type ) : boolean
$type string The type of link.
The following must be defined in Horde's menu config, or else they
won't be displayed in the menu:
'help', 'problem', 'logout', 'login', 'prefs'
return boolean True if the link is to be shown.

shutdown() public method

Events to do on shutdown.
public shutdown ( )

Property Details

$_apiList protected_oe property

The list of APIs.
protected array $_apiList
return array

$_appStack protected_oe property

Stack of in-use applications.
protected array $_appStack
return array

$_appsInit protected_oe property

The list of applications initialized during this access.
protected array $_appsInit
return array

$_args protected_oe property

The arguments that have been passed when instantiating the registry.
protected array $_args
return array

$_cache protected_oe property

Internal cached data.
protected array $_cache
return array

$_interfaces protected_oe property

Interfaces list.
protected array $_interfaces
return array

$_regmtime protected_oe property

The last modified time of the newest modified registry file.
protected int $_regmtime
return integer

$applications public_oe property

Hash storing information on each registry-aware application.
public array $applications
return array

$authException public_oe property

Original authentication exception. Set if 'fallback' auth is used, and authentication fails.
Since: 2.11.0
public Exception $authException
return Exception

$hordeInit public_oe property

A flag that is set once the basic horde application has been minimally configured.
public bool $hordeInit
return boolean

$initialApp public_oe property

The application that called appInit().
public string $initialApp
return string

$nlsconfig public_oe property

NLS configuration.
public Horde_Registry_Nlsconfig $nlsconfig
return Horde_Registry_Nlsconfig

$vhost public_oe property

The current virtual host configuration file.
Since: 2.12.0
public string $vhost
return string