SESSION_NONE
SESSION_NONE
The registry provides a set of methods for communication between Horde applications and keeping track of application configuration information.
$nlsconfig : \Horde_Registry_Nlsconfig
NLS configuration.
appInit(string $app, array $args = array()) : \Horde_Registry_Application
Application bootstrap initialization.
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
string | $app | The application to initialize. |
array | $args | 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 |
The application object.
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.
string | $authentication | The authentication setting. |
getApiInstance(string $app, string $type) : \Horde_Registry_Api|\Horde_Registry_Application
Retrieve an API object.
string | $app | The application to load. |
string | $type | Either 'application' or 'api'. |
The API object.
listApps(array $filter = null, boolean $assoc = false, integer $perms = \Horde_Perms::SHOW) : array
Return a list of the installed and registered applications.
array | $filter | An array of the statuses that should be returned. Defaults to non-hidden. |
boolean | $assoc | Return hash with app names as keys and config parameters as values? |
integer | $perms | The permission level to check for in the list. If null, skips permission check. |
List of apps registered with Horde. If no applications are defined returns an empty array.
hasMethod(string $method, string $app = null) : mixed
Determine if a method has been registered with the registry.
string | $method | The full name of the method to check for. |
string | $app | Only check this application. |
The application implementing $method if we have it, false if the method doesn't exist.
hasLink(string $method, string $app = null) : mixed
Determine if a link has been registered with the registry.
string | $method | The full name of the link method to check for. |
string | $app | Only check this application. |
The application implementing $method if we have it, false if the link method doesn't exist.
call(string $method, array $args = array()) : mixed
Return the hook corresponding to the default package that provides the functionality requested by the $method parameter.
$method is a string consisting of "packagetype/methodname".
string | $method | The method to call. |
array | $args | Arguments to the method. |
Return from method call.
callByPackage(string $app, string $call, array $args = array(), array $options = array()) : mixed
Output the hook corresponding to the specific package named.
string | $app | The application being called. |
string | $call | The method to call. |
array | $args | Arguments to the method. |
array | $options | Additional options:
|
Return from application call.
callAppMethod(string $app, string $call, array $options = array()) : mixed
Call a private Horde application method.
string | $app | The application name. |
string | $call | The method to call. |
array | $options | Additional options:
|
Application methods should throw this if there is a fatal error.
Various.
link(string $method, array $args = array(), mixed $extra = '') : string
Returns the link corresponding to the default package that provides the functionality requested by the $method parameter.
string | $method | The method to link to, consisting of "packagetype/methodname". |
array | $args | Arguments to the method. |
mixed | $extra | Extra, non-standard arguments to the method. |
The link for that method.
linkByPackage(string $app, string $call, array $args = array(), mixed $extra = '') : string
Returns the link corresponding to the specific package named.
string | $app | The application being called. |
string | $call | The method to link to. |
array | $args | Arguments to the method. |
mixed | $extra | Extra, non-standard arguments to the method. |
The link for that method.
applicationFilePath(string $path, string $app = null) : string
Replace any %application% strings with the filesystem path to the application.
string | $path | The application string. |
string | $app | The application being called. |
The application file path.
getServiceLink(string $type, string $app = null, boolean $full = false) : \Horde_Url
Returns the URL to access a Horde service.
string | $type | The service to display:
|
string | $app | The name of the current Horde application. |
boolean | $full | Return a full url? @since 2.4.0 |
The link.
pushApp(string $app, array $options = array()) : 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.
pushApp() also reads the application's configuration file and sets up its global $conf hash.
string | $app | The name of the application to push. |
array | $options | Additional options:
|
Whether or not the _appStack was modified.
hasPermission(string $app, integer $perms = \Horde_Perms::READ, array $params = array()) : boolean
Check permissions on an application.
string | $app | The name of the application |
integer | $perms | The permission level to check for. |
array | $params | Additional options:
|
Whether access is allowed.
loadPrefs(string $app = null)
Loads the preferences for the current user for the current application and imports them into the global $prefs variable.
$app will be the active application after calling this function.
string | $app | The name of the application. |
loadConfigFile(string $conf_file, mixed $vars = null, string $app = null) : \Horde_Registry_Loadconfig
Load a configuration file from a Horde application's config directory.
This call is cached (a config file is only loaded once, regardless of the $vars value).
string | $conf_file | Configuration file name. |
mixed | $vars | List of config variables to load. |
string | $app | Application. |
The config object.
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.
If that is not present, we return null.
string | $parameter | The configuration value to retrieve. |
string | $app | The application to get the value for. |
The requested parameter, or null if it is not set.
getVersion(string $app = null, boolean $number = false) : string
Return the version string for a given application.
string | $app | The application to get the value for. |
boolean | $number | Return the raw version number, suitable for comparison purposes. |
The version string for the application.
hasView(integer $view, string $app = null) : boolean
Does the given application have the queried view?
integer | $view | The view type (VIEW_* constant). |
string | $app | The application to check (defaults to current app). |
True if the view is available in the application.
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.
string | $app | The name of the application. |
URL pointing to the initial page of the application.
isAdmin(array $options = array()) : boolean
Is a user an administrator?
array | $options | Options:
|
Whether or not this is an admin user.
isAuthenticated(array $opts = array()) : 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.
array | $opts | Additional options:
|
Whether or not the user is authenticated.
getLogoutUrl(array $options = array()) : \Horde_Url
Returns a URL to the login screen, adding the necessary logout parameters.
If no reason/msg is passed in, uses the current global authentication error message.
array | $options | Additional options:
|
The formatted URL.
downloadUrl(string $filename, array $params = array()) : \Horde_Url
Returns a URL to be used for downloading data.
string | $filename | The filename of the download data. |
array | $params | Additional URL parameters needed. |
The download URL. This URL should be used as-is, since the filename MUST be the last parameter added to the URL.
convertUsername(string $userId, boolean $toHorde) : string
Converts an authentication username to a unique Horde username.
string | $userId | The username to convert. |
boolean | $toHorde | If true, convert to a Horde username. If false, convert to the auth username. |
The converted username.
getAuth(string $format = null) : mixed
Returns the currently logged in user, if there is one.
string | $format | The return format, defaults to the unique Horde ID. Alternative formats:
|
The user ID or false if no user is logged in.
getAuthCredential(string $credential = null, string $app = null) : mixed
Returns the requested credential for the currently logged in user, if present.
string | $credential | The credential to retrieve. |
string | $app | The app to query. Defaults to Horde. |
The requested credential, all credentials if $credential is null, or false if no user is logged in.
setAuthCredential(mixed $credential, string $value = null, string $app = null)
Sets the requested credential for the currently logged in user.
mixed | $credential | The credential to set. If an array, overwrites the current credentials array. |
string | $value | The value to set the credential to. If $credential is an array, this value is ignored. |
string | $app | The app to update. Defaults to Horde. |
remoteHost() : object
Returns information about the remote host.
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.
setAuth(string $authId, array $credentials, array $options = array())
Sets data in the session saying that authorization has succeeded, note which userId was authorized, and note when the login took place.
If a user name hook was defined in the configuration, it gets applied to the $userId at this point.
string | $authId | The userId that has been authorized. |
array | $credentials | The credentials of the user. |
array | $options | Additional options:
|
getAuthInfo() : array
Returns authentication metadata information.
Authentication metadata:
setLanguageEnvironment(string $lang = null, string $app = null)
Sets the language and reloads the whole NLS environment.
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.
string | $lang | The new language. |
string | $app | The application for reloading the gettext catalog. Uses current application if null. |
_loadApi(string $app) : \Horde_Registry_Api
Load an application's API object.
string | $app | The application to load. |
The API object, or null if not available.
_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.
string | $language | The language code to map. |
The mapped language code.