ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
Auth_Anonymous Class Reference
+ Inheritance diagram for Auth_Anonymous:
+ Collaboration diagram for Auth_Anonymous:

Public Member Functions

 Auth_Anonymous ($storageDriver, $options='', $loginFunction='', $showLogin=true)
 Pass all parameters to Parent Auth class. More...
 
 login ()
 Login function. More...
 
 forceLogin ()
 Force the user to login. 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 ()
 

Data Fields

 $allow_anonymous = true
 
 $anonymous_username = 'anonymous'
 
- 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. More...
 
 staticCheckAuth ($options=null)
 Statically checks if there is a session with valid auth information. 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...
 
 checkExceededLoginAttempts (\ilObjUser $user)
 
 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...
 
- Protected Attributes inherited from ilAuthBase
 $sub_status = null
 
 $exceeded_user_name
 

Detailed Description

Definition at line 47 of file Anonymous.php.

Member Function Documentation

◆ Auth_Anonymous()

Auth_Anonymous::Auth_Anonymous (   $storageDriver,
  $options = '',
  $loginFunction = '',
  $showLogin = true 
)

Pass all parameters to Parent Auth class.

Set up the storage driver.

Parameters
stringType of the storage driver
mixedAdditional options for the storage driver (example: if you are using DB as the storage driver, you have to pass the dsn string here)
stringName of the function that creates the login form
booleanShould the login form be displayed if neccessary?
Returns
void
See also
Auth::Auth()

Definition at line 84 of file Anonymous.php.

References Auth\$loginFunction, $options, and Auth\$showLogin.

84  {
85  parent::Auth($storageDriver, $options, $loginFunction, $showLogin);
86  }
$showLogin
Definition: Auth.php:153
if(!is_array($argv)) $options
$loginFunction
Definition: Auth.php:145

◆ forceLogin()

Auth_Anonymous::forceLogin ( )

Force the user to login.

Calling this function forces the user to provide a real username and password before continuing.

Returns
void

Definition at line 127 of file Anonymous.php.

References Auth\logout().

127  {
128  $this->allow_anonymous = false;
129  if( !empty($this->session['username']) && $this->session['username'] == $this->anonymous_username ) {
130  $this->logout();
131  }
132  }
logout()
Logout function.
Definition: Auth.php:1077
+ Here is the call graph for this function:

◆ login()

Auth_Anonymous::login ( )

Login function.

If no username & password is passed then login as the username provided in $this->anonymous_username else call standard login() function.

Returns
void private
See also
Auth::login()

Definition at line 102 of file Anonymous.php.

References Auth\setAuth().

102  {
103  if ( $this->allow_anonymous
104  && empty($this->username)
105  && empty($this->password) ) {
106  $this->setAuth($this->anonymous_username);
107  if (is_callable($this->loginCallback)) {
108  call_user_func_array($this->loginCallback, array($this->username, $this) );
109  }
110  } else {
111  // Call normal login system
112  parent::login();
113  }
114  }
setAuth($username)
Register variable in a session telling that the user has logged in successfully.
Definition: Auth.php:823
+ Here is the call graph for this function:

Field Documentation

◆ $allow_anonymous

Auth_Anonymous::$allow_anonymous = true

Definition at line 57 of file Anonymous.php.

◆ $anonymous_username

Auth_Anonymous::$anonymous_username = 'anonymous'

Definition at line 64 of file Anonymous.php.


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