ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ShibAuth Class Reference
+ Inheritance diagram for ShibAuth:
+ Collaboration diagram for ShibAuth:

Public Member Functions

 __construct ($authParams, $updateUserData=false)
 supportsRedirects ()
 login ()
 Login function.
 setAuth ($username, ilObjUser $userObj=NULL)
 logout ()
 Logout function.
- 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?
 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
 getSubStatus ()
 Get sub status.
 setSubStatus ($a_sub_status)
 Set sub status.
 getContainer ()
 Get container object.
 getExceededUserName ()

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

Detailed Description

Definition at line 42 of file class.ilShibboleth.php.

Constructor & Destructor Documentation

ShibAuth::__construct (   $authParams,
  $updateUserData = false 
)
Parameters
$authParams
bool$updateUserData

Definition at line 48 of file class.ilShibboleth.php.

References Auth\Auth(), and Auth\setSessionName().

{
if ($authParams['sessionName'] != '') {
parent::Auth('', array( 'sessionName' => $authParams['sessionName'] ));
} else {
}
$this->updateUserData = $updateUserData;
if (! empty($authParams['sessionName'])) {
$this->setSessionName($authParams['sessionName']);
unset($authParams['sessionName']);
}
}

+ Here is the call graph for this function:

Member Function Documentation

ShibAuth::login ( )

Login function.

private

Returns
void

Reimplemented from Auth.

Definition at line 76 of file class.ilShibboleth.php.

References $_GET, $ilSetting, ilObjUser\_updateLastLogin(), AUTH_WRONG_LOGIN, shibUser\buildInstance(), ilShibbolethRoleAssignmentRules\doAssignments(), ilShibbolethPluginWrapper\getInstance(), shibConfig\getInstance(), ilUtil\redirect(), setAuth(), and ilShibbolethRoleAssignmentRules\updateAssignments().

{
global $ilias, $ilSetting; // for backword compatibility of hook environment variables
$shibServerData = shibServerData::getInstance($_SERVER);
if ($shibServerData->getLogin()) {
$shibUser = shibUser::buildInstance($shibServerData);
// for backword compatibility of hook environment variables
$userObj =& $shibUser; // For shib_data_conv included Script
$newUser = $shibUser->isNew(); // For shib_data_conv included Script
if ($shibUser->isNew()) {
$shibUser->createFields();
$shibUser->setPref('hits_per_page', $ilSetting->get('hits_per_page'));
// Modify user data before creating the user
// Include custom code that can be used to further modify
// certain Shibboleth user attributes
if ($ilias->getSetting('shib_data_conv') AND $ilias->getSetting('shib_data_conv') != ''
AND is_readable($ilias->getSetting('shib_data_conv'))
) {
include($ilias->getSetting('shib_data_conv'));
}
$shibUser = ilShibbolethPluginWrapper::getInstance()->beforeCreateUser($shibUser);
$shibUser->create();
$shibUser->updateOwner();
$shibUser->saveAsNew();
$shibUser->writePrefs();
$shibUser = ilShibbolethPluginWrapper::getInstance()->afterCreateUser($shibUser);
ilShibbolethRoleAssignmentRules::doAssignments($shibUser->getId(), $_SERVER);
} else {
$shibUser->updateFields();
// Include custom code that can be used to further modify
// certain Shibboleth user attributes
if ($ilias->getSetting('shib_data_conv') AND $ilias->getSetting('shib_data_conv') != ''
AND is_readable($ilias->getSetting('shib_data_conv'))
) {
include($ilias->getSetting('shib_data_conv'));
}
// $shibUser->update();
$shibUser = ilShibbolethPluginWrapper::getInstance()->beforeUpdateUser($shibUser);
$shibUser->update();
$shibUser = ilShibbolethPluginWrapper::getInstance()->afterUpdateUser($shibUser);
}
$this->setAuth($shibUser->getLogin(), $shibUser);
ilObjUser::_updateLastLogin($shibUser->getId());
if ($_GET['target'] != '') {
ilUtil::redirect('goto.php?target=' . $_GET['target'] . '&client_id=' . CLIENT_ID);
}
} else {
$this->status = AUTH_WRONG_LOGIN;
}
}

+ Here is the call graph for this function:

ShibAuth::logout ( )

Logout function.

This function clears any auth tokens in the currently active session and executes the logout callback function, if any

public

Returns
void

Reimplemented from Auth.

Definition at line 144 of file class.ilShibboleth.php.

References $ilUser, and ilShibbolethPluginWrapper\getInstance().

{
global $ilUser;
ilShibbolethPluginWrapper::getInstance()->beforeLogout($ilUser);
ilShibbolethPluginWrapper::getInstance()->afterLogout($ilUser);
}

+ Here is the call graph for this function:

ShibAuth::setAuth (   $username,
ilObjUser  $userObj = NULL 
)
Parameters
$username
ilObjUser$userObj

Definition at line 133 of file class.ilShibboleth.php.

References Auth\$username, and ilShibbolethPluginWrapper\getInstance().

Referenced by login().

{
if ($userObj) {
ilShibbolethPluginWrapper::getInstance()->beforeLogin($userObj);
}
if ($userObj) {
ilShibbolethPluginWrapper::getInstance()->afterLogin($userObj);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ShibAuth::supportsRedirects ( )
Returns
bool

Reimplemented from ilAuthBase.

Definition at line 65 of file class.ilShibboleth.php.

{
return true;
}

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