/** * Login function * * @access private * @return void */ public function login() { $shibServerData = shibServerData::getInstance($_SERVER); if ($shibServerData->getLogin()) { $shibUser = shibUser::getInstance($shibServerData); if ($shibUser->isNew()) { $shibUser->createFields(); $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeCreateUser($shibUser); $shibUser->create(); $shibUser->updateOwner(); $shibUser->saveAsNew(); $shibUser = ilShibbolethPluginWrapper::getInstance()->afterCreateUser($shibUser); ilShibbolethRoleAssignmentRules::doAssignments($shibUser->getId(), $_SERVER); } else { $shibUser->updateFields(); $shibUser->update(); $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeUpdateUser($shibUser); $shibUser->update(); $shibUser = ilShibbolethPluginWrapper::getInstance()->afterUpdateUser($shibUser); ilShibbolethRoleAssignmentRules::updateAssignments($shibUser->getId(), $_SERVER); } $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; } }
/** * Login function * * @access private * @return void */ public function login() { 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); ilShibbolethRoleAssignmentRules::updateAssignments($shibUser->getId(), $_SERVER); } $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; } }