Overview

Packages

  • Auth
  • Core
  • Horde
    • Imsp
  • None
  • Notification

Classes

  • Horde
  • Horde_Config
  • Horde_Config_Form
  • Horde_Core_ActiveSync_Connector
  • Horde_Core_ActiveSync_Driver
  • Horde_Core_Ajax_Application
  • Horde_Core_Ajax_Imple
  • Horde_Core_Ajax_Imple_AutoCompleter
  • Horde_Core_Ajax_Imple_Geocoder_Geonames
  • Horde_Core_Ajax_Imple_SpellChecker
  • Horde_Core_Alarm_Handler_Notify
  • Horde_Core_Auth_Application
  • Horde_Core_Auth_Composite
  • Horde_Core_Auth_Ldap
  • Horde_Core_Auth_Msad
  • Horde_Core_Auth_Shibboleth
  • Horde_Core_Auth_Signup_Base
  • Horde_Core_Auth_Signup_Form
  • Horde_Core_Auth_Signup_Null
  • Horde_Core_Auth_Signup_Sql
  • Horde_Core_Auth_Signup_SqlObject
  • Horde_Core_Autoloader_Callback_Mime
  • Horde_Core_Autoloader_Callback_Nls
  • Horde_Core_Block
  • Horde_Core_Block_Collection
  • Horde_Core_Block_Layout
  • Horde_Core_Block_Layout_Manager
  • Horde_Core_Block_Layout_View
  • Horde_Core_Block_Upgrade
  • Horde_Core_Browser
  • Horde_Core_Bundle
  • Horde_Core_Cli
  • Horde_Core_Controller_NotFound
  • Horde_Core_Controller_RequestConfiguration
  • Horde_Core_Controller_RequestMapper
  • Horde_Core_Controller_SettingsFinder
  • Horde_Core_Db_Migration
  • Horde_Core_Factory_ActiveSyncBackend
  • Horde_Core_Factory_ActiveSyncServer
  • Horde_Core_Factory_ActiveSyncState
  • Horde_Core_Factory_Ajax
  • Horde_Core_Factory_Alarm
  • Horde_Core_Factory_Auth
  • Horde_Core_Factory_AuthSignup
  • Horde_Core_Factory_Base
  • Horde_Core_Factory_BlockCollection
  • Horde_Core_Factory_Browser
  • Horde_Core_Factory_Cache
  • Horde_Core_Factory_Crypt
  • Horde_Core_Factory_Data
  • Horde_Core_Factory_Db
  • Horde_Core_Factory_DbBase
  • Horde_Core_Factory_DbPear
  • Horde_Core_Factory_Dns
  • Horde_Core_Factory_Editor
  • Horde_Core_Factory_Facebook
  • Horde_Core_Factory_Group
  • Horde_Core_Factory_History
  • Horde_Core_Factory_HttpClient
  • Horde_Core_Factory_Identity
  • Horde_Core_Factory_Image
  • Horde_Core_Factory_Imple
  • Horde_Core_Factory_Imsp
  • Horde_Core_Factory_ImspAuth
  • Horde_Core_Factory_Injector
  • Horde_Core_Factory_KolabServer
  • Horde_Core_Factory_KolabSession
  • Horde_Core_Factory_KolabStorage
  • Horde_Core_Factory_Ldap
  • Horde_Core_Factory_Lock
  • Horde_Core_Factory_Logger
  • Horde_Core_Factory_LoginTasks
  • Horde_Core_Factory_Mail
  • Horde_Core_Factory_Mapper
  • Horde_Core_Factory_Matcher
  • Horde_Core_Factory_Memcache
  • Horde_Core_Factory_MimeViewer
  • Horde_Core_Factory_Notification
  • Horde_Core_Factory_Perms
  • Horde_Core_Factory_PermsCore
  • Horde_Core_Factory_Prefs
  • Horde_Core_Factory_Request
  • Horde_Core_Factory_Secret
  • Horde_Core_Factory_SessionHandler
  • Horde_Core_Factory_Share
  • Horde_Core_Factory_ShareBase
  • Horde_Core_Factory_Template
  • Horde_Core_Factory_TextFilter
  • Horde_Core_Factory_ThemesCache
  • Horde_Core_Factory_Token
  • Horde_Core_Factory_Tree
  • Horde_Core_Factory_Twitter
  • Horde_Core_Factory_UrlShortener
  • Horde_Core_Factory_Vfs
  • Horde_Core_Factory_View
  • Horde_Core_Factory_Weather
  • Horde_Core_Group_Ldap
  • Horde_Core_Log_Logger
  • Horde_Core_LoginTasks
  • Horde_Core_LoginTasks_Backend_Horde
  • Horde_Core_LoginTasks_SystemTask_Upgrade
  • Horde_Core_Mime_Viewer_Syntaxhighlighter
  • Horde_Core_Mime_Viewer_Vcard
  • Horde_Core_Notification_Event_Status
  • Horde_Core_Notification_Handler_Decorator_Hordelog
  • Horde_Core_Notification_Storage_Session
  • Horde_Core_Perms
  • Horde_Core_Perms_Ui
  • Horde_Core_Prefs_Cache_Session
  • Horde_Core_Prefs_Identity
  • Horde_Core_Prefs_Storage_Configuration
  • Horde_Core_Prefs_Storage_Hooks
  • Horde_Core_Prefs_Storage_Upgrade
  • Horde_Core_Prefs_Ui
  • Horde_Core_Prefs_Ui_Widgets
  • Horde_Core_Share_Driver
  • Horde_Core_Share_FactoryCallback
  • Horde_Core_Sidebar
  • Horde_Core_Text_Filter_Bbcode
  • Horde_Core_Text_Filter_Emails
  • Horde_Core_Text_Filter_Emoticons
  • Horde_Core_Text_Filter_Highlightquotes
  • Horde_Core_Translation
  • Horde_Core_Tree_Html
  • Horde_Core_Tree_Javascript
  • Horde_Core_Tree_Simplehtml
  • Horde_Core_Ui_FlagImage
  • Horde_Core_Ui_JsCalendar
  • Horde_Core_Ui_Language
  • Horde_Core_Ui_Layout
  • Horde_Core_Ui_ModalFormRenderer
  • Horde_Core_Ui_Pager
  • Horde_Core_Ui_Tabs
  • Horde_Core_Ui_TagCloud
  • Horde_Core_Ui_VarRenderer
  • Horde_Core_Ui_VarRenderer_Html
  • Horde_Core_Ui_VarRenderer_TablesetHtml
  • Horde_Core_Ui_Widget
  • Horde_ErrorHandler
  • Horde_Help
  • Horde_Menu
  • Horde_Registry
  • Horde_Registry_Api
  • Horde_Registry_Application
  • Horde_Registry_Caller
  • Horde_Registry_Nlsconfig
  • Horde_Script_Files
  • Horde_Session
  • Horde_Session_Null
  • Horde_Themes
  • Horde_Themes_Cache
  • Horde_Themes_Css
  • Horde_Themes_Element
  • Horde_Themes_Image
  • Horde_Themes_Sound

Exceptions

  • Horde_Exception_HookNotSet
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Core_Auth_Application

The Horde_Core_Auth_Application class provides application-specific authentication built on top of the horde/Auth API.

Copyright 2002-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://opensource.org/licenses/lgpl-2.1.php

Horde_Auth_Base
Extended by Horde_Core_Auth_Application
Package: Core
Category: Horde
License: LGPL
Author: Chuck Hagenbuch chuck@horde.org
Author: Michael Slusarz slusarz@horde.org
Located at Horde/Core/Auth/Application.php
Methods summary
public
# __construct( array $params = array() )

Constructor.

Constructor.

Parameters

$params
Required parameters: <pre><span class="php-quote">'app'</span> - (string) The application which is providing authentication. <span class="php-quote">'base'</span> - (Horde_Auth_Base) The base Horde_Auth driver. Only needed <span class="php-keyword1">if</span> <span class="php-quote">'app'</span> is <span class="php-quote">'horde'</span>.</pre>

Throws

InvalidArgumentException
public boolean
# authenticate( string $userId, array $credentials, boolean $login = true )

Finds out if a set of login credentials are valid, and if requested, mark the user as logged in in the current session.

Finds out if a set of login credentials are valid, and if requested, mark the user as logged in in the current session.

Parameters

$userId
The user ID to check.
$credentials
The credentials to check.
$login
<p>Whether to log the user in. If false, we'll only test the credentials and won't modify the current session. Defaults to true.</p>

Returns

boolean
Whether or not the credentials are valid.
public boolean
# validateAuth( )

Checks for triggers that may invalidate the current auth. These triggers are independent of the credentials.

Checks for triggers that may invalidate the current auth. These triggers are independent of the credentials.

Returns

boolean
True if the results of authenticate() are still valid.
public
# addUser( string $userId, array $credentials )

Add a set of authentication credentials.

Add a set of authentication credentials.

Parameters

$userId
The user ID to add.
$credentials
The credentials to use.

Throws

Horde_Auth_Exception
public
# lockUser( string $userId, integer $time = 0 )

Locks a user indefinitely or for a specified time

Locks a user indefinitely or for a specified time

Parameters

$userId
The userId to lock.
$time
The duration in seconds, 0 = permanent

Throws

Horde_Auth_Exception
public
# unlockUser( string $userId, boolean $resetBadLogins = false )

Unlocks a user and optionally resets bad login count

Unlocks a user and optionally resets bad login count

Parameters

$userId
The userId to unlock.
$resetBadLogins
Reset bad login counter, default no.

Throws

Horde_Auth_Exception
public
# isLocked( string $userId, boolean $show_details = false )

Checks if $userId is currently locked.

Checks if $userId is currently locked.

Parameters

$userId
The userId to check.
$show_details
Toggle array format with timeout.

Throws

Horde_Auth_Exception
public
# updateUser( string $oldID, string $newID, array $credentials )

Update a set of authentication credentials.

Update a set of authentication credentials.

Parameters

$oldID
The old user ID.
$newID
The new user ID.
$credentials
The new credentials

Throws

Horde_Auth_Exception
public
# removeUser( string $userId )

Delete a set of authentication credentials.

Delete a set of authentication credentials.

Parameters

$userId
The user ID to delete.

Throws

Horde_Auth_Exception
public array
# listUsers( )

List all users in the system.

List all users in the system.

Returns

array
The array of user IDs.

Throws

Horde_Auth_Exception
public boolean
# exists( string $userId )

Checks if a user ID exists in the system.

Checks if a user ID exists in the system.

Parameters

$userId
User ID to check.

Returns

boolean
Whether or not the user ID already exists.
public boolean
# transparent( )

Automatic authentication.

Automatic authentication.

Returns

boolean
Whether or not the client is allowed.

Throws

Horde_Auth_Exception
public string
# resetPassword( string $userId )

Reset a user's password. Used for example when the user does not remember the existing password.

Reset a user's password. Used for example when the user does not remember the existing password.

Parameters

$userId
The user ID for which to reset the password.

Returns

string
The new password on success.

Throws

Horde_Auth_Exception
public boolean
# hasCapability( string $capability )

Queries the current driver to find out if it supports the given capability.

Queries the current driver to find out if it supports the given capability.

Parameters

$capability
The capability to test for.

Returns

boolean
Whether or not the capability is supported.
public string
# getParam( string $param )

Returns the named parameter for the current auth driver.

Returns the named parameter for the current auth driver.

Parameters

$param
The parameter to fetch.

Returns

string
The parameter's value, or null if it doesn't exist.
public mixed
# getCredential( mixed $name = null )

Retrieve internal credential value(s).

Retrieve internal credential value(s).

Parameters

$name
<p>The credential value to get. If null, will return the entire credential list. Valid names:</p> <pre><span class="php-quote">'change'</span> - (boolean) <span class="php-keyword1">Do</span> credentials need to be changed? <span class="php-quote">'credentials'</span> - (<span class="php-keyword1">array</span>) The credentials needed to authenticate. <span class="php-quote">'expire'</span> - (integer) UNIX timestamp of the credential expiration <span class="php-keyword2">date</span>. <span class="php-quote">'userId'</span> - (string) The user ID.</pre>

Returns

mixed

Return the credential information, or null if the credential doesn't exist.

public
# setCredential( string $type, mixed $value )

Set internal credential value.

Set internal credential value.

Parameters

$type
$name The credential name to set.
$value
<p>The credential value to set. See getCredential() for the list of valid credentials/types.</p>
public
# setError( string $type, string $msg = null )

Sets the error message for an invalid authentication.

Sets the error message for an invalid authentication.

Parameters

$type
The type of error (Horde_Auth::REASON_* constant).
$msg
<p>The error message/reason for invalid authentication.</p>
public mixed
# getError( boolean $msg = false )

Returns the error type or message for an invalid authentication.

Returns the error type or message for an invalid authentication.

Parameters

$msg
If true, returns the message string (if set).

Returns

mixed

Error type, error message (if $msg is true) or false if entry doesn't exist.

public array
# getLoginParams( )

Returns information on what login parameters to display on the login screen.

Returns information on what login parameters to display on the login screen.

Returns

array
An array with the following keys:
'js_code' - (array) A list of javascript statements to be included via
            Horde::addInlineScript().
'js_files' - (array) A list of javascript files to be included via
             Horde::addScriptFile().
'params' - (array) A list of parameters to display on the login screen.
           Each entry is an array with the following entries:
           'label' - (string) The label of the entry.
           'type' - (string) 'select', 'text', or 'password'.
           'value' - (mixed) If type is 'text' or 'password', the
                     text to insert into the field by default. If type
                     is 'select', an array with they keys as the
                     option values and an array with the following keys:
                     'hidden' - (boolean) If true, the option will be
                                hidden.
                     'name' - (string) The option label.
                     'selected' - (boolean) If true, will be selected
                                  by default.

Throws

Horde_Exception
public boolean
# requireAuth( )

Indicate whether the application requires authentication.

Indicate whether the application requires authentication.

Returns

boolean
True if application requires authentication.
public array
# runHook( string $userId, array $credentials, string $type, string $method = null )

Runs the pre/post-authenticate hook and parses the result.

Runs the pre/post-authenticate hook and parses the result.

Parameters

$userId
The userId who has been authorized.
$credentials
The credentials of the user.
$type
<p>Either 'preauthenticate' or 'postauthenticate'.</p>
$method
<p>The triggering method (preauthenticate only). Either 'authenticate' or 'transparent'.</p>

Returns

array
Two element array, $userId and $credentials.

Throws

Horde_Auth_Exception
Constants summary
integer REASON_BROWSER

Authentication failure reasons (additions to Horde_Auth:: reasons).

Authentication failure reasons (additions to Horde_Auth:: reasons).

REASON_BROWSER - A browser change was detected
REASON_SESSIONIP - Logout due to change of IP address during session
# 100
integer REASON_SESSIONIP
# 101
API documentation generated by ApiGen