ILIAS
Release_4_4_x_branch Revision 61816
|
Public Member Functions | |
Auth ($storageDriver, $options= '', $loginFunction= '', $showLogin=true) | |
Constructor. | |
& | applyAuthOptions (&$options) |
Set the Auth options. | |
_loadStorage () | |
Load Storage Driver if not already loaded. | |
assignData () | |
Assign data from login form to internal values. | |
start () | |
Start new auth session. | |
login () | |
Login function. | |
setExpire ($time, $add=false) | |
Set the maximum expire time. | |
setIdle ($time, $add=false) | |
Set the maximum idle time. | |
setSessionName ($name= 'session') | |
Set name of the session to a customized value. | |
setShowLogin ($showLogin=true) | |
Should the login form be displayed if neccessary? | |
setAllowLogin ($allowLogin=true) | |
Should the login form be displayed if neccessary? | |
setCheckAuthCallback ($checkAuthCallback) | |
Register a callback function to be called whenever the validity of the login is checked The function will receive two parameters, the username and a reference to the auth object. | |
setLoginCallback ($loginCallback) | |
Register a callback function to be called on user login. | |
setFailedLoginCallback ($loginFailedCallback) | |
Register a callback function to be called on failed user login. | |
setLogoutCallback ($logoutCallback) | |
Register a callback function to be called on user logout. | |
setAuthData ($name, $value, $overwrite=true) | |
Register additional information that is to be stored in the session. | |
getAuthData ($name=null) | |
Get additional information that is stored in the session. | |
setAuth ($username) | |
Register variable in a session telling that the user has logged in successfully. | |
setAdvancedSecurity ($flag=true) | |
Enables advanced security checks. | |
checkAuth () | |
Checks if there is a session with valid auth information. | |
getAuth () | |
Has the user been authenticated? | |
logout () | |
Logout function. | |
updateIdle () | |
Update the idletime. | |
getUsername () | |
Get the username. | |
getStatus () | |
Get the current status. | |
getPostUsernameField () | |
Gets the post varible used for the username. | |
getPostPasswordField () | |
Gets the post varible used for the username. | |
sessionValidThru () | |
Returns the time up to the session is valid. | |
listUsers () | |
List all users that are currently available in the storage container. | |
addUser ($username, $password, $additional= '') | |
Add user to the storage container. | |
removeUser ($username) | |
Remove user from the storage container. | |
changePassword ($username, $password) | |
Change password for user in the storage container. | |
log ($message, $level=AUTH_LOG_DEBUG) | |
Log a message from the Auth system. | |
_loadLogger () | |
Load Log object if not already loaded. | |
attachLogObserver (&$observer) | |
Attach an Observer to the Auth Log Source. | |
_isAdvancedSecurityEnabled ($feature=null) | |
Is advanced security enabled? | |
Public Member Functions inherited from ilAuthBase | |
supportsRedirects () | |
Returns true, if the current auth mode allows redirects to e.g the login screen, public section ... | |
getContainer () | |
Get container object. | |
getExceededUserName () |
Static Public Member Functions | |
& | _factory ($driver, $options= '') |
Return a storage driver based on $driver and $options. | |
staticCheckAuth ($options=null) | |
Statically checks if there is a session with valid auth information. |
Data Fields | |
$expire = 0 | |
$expired = false | |
$idle = 0 | |
$idled = false | |
$storage = '' | |
$loginFunction = '' | |
$showLogin = true | |
$allowLogin = true | |
$status = '' | |
$username = '' | |
$password = '' | |
$checkAuthCallback = '' | |
$loginCallback = '' | |
$loginFailedCallback = '' | |
$logoutCallback = '' | |
$_sessionName = '_authsession' | |
$version = "@version@" | |
$advancedsecurity = false | |
$_postUsername = 'username' | |
$_postPassword = 'password' | |
$session | |
$server | |
$post | |
$cookie | |
$authdata | |
$authChecks = 0 | |
$logger = null | |
$enableLogging = false | |
$regenerateSessionId = false |
Additional Inherited Members | |
Protected Member Functions inherited from ilAuthBase | |
initAuth () | |
Init auth object Enable logging, set callbacks... | |
loginObserver ($a_username, $a_auth) | |
Called after successful login. | |
failedLoginObserver ($a_username, $a_auth) | |
Called after failed login. | |
checkAuthObserver ($a_username, $a_auth) | |
Called after each check auth request. | |
logoutObserver ($a_username, $a_auth) | |
Called after logout. | |
Protected Attributes inherited from ilAuthBase | |
$sub_status = null | |
$exceeded_user_name |
|
static |
Return a storage driver based on $driver and $options.
string | $driver | Type of storage class to return |
string | $options | Optional parameters for the storage class |
Definition at line 467 of file Auth.php.
References $options.
Referenced by _loadStorage().
Auth::_isAdvancedSecurityEnabled | ( | $feature = null | ) |
Is advanced security enabled?
Pass one of the Advanced Security constants as the first parameter to check if that advanced security check is enabled.
integer |
Definition at line 1333 of file Auth.php.
References $advancedsecurity.
Referenced by checkAuth().
Auth::_loadLogger | ( | ) |
Load Log object if not already loaded.
Suspend logger instantiation to make Auth lighter to use for calls which do not require logging
Definition at line 1288 of file Auth.php.
References AUTH_LOG_DEBUG, and Log\singleton().
Referenced by attachLogObserver(), and log().
Auth::_loadStorage | ( | ) |
Load Storage Driver if not already loaded.
Suspend storage instantiation to make Auth lighter to use for calls which do not require login
Definition at line 443 of file Auth.php.
References _factory(), AUTH_LOG_DEBUG, and log().
Referenced by addUser(), changePassword(), listUsers(), ilAuthWeb\login(), Auth_HTTP\login(), login(), and removeUser().
Auth::addUser | ( | $username, | |
$password, | |||
$additional = '' |
|||
) |
Add user to the storage container.
public
string | Username |
string | Password |
mixed | Additional parameters |
Definition at line 1211 of file Auth.php.
References $additional, $password, $username, _loadStorage(), AUTH_LOG_DEBUG, and log().
& Auth::applyAuthOptions | ( | & | $options | ) |
Set the Auth options.
Some options which are Auth specific will be applied the rest will be left for usage by the container
array | An array of Auth options |
Definition at line 396 of file Auth.php.
References $options.
Referenced by Auth().
Auth::assignData | ( | ) |
Assign data from login form to internal values.
This function takes the values for username and password from $HTTP_POST_VARS/$_POST and assigns them to internal variables. If you wish to use another source apart from $HTTP_POST_VARS/$_POST, you have to derive this function.
$HTTP_POST_VARS, $_POST
Reimplemented in Auth_HTTP, and ilAuthHTTP.
Definition at line 491 of file Auth.php.
References $_postPassword, $_postUsername, AUTH_LOG_DEBUG, and log().
Referenced by start().
Auth::attachLogObserver | ( | & | $observer | ) |
Attach an Observer to the Auth Log Source.
object | Log_Observer A Log Observer instance |
Definition at line 1313 of file Auth.php.
References _loadLogger().
Auth::Auth | ( | $storageDriver, | |
$options = '' , |
|||
$loginFunction = '' , |
|||
$showLogin = true |
|||
) |
Constructor.
Set up the storage driver.
string | Type of the storage driver |
mixed | Additional options for the storage driver (example: if you are using DB as the storage driver, you have to pass the dsn string here) |
string | Name of the function that creates the login form |
boolean | Should the login form be displayed if neccessary? |
Definition at line 335 of file Auth.php.
References $_COOKIE, $_POST, $_SESSION, $_sessionName, $loginFunction, $options, $showLogin, applyAuthOptions(), and PEAR\throwError().
Referenced by ShibAuth\__construct(), Auth_Anonymous\Auth_Anonymous(), Auth_HTTP\Auth_HTTP(), ilCASAuth\ilCASAuth(), and staticCheckAuth().
Auth::changePassword | ( | $username, | |
$password | |||
) |
Change password for user in the storage container.
public
string | Username |
string | The new password |
Definition at line 1248 of file Auth.php.
References $password, $username, _loadStorage(), AUTH_LOG_DEBUG, and log().
Auth::checkAuth | ( | ) |
Checks if there is a session with valid auth information.
public
Definition at line 897 of file Auth.php.
References _isAdvancedSecurityEnabled(), AUTH_ADV_CHALLENGE, AUTH_ADV_IPCHECK, AUTH_ADV_USERAGENT, AUTH_CALLBACK_ABORT, AUTH_EXPIRED, AUTH_IDLED, AUTH_LOG_DEBUG, AUTH_LOG_INFO, AUTH_SECURITY_BREACH, log(), login(), logout(), and updateIdle().
Referenced by getAuth(), and start().
Auth::getAuth | ( | ) |
Has the user been authenticated?
Is there a valid login session. Previously this was different from checkAuth() but now it is just an alias.
public
Definition at line 1054 of file Auth.php.
References AUTH_LOG_DEBUG, checkAuth(), and log().
Referenced by Auth_HTTP\authenticationInfo(), and Auth_HTTP\login().
Auth::getAuthData | ( | $name = null | ) |
Get additional information that is stored in the session.
If no value for the first parameter is passed, the method will return all data that is currently stored.
string | Name of the data field |
Definition at line 798 of file Auth.php.
Referenced by Auth_HTTP\authenticationInfo(), and Auth_HTTP\login().
Auth::getPostPasswordField | ( | ) |
Auth::getPostUsernameField | ( | ) |
Auth::getStatus | ( | ) |
Get the current status.
Reimplemented in ilAuthInactive.
Definition at line 1128 of file Auth.php.
References $status.
Auth::getUsername | ( | ) |
Get the username.
Definition at line 1111 of file Auth.php.
Referenced by ilAuthApache\__construct().
Auth::listUsers | ( | ) |
List all users that are currently available in the storage container.
public
Definition at line 1191 of file Auth.php.
References _loadStorage(), AUTH_LOG_DEBUG, and log().
Auth::log | ( | $message, | |
$level = AUTH_LOG_DEBUG |
|||
) |
Log a message from the Auth system.
public
string | The message to log |
string | The log level to log the message under. See the Log documentation for more info. |
Definition at line 1266 of file Auth.php.
References _loadLogger().
Referenced by _loadStorage(), addUser(), assignData(), changePassword(), checkAuth(), getAuth(), listUsers(), ilAuthWeb\login(), login(), logout(), removeUser(), setAuth(), and start().
Auth::login | ( | ) |
Login function.
Reimplemented in Auth_HTTP, ilCASAuth, ShibAuth, ilAuthApache, Auth_Anonymous, and ilAuthWeb.
Definition at line 543 of file Auth.php.
References _loadStorage(), AUTH_LOG_DEBUG, AUTH_LOG_INFO, AUTH_WRONG_LOGIN, log(), Auth_Frontend_Html\render(), and setAuth().
Referenced by checkAuth(), and start().
Auth::logout | ( | ) |
Logout function.
This function clears any auth tokens in the currently active session and executes the logout callback function, if any
public
Reimplemented in ShibAuth, and ilCASAuth.
Definition at line 1073 of file Auth.php.
References AUTH_LOG_DEBUG, and log().
Referenced by checkAuth(), ilSessionControl\checkCurrentSessionIsAllowed(), Auth_Anonymous\forceLogin(), and ilAuthInactive\start().
Auth::removeUser | ( | $username | ) |
Remove user from the storage container.
public
string | Username |
Definition at line 1229 of file Auth.php.
References $username, _loadStorage(), AUTH_LOG_DEBUG, and log().
Auth::sessionValidThru | ( | ) |
Auth::setAdvancedSecurity | ( | $flag = true | ) |
Enables advanced security checks.
Currently only ip change and useragent change are detected
bool | Enable or disable |
Definition at line 883 of file Auth.php.
Auth::setAllowLogin | ( | $allowLogin = true | ) |
Should the login form be displayed if neccessary?
bool | show login form or not |
Definition at line 691 of file Auth.php.
References $allowLogin.
Auth::setAuth | ( | $username | ) |
Register variable in a session telling that the user has logged in successfully.
string | Username |
Definition at line 823 of file Auth.php.
References $username, AUTH_LOG_DEBUG, and log().
Referenced by Auth_Anonymous\login(), ilCASAuth\login(), Auth_HTTP\login(), and login().
Auth::setAuthData | ( | $name, | |
$value, | |||
$overwrite = true |
|||
) |
Register additional information that is to be stored in the session.
string | Name of the data field |
mixed | Value of the data field |
boolean | Should existing data be overwritten? (default is true) |
Definition at line 777 of file Auth.php.
Referenced by Auth_Container_DBLite\fetchData(), and Auth_HTTP\login().
Auth::setCheckAuthCallback | ( | $checkAuthCallback | ) |
Register a callback function to be called whenever the validity of the login is checked The function will receive two parameters, the username and a reference to the auth object.
string | callback function name |
Definition at line 708 of file Auth.php.
References $checkAuthCallback.
Auth::setExpire | ( | $time, | |
$add = false |
|||
) |
Auth::setFailedLoginCallback | ( | $loginFailedCallback | ) |
Register a callback function to be called on failed user login.
The function will receive two parameters, the username and a reference to the auth object.
string | callback function name |
Definition at line 741 of file Auth.php.
References $loginFailedCallback.
Auth::setIdle | ( | $time, | |
$add = false |
|||
) |
Auth::setLoginCallback | ( | $loginCallback | ) |
Register a callback function to be called on user login.
The function will receive two parameters, the username and a reference to the auth object.
string | callback function name |
Definition at line 725 of file Auth.php.
References $loginCallback.
Auth::setLogoutCallback | ( | $logoutCallback | ) |
Register a callback function to be called on user logout.
The function will receive three parameters, the username and a reference to the auth object.
string | callback function name |
Definition at line 758 of file Auth.php.
References $logoutCallback.
Auth::setSessionName | ( | $name = 'session' | ) |
Set name of the session to a customized value.
If you are using multiple instances of PEAR::Auth on the same domain, you can change the name of session per application via this function. This will chnage the name of the session variable auth uses to store it's data in the session
string | New name for the session |
Definition at line 656 of file Auth.php.
References $_SESSION, and $_sessionName.
Referenced by ilAuthOpenId\__construct(), ilAuthCAS\__construct(), ilAuthSOAP\__construct(), ilAuthWeb\__construct(), ilAuthHTTP\__construct(), ilAuthECS\__construct(), ilAuthCron\__construct(), ilAuthApache\__construct(), and ShibAuth\__construct().
Auth::setShowLogin | ( | $showLogin = true | ) |
Should the login form be displayed if neccessary?
bool | show login form or not |
Definition at line 676 of file Auth.php.
References $showLogin.
Auth::start | ( | ) |
Start new auth session.
Reimplemented in ilAuthInactive.
Definition at line 518 of file Auth.php.
References assignData(), AUTH_LOG_DEBUG, checkAuth(), log(), and login().
|
static |
Statically checks if there is a session with valid auth information.
public
Definition at line 1032 of file Auth.php.
References $options, Auth(), and AUTH_LOG_DEBUG.
Auth::updateIdle | ( | ) |
Update the idletime.
private
Definition at line 1097 of file Auth.php.
Referenced by checkAuth().
Auth::$_postPassword = 'password' |
Definition at line 259 of file Auth.php.
Referenced by assignData().
Auth::$_postUsername = 'username' |
Definition at line 252 of file Auth.php.
Referenced by assignData().
Auth::$_sessionName = '_authsession' |
Definition at line 221 of file Auth.php.
Referenced by Auth(), Auth_HTTP\login(), and setSessionName().
Auth::$advancedsecurity = false |
Definition at line 245 of file Auth.php.
Referenced by _isAdvancedSecurityEnabled().
Auth::$allowLogin = true |
Definition at line 161 of file Auth.php.
Referenced by setAllowLogin().
Auth::$checkAuthCallback = '' |
Definition at line 190 of file Auth.php.
Referenced by setCheckAuthCallback().
Auth::$loginCallback = '' |
Definition at line 198 of file Auth.php.
Referenced by setLoginCallback().
Auth::$loginFailedCallback = '' |
Definition at line 206 of file Auth.php.
Referenced by setFailedLoginCallback().
Auth::$loginFunction = '' |
Definition at line 145 of file Auth.php.
Referenced by Auth(), and Auth_Anonymous\Auth_Anonymous().
Auth::$logoutCallback = '' |
Definition at line 214 of file Auth.php.
Referenced by setLogoutCallback().
Auth::$password = '' |
Definition at line 182 of file Auth.php.
Referenced by addUser(), Auth_HTTP\assignData(), and changePassword().
Auth::$showLogin = true |
Definition at line 153 of file Auth.php.
Referenced by Auth(), Auth_Anonymous\Auth_Anonymous(), and setShowLogin().
Auth::$status = '' |
Definition at line 168 of file Auth.php.
Referenced by getStatus().
Auth::$storage = '' |
Definition at line 138 of file Auth.php.
Referenced by Auth_HTTP\login().
Auth::$username = '' |
Definition at line 175 of file Auth.php.
Referenced by addUser(), Auth_HTTP\assignData(), ilAuthOpenId\callProvider(), changePassword(), ilCASAuth\login(), ilAuthOpenId\parseUsername(), removeUser(), and setAuth().