ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAuthHTTP Class Reference

Base class for ilAuth, ilAuthHTTP .... More...

+ Inheritance diagram for ilAuthHTTP:
+ Collaboration diagram for ilAuthHTTP:

Public Member Functions

 supportsRedirects ()
 Returns true, if the current auth mode allows redirection to e.g to loginScreen, public section... More...
 
 __construct ($container, $a_options=array())
 Constructor. More...
 
 assignData ()
 Overwritten to allow passwordless mount-instructions. More...
 
- Public Member Functions inherited from Auth_HTTP
 Auth_HTTP ($storageDriver, $options='')
 Constructor. More...
 
 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. More...
 
 login ()
 Login function. More...
 
 drawLogin ($username="")
 Launch the login box. More...
 
 setRealm ($realm, $digestRealm='')
 Set name of the current realm. More...
 
 setCancelText ($text)
 Set the text to send if user hits the cancel button. More...
 
 validateDigest ($response, $a1)
 judge if the client response is valid. More...
 
 _judgeStale ($nonce)
 judge if nonce from client is stale. More...
 
 _decodeNonce ($nonce, &$time, &$hash)
 decode nonce string More...
 
 _getNonce ()
 return nonce to detect timeout More...
 
 authenticationInfo ($contentMD5='')
 output HTTP Authentication-Info header More...
 
 setOption ($name, $value=null)
 set authentication option More...
 
 getOption ($name)
 get authentication option More...
 
 selfURI ()
 get self URI More...
 
- Public Member Functions inherited from Auth
 Auth ($storageDriver, $options='', $loginFunction='', $showLogin=true)
 Constructor. More...
 
applyAuthOptions (&$options)
 Set the Auth options. More...
 
 _loadStorage ()
 Load Storage Driver if not already loaded. More...
 
 assignData ()
 Assign data from login form to internal values. More...
 
 start ()
 Start new auth session. More...
 
 login ()
 Login function. More...
 
 setExpire ($time, $add=false)
 Set the maximum expire time. More...
 
 setIdle ($time, $add=false)
 Set the maximum idle time. More...
 
 setSessionName ($name='session')
 Set name of the session to a customized value. More...
 
 setShowLogin ($showLogin=true)
 Should the login form be displayed if neccessary? More...
 
 setAllowLogin ($allowLogin=true)
 Should the login form be displayed if neccessary? More...
 
 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. More...
 
 setLoginCallback ($loginCallback)
 Register a callback function to be called on user login. More...
 
 setFailedLoginCallback ($loginFailedCallback)
 Register a callback function to be called on failed user login. More...
 
 setLogoutCallback ($logoutCallback)
 Register a callback function to be called on user logout. More...
 
 setAuthData ($name, $value, $overwrite=true)
 Register additional information that is to be stored in the session. More...
 
 getAuthData ($name=null)
 Get additional information that is stored in the session. More...
 
 setAuth ($username)
 Register variable in a session telling that the user has logged in successfully. More...
 
 setAdvancedSecurity ($flag=true)
 Enables advanced security checks. More...
 
 checkAuth ()
 Checks if there is a session with valid auth information. More...
 
 getAuth ()
 Has the user been authenticated? More...
 
 logout ()
 Logout function. More...
 
 updateIdle ()
 Update the idletime. More...
 
 getUsername ()
 Get the username. More...
 
 getStatus ()
 Get the current status. More...
 
 getPostUsernameField ()
 Gets the post varible used for the username. More...
 
 getPostPasswordField ()
 Gets the post varible used for the username. More...
 
 sessionValidThru ()
 Returns the time up to the session is valid. More...
 
 listUsers ()
 List all users that are currently available in the storage container. More...
 
 addUser ($username, $password, $additional='')
 Add user to the storage container. More...
 
 removeUser ($username)
 Remove user from the storage container. More...
 
 changePassword ($username, $password)
 Change password for user in the storage container. More...
 
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message from the Auth system. More...
 
 _loadLogger ()
 Load Log object if not already loaded. More...
 
 attachLogObserver (&$observer)
 Attach an Observer to the Auth Log Source. More...
 
 _isAdvancedSecurityEnabled ($feature=null)
 Is advanced security enabled? More...
 
- Public Member Functions inherited from ilAuthBase
 getSubStatus ()
 Get sub status. More...
 
 setSubStatus ($a_sub_status)
 Set sub status. More...
 
 supportsRedirects ()
 Returns true, if the current auth mode allows redirects to e.g the login screen, public section ... More...
 
 getContainer ()
 Get container object. More...
 
 getExceededUserName ()
 

Protected Member Functions

 failedLoginObserver ($a_username, $a_auth)
 Failed login. More...
 
- Protected Member Functions inherited from ilAuthBase
 initAuth ()
 Init auth object Enable logging, set callbacks... More...
 
 loginObserver ($a_username, $a_auth)
 Called after successful login. More...
 
 failedLoginObserver ($a_username, $a_auth)
 Called after failed login. More...
 
 checkAuthObserver ($a_username, $a_auth)
 Called after each check auth request. More...
 
 logoutObserver ($a_username, $a_auth)
 Called after logout. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Auth
_factory ($driver, $options='')
 Return a storage driver based on $driver and $options. More...
 
 staticCheckAuth ($options=null)
 Statically checks if there is a session with valid auth information. More...
 
- Data Fields inherited from Auth_HTTP
 $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
 
- Protected Attributes inherited from ilAuthBase
 $sub_status = null
 
 $exceeded_user_name
 

Detailed Description

Base class for ilAuth, ilAuthHTTP ....

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 36 of file class.ilAuthHTTP.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthHTTP::__construct (   $container,
  $a_options = array() 
)

Constructor.

Parameters
objectAuth_ContainerBase
arrayfurther options Not used in the moment

Definition at line 55 of file class.ilAuthHTTP.php.

References ilAuthBase\initAuth(), Auth_HTTP\setRealm(), and Auth\setSessionName().

56  {
57  $a_options['sessionSharing'] = false;
58 
59  parent::__construct($container,$a_options);
60  $this->setSessionName("_authhttp".md5(CLIENT_ID));
61  $this->setRealm(CLIENT_ID);
62 
63  $this->initAuth();
64  }
initAuth()
Init auth object Enable logging, set callbacks...
setRealm($realm, $digestRealm='')
Set name of the current realm.
Definition: HTTP.php:502
setSessionName($name='session')
Set name of the session to a customized value.
Definition: Auth.php:656
+ Here is the call graph for this function:

Member Function Documentation

◆ assignData()

ilAuthHTTP::assignData ( )

Overwritten to allow passwordless mount-instructions.

Returns

Definition at line 70 of file class.ilAuthHTTP.php.

References $_GET, and $GLOBALS.

71  {
72  if(isset($_GET['mount-instructions']))
73  {
74  $GLOBALS['ilLog']->write('Trying authentication as anonymous for displaying mount instructions');
75  $this->username = 'anonymous';
76  $this->password = 'anonymous';
77  }
78  else
79  {
80  parent::assignData();
81  }
82 
83  }
$_GET["client_id"]
$GLOBALS['ct_recipient']

◆ failedLoginObserver()

ilAuthHTTP::failedLoginObserver (   $a_username,
  $a_auth 
)
protected

Failed login.

=> Draw login (HTTP 401)

Parameters
object$a_username
object$a_auth
Returns

Definition at line 91 of file class.ilAuthHTTP.php.

References $GLOBALS, and Auth_HTTP\drawLogin().

92  {
93  // First, call parent observer and
94  if(!parent::failedLoginObserver($a_username,$a_auth))
95  {
96  $GLOBALS['ilLog']->write(__METHOD__.': HTTP authentication failed. Sending status 401');
97  $this->drawLogin($a_username);
98  return false;
99  }
100  return false;
101  }
drawLogin($username="")
Launch the login box.
Definition: HTTP.php:449
$GLOBALS['ct_recipient']
+ Here is the call graph for this function:

◆ supportsRedirects()

ilAuthHTTP::supportsRedirects ( )

Returns true, if the current auth mode allows redirection to e.g to loginScreen, public section...

Returns

Definition at line 44 of file class.ilAuthHTTP.php.

45  {
46  return false;
47  }

The documentation for this class was generated from the following file: