ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ShibAuth Class Reference
+ Inheritance diagram for ShibAuth:
+ Collaboration diagram for ShibAuth:

Public Member Functions

 supportsRedirects ()
 
 login ()
 Login function. More...
 
 setAuth ($username, ilObjUser $userObj=NULL)
 
 logout ()
 

Detailed Description

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

Member Function Documentation

◆ login()

ShibAuth::login ( )

Login function.

private

Returns
void

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

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

78  {
79  global $DIC; // for backword compatibility of hook environment variables
80  $ilias = $DIC['ilias'];
81  $ilSetting = $DIC['ilSetting'];
82  $shibServerData = shibServerData::getInstance();
83  if ($shibServerData->getLogin()) {
84  $shibUser = shibUser::buildInstance($shibServerData);
85  // for backword compatibility of hook environment variables
86  $userObj =& $shibUser; // For shib_data_conv included Script
87  $newUser = $shibUser->isNew(); // For shib_data_conv included Script
88  if ($shibUser->isNew()) {
89  $shibUser->createFields();
90  $shibUser->setPref('hits_per_page', $ilSetting->get('hits_per_page'));
91 
92  // Modify user data before creating the user
93  // Include custom code that can be used to further modify
94  // certain Shibboleth user attributes
95  if ($ilias->getSetting('shib_data_conv') AND $ilias->getSetting('shib_data_conv') != ''
96  AND is_readable($ilias->getSetting('shib_data_conv'))
97  ) {
98  include($ilias->getSetting('shib_data_conv'));
99  }
100  $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeCreateUser($shibUser);
101  $shibUser->create();
102  $shibUser->updateOwner();
103  $shibUser->saveAsNew();
104  $shibUser->writePrefs();
105  $shibUser = ilShibbolethPluginWrapper::getInstance()->afterCreateUser($shibUser);
107  } else {
108  $shibUser->updateFields();
109  // Include custom code that can be used to further modify
110  // certain Shibboleth user attributes
111  if ($ilias->getSetting('shib_data_conv') AND $ilias->getSetting('shib_data_conv') != ''
112  AND is_readable($ilias->getSetting('shib_data_conv'))
113  ) {
114  include($ilias->getSetting('shib_data_conv'));
115  }
116  // $shibUser->update();
117  $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeUpdateUser($shibUser);
118  $shibUser->update();
119  $shibUser = ilShibbolethPluginWrapper::getInstance()->afterUpdateUser($shibUser);
121  }
122  $this->setAuth($shibUser->getLogin(), $shibUser);
123  ilObjUser::_updateLastLogin($shibUser->getId());
124  if ($_GET['target'] != '') {
125  ilUtil::redirect('goto.php?target=' . $_GET['target'] . '&client_id=' . CLIENT_ID);
126  }
127  } else {
128  $this->status = AUTH_WRONG_LOGIN;
129  }
130  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_GET["client_id"]
static buildInstance(shibServerData $shibServerData)
global $ilSetting
Definition: privfeed.php:17
setAuth($username, ilObjUser $userObj=NULL)
static _updateLastLogin($a_usr_id, $a_last_login=null)
STATIC METHOD updates the last_login field of user with given id to given or current date...
global $DIC
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ logout()

ShibAuth::logout ( )

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

References $DIC, $ilUser, and ilShibbolethPluginWrapper\getInstance().

148  {
149  global $DIC;
150  $ilUser = $DIC['ilUser'];
152  parent::logout();
154  }
$ilUser
Definition: imgupload.php:18
global $DIC
+ Here is the call graph for this function:

◆ setAuth()

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

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

References ilShibbolethPluginWrapper\getInstance().

Referenced by login().

137  {
138  if ($userObj) {
139  ilShibbolethPluginWrapper::getInstance()->beforeLogin($userObj);
140  }
141  parent::setAuth($username);
142  if ($userObj) {
143  ilShibbolethPluginWrapper::getInstance()->afterLogin($userObj);
144  }
145  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ supportsRedirects()

ShibAuth::supportsRedirects ( )
Parameters
$authParams
bool$updateUserData

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

67  {
68  return true;
69  }

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