ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 login ()
 Login function.
 forceLogin ()
 Force the user to login.
- 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.
 assignData ()
 Assign data from login form to internal values.
 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

 $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.
 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

Detailed Description

Definition at line 47 of file Anonymous.php.

Member Function Documentation

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, Auth\$showLogin, and Auth\Auth().

{
parent::Auth($storageDriver, $options, $loginFunction, $showLogin);
}

+ Here is the call graph for this function:

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().

{
$this->allow_anonymous = false;
if( !empty($this->session['username']) && $this->session['username'] == $this->anonymous_username ) {
$this->logout();
}
}

+ Here is the call graph for this function:

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()

Reimplemented from Auth.

Definition at line 102 of file Anonymous.php.

References Auth\setAuth().

{
if ( $this->allow_anonymous
&& empty($this->username)
&& empty($this->password) ) {
$this->setAuth($this->anonymous_username);
if (is_callable($this->loginCallback)) {
call_user_func_array($this->loginCallback, array($this->username, $this) );
}
} else {
// Call normal login system
}
}

+ Here is the call graph for this function:

Field Documentation

Auth_Anonymous::$allow_anonymous = true

Definition at line 57 of file Anonymous.php.

Auth_Anonymous::$anonymous_username = 'anonymous'

Definition at line 64 of file Anonymous.php.


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