ILIAS
release_4-3 Revision
|
Public Member Functions | |
Auth_HTTP ($storageDriver, $options= '') | |
Constructor. | |
assignData () | |
Assign values from $PHP_AUTH_USER and $PHP_AUTH_PW or 'Authorization' header to internal variables and sets the session id based on them. | |
login () | |
Login function. | |
drawLogin ($username="") | |
Launch the login box. | |
setRealm ($realm, $digestRealm= '') | |
Set name of the current realm. | |
setCancelText ($text) | |
Set the text to send if user hits the cancel button. | |
validateDigest ($response, $a1) | |
judge if the client response is valid. | |
_judgeStale ($nonce) | |
judge if nonce from client is stale. | |
_decodeNonce ($nonce, &$time, &$hash) | |
decode nonce string | |
_getNonce () | |
return nonce to detect timeout | |
authenticationInfo ($contentMD5= '') | |
output HTTP Authentication-Info header | |
setOption ($name, $value=null) | |
set authentication option | |
getOption ($name) | |
get authentication option | |
selfURI () | |
get self URI | |
Public Member Functions inherited from Auth | |
Auth ($storageDriver, $options= '', $loginFunction= '', $showLogin=true) | |
Constructor. | |
& | applyAuthOptions (&$options) |
Set the Auth options. | |
_loadStorage () | |
Load Storage Driver if not already loaded. | |
start () | |
Start new auth session. | |
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. |
Data Fields | |
$authType = 'basic' | |
$realm = "protected area" | |
$CancelText = "Error 401 - Access denied" | |
$options = array() | |
$stale = false | |
$opaque = 'dummy' | |
$uri = '' | |
$auth = array() | |
$nextNonce = '' | |
$nonce = '' | |
$server | |
$post | |
$cookie | |
Data Fields inherited from Auth | |
$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 | |
Static Public Member Functions inherited from Auth | |
& | _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. | |
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 |
Auth_HTTP::_decodeNonce | ( | $nonce, | |
& | $time, | ||
& | $hash | ||
) |
decode nonce string
private
string | $nonce | nonce value from client |
string | $time | decoded time |
string | $hash | decoded hash |
Definition at line 628 of file HTTP.php.
References $nonce, AUTH_HTTP_NONCE_HASH_LEN, and AUTH_HTTP_NONCE_TIME_LEN.
Referenced by _judgeStale().
Auth_HTTP::_getNonce | ( | ) |
return nonce to detect timeout
private
Definition at line 659 of file HTTP.php.
Referenced by _judgeStale(), and drawLogin().
Auth_HTTP::_judgeStale | ( | $nonce | ) |
judge if nonce from client is stale.
private
string | $nonce | nonce value from client |
Definition at line 596 of file HTTP.php.
References $nonce, $stale, _decodeNonce(), and _getNonce().
Referenced by assignData().
Auth_HTTP::assignData | ( | ) |
Assign values from $PHP_AUTH_USER and $PHP_AUTH_PW or 'Authorization' header to internal variables and sets the session id based on them.
public
Try to get authentication information from IIS
set sessionName for AUTH, so that the sessionName is different for distinct realms
Reimplemented from Auth.
Reimplemented in ilAuthHTTP.
Definition at line 217 of file HTTP.php.
References $auth, Auth\$password, Auth\$username, _judgeStale(), PEAR\raiseError(), and selfURI().
Auth_HTTP::Auth_HTTP | ( | $storageDriver, | |
$options = '' |
|||
) |
Constructor.
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) |
Definition at line 173 of file HTTP.php.
References $options, and Auth\Auth().
Auth_HTTP::authenticationInfo | ( | $contentMD5 = '' | ) |
output HTTP Authentication-Info header
md5 hash of contents is required if 'qop' is 'auth-int'
private
string | MD5 hash of content |
Definition at line 682 of file HTTP.php.
References Auth\getAuth(), and Auth\getAuthData().
Referenced by login().
Auth_HTTP::drawLogin | ( | $username = "" | ) |
Launch the login box.
string | $username | Username |
Send the header commands
This code is only executed if the user hits the cancel button or if he enters wrong data 3 times.
Definition at line 449 of file HTTP.php.
References $CancelText, _getNonce(), and exit.
Referenced by ilAuthHTTP\failedLoginObserver(), login(), and validateDigest().
Auth_HTTP::getOption | ( | $name | ) |
get authentication option
public
string | $name | key of option |
Definition at line 746 of file HTTP.php.
References $CancelText, and $realm.
Auth_HTTP::login | ( | ) |
Login function.
private
When the user has already entered a username, we have to validate it.
If the login failed or the user entered no username, output the login screen again.
Reimplemented from Auth.
Definition at line 348 of file HTTP.php.
References Auth\$_sessionName, $query, Auth\$storage, Auth\_loadStorage(), AUTH_WRONG_LOGIN, authenticationInfo(), drawLogin(), Auth\getAuth(), Auth\getAuthData(), PEAR\raiseError(), Auth\setAuth(), Auth\setAuthData(), and validateDigest().
Auth_HTTP::selfURI | ( | ) |
get self URI
public
Definition at line 768 of file HTTP.php.
References $uri.
Referenced by assignData(), and validateDigest().
Auth_HTTP::setCancelText | ( | $text | ) |
Auth_HTTP::setOption | ( | $name, | |
$value = null |
|||
) |
set authentication option
public
mixed | $name | key of option |
mixed | $value | value of option |
Definition at line 722 of file HTTP.php.
Auth_HTTP::setRealm | ( | $realm, | |
$digestRealm = '' |
|||
) |
Set name of the current realm.
public
string | $realm | Name of the realm |
string | $digestRealm | Name of the realm for digest authentication |
Definition at line 502 of file HTTP.php.
References $realm.
Referenced by ilAuthHTTP\__construct().
Auth_HTTP::validateDigest | ( | $response, | |
$a1 | |||
) |
judge if the client response is valid.
private
string | $response | client response |
string | $a1 | password or hashed password stored in container |
Definition at line 536 of file HTTP.php.
References $GLOBALS, drawLogin(), and selfURI().
Referenced by login().
Auth_HTTP::$auth = array() |
Definition at line 123 of file HTTP.php.
Referenced by assignData().
Auth_HTTP::$CancelText = "Error 401 - Access denied" |
Definition at line 83 of file HTTP.php.
Referenced by drawLogin(), and getOption().
Auth_HTTP::$nonce = '' |
Definition at line 139 of file HTTP.php.
Referenced by _decodeNonce(), and _judgeStale().
Auth_HTTP::$options = array() |
Definition at line 91 of file HTTP.php.
Referenced by Auth_HTTP().
Auth_HTTP::$realm = "protected area" |
Definition at line 74 of file HTTP.php.
Referenced by getOption(), and setRealm().
Auth_HTTP::$stale = false |
Definition at line 99 of file HTTP.php.
Referenced by _judgeStale().