ILIAS  release_8 Revision v8.24
ilStartUpGUI Class Reference

StartUp GUI class. More...

+ Inheritance diagram for ilStartUpGUI:
+ Collaboration diagram for ilStartUpGUI:

Public Member Functions

 __construct (ilObjUser $user=null, ilTermsOfServiceDocumentEvaluation $termsOfServiceEvaluation=null, ilGlobalTemplateInterface $mainTemplate=null, ServerRequestInterface $httpRequest=null)
 ilStartUpGUI constructor. More...
 
 getUnsafeGetCommands ()
 @inheritDoc More...
 
 getSafePostCommands ()
 @inheritDoc More...
 
 executeCommand ()
 execute command More...
 
 getLogger ()
 Get logger. More...
 
 jumpToRegistration ()
 jump to registration gui More...
 
 jumpToPasswordAssistance ()
 jump to password assistance More...
 
 showAccountMigration (string $message='')
 Show account migration screen. More...
 
 doLogout ()
 show logout screen More...
 
 showNoCookiesScreen ()
 show help screen, if cookies are disabled to do: link to online help here More...
 
 getUnsafeGetCommands ()
 This method must return a list of unsafe GET commands. More...
 
 getSafePostCommands ()
 This method must return a list of safe POST commands. More...
 

Static Public Member Functions

static printToGlobalTemplate ($tpl)
 
static _checkGoto ($a_target)
 Return type depends on _checkGoto calls. More...
 
static logoutUrl (array $parameters=[])
 Return the logout URL with a valid CSRF token. More...
 

Protected Member Functions

 initTargetFromQuery ()
 
 showLoginPage (ilPropertyFormGUI $form=null)
 
 retrieveMessagesFromSession ()
 
 showCodeForm ($a_username=null, $a_form=null)
 
 initCodeForm (string $a_username)
 
 processCode ()
 
 initStandardLoginForm ()
 Initialize the standard. More...
 
 doShibbolethAuthentication ()
 Trying shibboleth authentication. More...
 
 doCasAuthentication ()
 
 doLTIAuthentication ()
 Handle lti requests. More...
 
 doApacheAuthentication ()
 Try apache auth. More...
 
 doStandardAuthentication ()
 Check form input; authenticate user. More...
 
 showLoginForm (string $page_editor_html, ilPropertyFormGUI $form=null)
 Show login form. More...
 
 showLoginInformation (string $page_editor_html, ilGlobalTemplateInterface $tpl)
 Show login information. More...
 
 showCASLoginForm (string $page_editor_html)
 Show cas login. More...
 
 showShibbolethLoginForm (string $page_editor_html)
 Show shibboleth login form. More...
 
 substituteLoginPageElements ( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
 Substitute login page elements. More...
 
 getLoginPageEditorHTML ()
 Get HTML of ILIAS login page editor. More...
 
 showRegistrationLinks (string $page_editor_html)
 Show registration, password forgotten, client slection links. More...
 
 showTermsOfServiceLink (string $page_editor_html)
 Show terms of service link. More...
 
 purgePlaceholders (string $page_editor_html)
 Purge page editor html from unused placeholders. More...
 
 migrateAccount ()
 
 doMigrationNewAccount ()
 
 doMigration ()
 
 showLogout ()
 Show logout screen. More...
 
 getAcceptance ()
 Get terms of service. More...
 
 confirmAcceptance ()
 
 confirmWithdrawal ()
 
 showTermsOfService (bool $accepted=false)
 Show terms of service. More...
 
 processIndexPHP ()
 process index.php More...
 
 showSamlLoginForm (string $page_editor_html)
 
 showOpenIdConnectLoginForm (string $page_editor_html)
 
 doOpenIdConnectAuthentication ()
 do open id connect authentication More...
 
 doSamlAuthentication ()
 
 showSamlIdpSelection (ilSamlAuth $auth, array $idps)
 

Protected Attributes

const ACCOUNT_MIGRATION_MIGRATE = 1
 
const ACCOUNT_MIGRATION_NEW = 2
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilLogger $logger
 
ilGlobalTemplateInterface $mainTemplate
 
ilObjUser $user
 
ilTermsOfServiceDocumentEvaluation $termsOfServiceEvaluation
 
ServerRequestInterface $httpRequest
 
ILIAS DI Container $dic
 
ilAuthSession $authSession
 
ilAppEventHandler $eventHandler
 
ilSetting $setting
 
ilAccessHandler $access
 
RefineryFactory $refinery
 
HTTPServices $http
 
ilHelpGUI $help
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStartUpGUI::__construct ( ilObjUser  $user = null,
ilTermsOfServiceDocumentEvaluation  $termsOfServiceEvaluation = null,
ilGlobalTemplateInterface  $mainTemplate = null,
ServerRequestInterface  $httpRequest = null 
)

ilStartUpGUI constructor.

Definition at line 57 of file class.ilStartUpGUI.php.

62 {
63 global $DIC;
64
65 $this->dic = $DIC;
66
67 if ($user === null) {
68 $user = $DIC->user();
69 }
70 $this->user = $user;
71
72 if ($termsOfServiceEvaluation === null) {
73 $termsOfServiceEvaluation = $DIC['tos.document.evaluator'];
74 }
75 $this->termsOfServiceEvaluation = $termsOfServiceEvaluation;
76
77 if ($mainTemplate === null) {
78 $mainTemplate = $DIC->ui()->mainTemplate();
79 }
81
82 if ($httpRequest === null) {
83 $httpRequest = $DIC->http()->request();
84 }
85 $this->httpRequest = $httpRequest;
86
87 $this->ctrl = $DIC->ctrl();
88 $this->lng = $DIC->language();
89 $this->lng->loadLanguageModule('auth');
90 $this->logger = ilLoggerFactory::getLogger('init');
91 $this->authSession = $DIC['ilAuthSession'];
92 $this->eventHandler = $DIC->event();
93 $this->setting = $DIC->settings();
94 $this->access = $DIC->access();
95 $this->help = $DIC->help();
96
97 $this->http = $DIC->http();
98 $this->refinery = $DIC->refinery();
99
100 $this->ctrl->saveParameter($this, array("rep_ref_id", "lang", "target", "client_id"));
101 $this->user->setLanguage($this->lng->getLangKey());
102 $this->help->setScreenIdComponent('init');
103 }
static getLogger(string $a_component_id)
Get component logger.
ServerRequestInterface $httpRequest
ilGlobalTemplateInterface $mainTemplate
ilTermsOfServiceDocumentEvaluation $termsOfServiceEvaluation
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.

References $DIC, $httpRequest, $mainTemplate, $termsOfServiceEvaluation, $user, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkGoto()

static ilStartUpGUI::_checkGoto (   $a_target)
static

Return type depends on _checkGoto calls.

Returns
bool|mixed

Definition at line 1610 of file class.ilStartUpGUI.php.

1611 {
1612 global $DIC;
1613 global $objDefinition, $ilUser;
1614 $component_factory = $DIC["component.factory"];
1615
1616 $access = $DIC->access();
1617
1618 foreach ($component_factory->getActivePluginsInSlot("uihk") as $ui_plugin) {
1619 $gui_class = $ui_plugin->getUIClassInstance();
1620 $resp = $gui_class->checkGotoHook($a_target);
1621 if ($resp["target"] !== false) {
1622 $a_target = $resp["target"];
1623 break;
1624 }
1625 }
1626
1627 if ($a_target == "") {
1628 return false;
1629 }
1630
1631 $t_arr = explode("_", $a_target);
1632 $type = $t_arr[0];
1633
1634 if ($type == "git") {
1635 $type = "glo";
1636 }
1637
1638 if ($type == "pg" | $type == "st") {
1639 $type = "lm";
1640 }
1641
1642 $class = $objDefinition->getClassName($type);
1643 if ($class == "") {
1644 return false;
1645 }
1646
1647 $location = $objDefinition->getLocation($type);
1648 $full_class = "ilObj" . $class . "Access";
1649 include_once($location . "/class." . $full_class . ".php");
1650
1651 $ret = call_user_func(array($full_class, "_checkGoto"), $a_target);
1652
1653 // if no access and repository object => check for parent course/group
1654 if (!$ret &&
1655 !stristr($a_target, "_wsp") &&
1656 $ilUser->getId() != ANONYMOUS_USER_ID && // #10637
1657 !$objDefinition->isAdministrationObject($type) &&
1658 $objDefinition->isRBACObject($type) &&
1659 $t_arr[1]) {
1660 global $tree, $rbacsystem, $ilAccess;
1661
1662 // original type "pg" => pg_<page_id>[_<ref_id>]
1663 $ref_id = 0;
1664 if ($t_arr[0] == "pg") {
1665 if (isset($t_arr[2])) {
1666 $ref_id = (int) $t_arr[2];
1667 } else {
1668 $lm_id = ilLMObject::_lookupContObjID($t_arr[1]);
1669 $ref_ids = ilObject::_getAllReferences($lm_id);
1670 if ($ref_ids) {
1671 $ref_id = array_shift($ref_ids);
1672 }
1673 }
1674 } else {
1675 $ref_id = (int) $t_arr[1];
1676 }
1677
1678 if ($ref_id < 1) {
1679 return false;
1680 }
1681
1682 include_once "Services/Membership/classes/class.ilParticipants.php";
1683 $block_obj = array();
1684
1685 // walk path to find parent container
1686 $path = $tree->getPathId($ref_id);
1687 array_pop($path);
1688 foreach ($path as $path_ref_id) {
1689 $redirect_infopage = false;
1690 $add_member_role = false;
1691
1692 $ptype = ilObject::_lookupType($path_ref_id, true);
1693 $pobj_id = ilObject::_lookupObjId($path_ref_id);
1694
1695 // core checks: timings/object-specific
1696 if (
1697 !$access->doActivationCheck('read', '', $path_ref_id, $ilUser->getId(), $pobj_id, $ptype) ||
1698 !$access->doStatusCheck('read', '', $path_ref_id, $ilUser->getId(), $pobj_id, $ptype)
1699 ) {
1700 // object in path is inaccessible - aborting
1701 return false;
1702 } elseif ($ptype == "crs") {
1703 // check if already participant
1704 $participants = ilCourseParticipant::_getInstanceByObjId($pobj_id, $ilUser->getId());
1705 if (!$participants->isAssigned()) {
1706 // subscription currently possible?
1707 include_once "Modules/Course/classes/class.ilObjCourse.php";
1708 if (ilObjCourse::_isActivated($pobj_id) &&
1710 $block_obj[] = $path_ref_id;
1711 $add_member_role = true;
1712 } else {
1713 $redirect_infopage = true;
1714 }
1715 }
1716 } elseif ($ptype == "grp") {
1717 // check if already participant
1718 include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1719 if (!ilGroupParticipants::_isParticipant($path_ref_id, $ilUser->getId())) {
1720 // subscription currently possible?
1721 include_once "Modules/Group/classes/class.ilObjGroup.php";
1722 $group_obj = new ilObjGroup($path_ref_id);
1723 if ($group_obj->isRegistrationEnabled()) {
1724 $block_obj[] = $path_ref_id;
1725 $add_member_role = true;
1726 } else {
1727 $redirect_infopage = true;
1728 }
1729 }
1730 }
1731
1732 // add members roles for all "blocking" objects
1733 if ($add_member_role) {
1734 // cannot join? goto will never work, so redirect to current object
1735 $rbacsystem->resetPACache($ilUser->getId(), $path_ref_id);
1736 if (!$rbacsystem->checkAccess("join", $path_ref_id)) {
1737 $redirect_infopage = true;
1738 } else {
1739 $rbacsystem->addTemporaryRole(
1740 $ilUser->getId(),
1742 );
1743 }
1744 }
1745
1746 // redirect to infopage of 1st blocking object in path
1747 if ($redirect_infopage) {
1748 if ($rbacsystem->checkAccess("visible", $path_ref_id)) {
1749 ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI" .
1750 "&ref_id=" . $path_ref_id . "&cmd=infoScreen");
1751 } else {
1752 return false;
1753 }
1754 }
1755 }
1756
1757 // check if access will be possible with all (possible) member roles added
1758 $rbacsystem->resetPACache($ilUser->getId(), $ref_id);
1759 if ($rbacsystem->checkAccess("read", $ref_id) && sizeof($block_obj)) { // #12128
1760 // this won't work with lm-pages (see above)
1761 // include_once "Services/Link/classes/class.ilLink.php";
1762 // $_SESSION["pending_goto"] = ilLink::_getStaticLink($ref_id, $type);
1763
1764 // keep original target
1765 $_SESSION["pending_goto"] = "goto.php?target=" . $a_target;
1766
1767 // redirect to 1st non-member object in path
1768 ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI" .
1769 "&ref_id=" . array_shift($block_obj));
1770 }
1771 }
1772
1773 return $ret;
1774 }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static _getInstanceByObjId(int $a_obj_id, int $a_usr_id)
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
static _lookupContObjID(int $a_id)
get learning module id for lm object
static _registrationEnabled(int $a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
static _isActivated(int $a_obj_id)
Is activated.
Class ilObjGroup.
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
static getDefaultMemberRole(int $a_ref_id)
ilAccessHandler $access
static redirect(string $a_script)
const ANONYMOUS_USER_ID
Definition: constants.php:27
$ilUser
Definition: imgupload.php:34
doActivationCheck(string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id, int $a_obj_id, string $a_type)
check for activation and centralized offline status.
doStatusCheck(string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id, int $a_obj_id, string $a_type)
object type specific check
$ref_id
Definition: ltiauth.php:67
$path
Definition: ltiservices.php:32
$type

References $DIC, $ilUser, $location, $path, $ref_id, XapiProxy\$resp, $type, ilObject\_getAllReferences(), ilCourseParticipant\_getInstanceByObjId(), ilObjCourse\_isActivated(), ilGroupParticipants\_isParticipant(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjCourse\_registrationEnabled(), ANONYMOUS_USER_ID, ilRBACAccessHandler\doActivationCheck(), ilRBACAccessHandler\doStatusCheck(), ilParticipants\getDefaultMemberRole(), ILIAS\Repository\int(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ confirmAcceptance()

ilStartUpGUI::confirmAcceptance ( )
protected

Definition at line 1443 of file class.ilStartUpGUI.php.

1443 : void
1444 {
1445 $this->showTermsOfService(true);
1446 }
showTermsOfService(bool $accepted=false)
Show terms of service.

◆ confirmWithdrawal()

ilStartUpGUI::confirmWithdrawal ( )
protected

Definition at line 1448 of file class.ilStartUpGUI.php.

1448 : void
1449 {
1450 if (!$this->user->getId()) {
1451 $this->user->setId(ANONYMOUS_USER_ID);
1452 }
1453 $back_to_login = false;
1454 if ($this->user->getPref('consent_withdrawal_requested') != 1) {
1455 $back_to_login = true;
1456 }
1457 $tpl = self::initStartUpTemplate('tpl.view_terms_of_service.html', $back_to_login, !$back_to_login);
1458
1459 $helper = new ilTermsOfServiceHelper();
1460 $handleDocument = $helper->isGloballyEnabled() && $this->termsOfServiceEvaluation->hasDocument();
1461 if ($handleDocument) {
1462 $document = $this->termsOfServiceEvaluation->document();
1463 if ('confirmWithdrawal' === $this->ctrl->getCmd()) {
1464 if (isset($this->httpRequest->getParsedBody()['status']) && 'withdrawn' === $this->httpRequest->getParsedBody()['status']) {
1465 $helper->deleteAcceptanceHistoryByUser($this->user->getId());
1466 $this->ctrl->redirectToUrl(self::logoutUrl());
1467 }
1468 }
1469
1470 $tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, $this->ctrl->getCmd()));
1471 $tpl->setVariable('ACCEPT_CHECKBOX', ilLegacyFormElementsUtil::formCheckbox(0, 'status', 'accepted'));
1472 $tpl->setVariable('ACCEPT_TERMS_OF_SERVICE', $this->lng->txt('accept_usr_agreement'));
1473 $tpl->setVariable('TXT_SUBMIT', $this->lng->txt('submit'));
1474
1475 $tpl->setPermanentLink('usr', null, 'agreement');
1476 $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $document->content());
1477 } else {
1478 $tpl->setVariable(
1479 'TERMS_OF_SERVICE_CONTENT',
1480 sprintf(
1481 $this->lng->txt('no_agreement_description'),
1484 )
1485 )
1486 );
1487 }
1488
1490 }
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=false)
static prepareFormOutput($a_str, bool $a_strip=false)
static printToGlobalTemplate($tpl)
static getMailsToAddress()
Get mailto: emails.
Class ilTermsOfServiceHelper.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $tpl, ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ilLegacyFormElementsUtil\formCheckbox(), ilSystemSupportContacts\getMailsToAddress(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\prepareFormOutput(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ doApacheAuthentication()

ilStartUpGUI::doApacheAuthentication ( )
protected

Try apache auth.

Definition at line 649 of file class.ilStartUpGUI.php.

649 : void
650 {
651 $this->getLogger()->debug('Trying apache authentication');
652
653 $credentials = new \ilAuthFrontendCredentialsApache($this->httpRequest, $this->ctrl);
654 $credentials->initFromRequest();
655
656 $provider_factory = new \ilAuthProviderFactory();
657 $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_APACHE);
658
659 $status = \ilAuthStatus::getInstance();
660
661 $frontend_factory = new \ilAuthFrontendFactory();
662 $frontend_factory->setContext(\ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
663 $frontend = $frontend_factory->getFrontend(
664 $this->authSession,
665 $status,
666 $credentials,
667 array($provider)
668 );
669
670 $frontend->authenticate();
671
672 switch ($status->getStatus()) {
673 case \ilAuthStatus::STATUS_AUTHENTICATED:
674 if ($credentials->hasValidTargetUrl()) {
675 $this->logger->debug(sprintf(
676 'Authentication successful. Redirecting to starting page: %s',
677 $credentials->getTargetUrl()
678 ));
679 $this->ctrl->redirectToURL($credentials->getTargetUrl());
680 } else {
681 $this->logger->debug(
682 'Authentication successful, but no valid target URL given. Redirecting to default starting page.'
683 );
685 }
686 break;
687
688 case \ilAuthStatus::STATUS_ACCOUNT_MIGRATION_REQUIRED:
689 $this->ctrl->redirect($this, 'showAccountMigration');
690 break;
691
692 case \ilAuthStatus::STATUS_AUTHENTICATION_FAILED:
693 $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
694 $this->ctrl->redirectToURL(\ilUtil::appendUrlParameterString(
695 $this->ctrl->getLinkTarget($this, 'showLoginPage', '', false, false),
696 'passed_sso=1'
697 ));
698 break;
699 }
700
701 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
702 $this->showLoginPage();
703 }
static getInstance()
Get status instance.
static redirectToStartingPage(string $target='')
showLoginPage(ilPropertyFormGUI $form=null)
getLogger()
Get logger.
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
$provider
Definition: ltitoken.php:83

References $provider, ilUtil\appendUrlParameterString(), ilAuthUtils\AUTH_APACHE, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilAuthStatus\getInstance(), getLogger(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), and showLoginPage().

+ Here is the call graph for this function:

◆ doCasAuthentication()

ilStartUpGUI::doCasAuthentication ( )
protected

Definition at line 567 of file class.ilStartUpGUI.php.

567 : void
568 {
569 $this->getLogger()->debug('Trying cas authentication');
570 $credentials = new ilAuthFrontendCredentialsCAS();
571
572 $provider_factory = new ilAuthProviderFactory();
573 $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_CAS);
574
575 $status = ilAuthStatus::getInstance();
576
577 $frontend_factory = new ilAuthFrontendFactory();
578 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
579 $frontend = $frontend_factory->getFrontend(
580 $this->authSession,
581 $status,
582 $credentials,
583 array($provider)
584 );
585
586 $frontend->authenticate();
587 switch ($status->getStatus()) {
589 $this->getLogger()->debug('Authentication successful.');
591 break;
592
594 default:
595 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt($status->getReason()));
596 $this->showLoginPage();
597 }
598 }
Auth frontend credentials for CAS auth.
Factory for auth frontend classes.
const STATUS_AUTHENTICATION_FAILED

References $provider, ilAuthUtils\AUTH_CAS, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), getLogger(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), showLoginPage(), ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

+ Here is the call graph for this function:

◆ doLogout()

ilStartUpGUI::doLogout ( )

show logout screen

Definition at line 1361 of file class.ilStartUpGUI.php.

1361 : void
1362 {
1363 global $DIC;
1364
1365 $ilIliasIniFile = $DIC['ilIliasIniFile'];
1366
1367 $this->eventHandler->raise(
1368 'Services/Authentication',
1369 'beforeLogout',
1370 [
1371 'user_id' => $this->user->getId()
1372 ]
1373 );
1374
1375 $user_language = $this->user->getLanguage();
1376
1377 $tosWithdrawalGui = new ilTermsOfServiceWithdrawalGUIHelper($this->user);
1378 $tosWithdrawalGui->handleWithdrawalLogoutRequest($this->httpRequest, $this);
1379
1380 $had_external_authentication = ilSession::get('used_external_auth');
1381
1383 $this->authSession->logout();
1384 $this->eventHandler->raise(
1385 'Services/Authentication',
1386 'afterLogout',
1387 array(
1388 'username' => $this->user->getLogin()
1389 )
1390 );
1391 if ((int) $this->user->getAuthMode(true) == ilAuthUtils::AUTH_SAML && $had_external_authentication) {
1392 $this->logger->info('Redirecting user to SAML logout script');
1393 $this->ctrl->redirectToURL('saml.php?action=logout&logout_url=' . urlencode(ILIAS_HTTP_PATH . '/login.php'));
1394 }
1395
1396 // reset cookie
1397 ilUtil::setCookie("ilClientId", "");
1398
1399 // redirect and show logout information
1400 $this->ctrl->setParameter($this, 'client_id', CLIENT_ID);
1401 $this->ctrl->setParameter($this, 'lang', $user_language);
1402 $this->ctrl->redirect($this, 'showLogout');
1403 }
static get(string $a_var)
const SESSION_CLOSE_USER
static setClosingContext(int $a_context)
set closing context (for statistics)
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)
const CLIENT_ID
Definition: constants.php:41
$ilIliasIniFile
Definition: imgupload.php:32

References $DIC, $ilIliasIniFile, ilAuthUtils\AUTH_SAML, CLIENT_ID, ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\logger(), ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), ilUtil\setCookie(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ doLTIAuthentication()

ilStartUpGUI::doLTIAuthentication ( )
protected

Handle lti requests.

Definition at line 603 of file class.ilStartUpGUI.php.

603 : void
604 {
605 $this->getLogger()->debug('Trying lti authentication');
606
607 $credentials = new ilAuthFrontendCredentialsLTI();
608 $credentials->initFromRequest();
609
610 $provider_factory = new ilAuthProviderFactory();
611 $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_PROVIDER_LTI);
612
613 $status = ilAuthStatus::getInstance();
614
615 $frontend_factory = new ilAuthFrontendFactory();
616 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
617 $frontend = $frontend_factory->getFrontend(
618 $this->authSession,
619 $status,
620 $credentials,
621 array($provider)
622 );
623
624 $frontend->authenticate();
625
626 switch ($status->getStatus()) {
628 ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
630 return;
631
633 $this->ctrl->redirect($this, 'showAccountMigration');
634 return;
635
637 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt($status->getReason()), true);
638 $this->ctrl->redirect($this, 'showLoginPage');
639 return;
640 }
641
642 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
643 $this->showLoginPage();
644 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const STATUS_ACCOUNT_MIGRATION_REQUIRED

References $provider, ilAuthUtils\AUTH_PROVIDER_LTI, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilAuthStatus\getInstance(), getLogger(), ilLoggerFactory\getLogger(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

+ Here is the call graph for this function:

◆ doMigration()

ilStartUpGUI::doMigration ( )
protected

Definition at line 1245 of file class.ilStartUpGUI.php.

1245 : bool
1246 {
1247 $username = '';
1248 if ($this->http->wrapper()->post()->has('mig_username')) {
1249 $username = $this->http->wrapper()->post()->retrieve(
1250 'mig_username',
1251 $this->refinery->kindlyTo()->string()
1252 );
1253 }
1254 $password = '';
1255 if ($this->http->wrapper()->post()->has('mig_password')) {
1256 $password = $this->http->wrapper()->post()->retrieve(
1257 'mig_password',
1258 $this->refinery->kindlyTo()->string()
1259 );
1260 }
1261
1262 $this->logger->debug('Starting account migration for user: ' . ilSession::get('mig_ext_account'));
1263
1264 $credentials = new ilAuthFrontendCredentials();
1265 $credentials->setUsername($username);
1266 $credentials->setPassword($password);
1267
1268 $provider_factory = new ilAuthProviderFactory();
1269 $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_LOCAL);
1270
1271 $status = ilAuthStatus::getInstance();
1272
1273 $frontend_factory = new ilAuthFrontendFactory();
1274 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1275 $frontend = $frontend_factory->getFrontend(
1276 $this->authSession,
1277 $status,
1278 $credentials,
1279 array($provider)
1280 );
1281
1282 $frontend->authenticate();
1283
1284 switch ($status->getStatus()) {
1286 $this->getLogger()->debug('Account migration: authentication successful for ' . $username);
1287
1288 $provider = $provider_factory->getProviderByAuthMode(
1289 $credentials,
1291 );
1292 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1293 $frontend = $frontend_factory->getFrontend(
1294 $GLOBALS['DIC']['ilAuthSession'],
1295 $status,
1296 $credentials,
1297 [$provider]
1298 );
1299 if (
1300 $frontend->migrateAccount($GLOBALS['DIC']['ilAuthSession'])
1301 ) {
1303 } else {
1304 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'), true);
1305 $this->ctrl->redirect($this, 'showAccountMigration');
1306 }
1307 break;
1308
1309 default:
1310 $this->getLogger()->info('Account migration failed for user ' . $username);
1311 $this->showAccountMigration($GLOBALS['lng']->txt('err_wrong_login'));
1312 return false;
1313 }
1314 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
showAccountMigration(string $message='')
Show account migration screen.

References $GLOBALS, $provider, ilAuthUtils\AUTH_LOCAL, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilSession\get(), ilAuthStatus\getInstance(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilAuthFrontend\MIG_TRIGGER_AUTHMODE, ilInitialisation\redirectToStartingPage(), ILIAS\Repository\refinery(), and ilAuthStatus\STATUS_AUTHENTICATED.

+ Here is the call graph for this function:

◆ doMigrationNewAccount()

ilStartUpGUI::doMigrationNewAccount ( )
protected

Definition at line 1211 of file class.ilStartUpGUI.php.

1211 : bool
1212 {
1213 $credentials = new ilAuthFrontendCredentials();
1214 $credentials->setUsername(ilSession::get(ilAuthFrontend::MIG_EXTERNAL_ACCOUNT));
1215
1216 $provider_factory = new ilAuthProviderFactory();
1217 $provider = $provider_factory->getProviderByAuthMode(
1218 $credentials,
1220 );
1221
1222 $this->logger->debug('Using provider: ' . get_class($provider) . ' for further processing.');
1223
1224 $status = ilAuthStatus::getInstance();
1225
1226 $frontend_factory = new ilAuthFrontendFactory();
1227 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1228 $frontend = $frontend_factory->getFrontend(
1229 $GLOBALS['DIC']['ilAuthSession'],
1230 $status,
1231 $credentials,
1232 [$provider]
1233 );
1234
1235 if ($frontend->migrateAccountNew()) {
1237 }
1238
1239 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
1240 $this->ctrl->redirect($this, 'showAccountMigration');
1241
1242 return true;
1243 }

References $GLOBALS, $provider, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilSession\get(), ilAuthStatus\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilAuthFrontend\MIG_EXTERNAL_ACCOUNT, ilAuthFrontend\MIG_TRIGGER_AUTHMODE, and ilInitialisation\redirectToStartingPage().

+ Here is the call graph for this function:

◆ doOpenIdConnectAuthentication()

ilStartUpGUI::doOpenIdConnectAuthentication ( )
protected

do open id connect authentication

Definition at line 1999 of file class.ilStartUpGUI.php.

1999 : void
2000 {
2001 $this->getLogger()->debug('Trying openid connect authentication');
2002
2003 $credentials = new ilAuthFrontendCredentialsOpenIdConnect();
2004 $credentials->initFromRequest();
2005
2006 $provider_factory = new ilAuthProviderFactory();
2007 $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_OPENID_CONNECT);
2008
2009 $status = ilAuthStatus::getInstance();
2010
2011 $frontend_factory = new ilAuthFrontendFactory();
2012 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
2013 $frontend = $frontend_factory->getFrontend(
2014 $this->authSession,
2015 $status,
2016 $credentials,
2017 array($provider)
2018 );
2019
2020 $frontend->authenticate();
2021
2022 switch ($status->getStatus()) {
2024 $this->logger->debug('Authentication successful; Redirecting to starting page.');
2025 if ($credentials->getRedirectionTarget()) {
2026 ilInitialisation::redirectToStartingPage($credentials->getRedirectionTarget());
2027 } else {
2029 }
2030 return;
2031
2033 $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
2034 $this->ctrl->redirect($this, 'showLoginPage');
2035 return;
2036 }
2037 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
2038 $this->showLoginPage();
2039 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const AUTH_OPENID_CONNECT

References $provider, ilAuthUtils\AUTH_OPENID_CONNECT, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilAuthStatus\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

+ Here is the call graph for this function:

◆ doSamlAuthentication()

ilStartUpGUI::doSamlAuthentication ( )
protected

Definition at line 2041 of file class.ilStartUpGUI.php.

2041 : void
2042 {
2043 $this->getLogger()->debug('Trying saml authentication');
2044 $request = $this->httpRequest;
2045 $params = $request->getQueryParams();
2046
2048 $auth = $factory->auth();
2049
2050 if (isset($params['action']) && $params['action'] === 'logout') {
2051 $logout_url = $params['logout_url'] ?? '';
2052 $this->logger->info(sprintf('Requested SAML logout: %s', $logout_url));
2053 $auth->logout($logout_url);
2054 }
2055
2056 if (isset($params['target']) && !isset($params['returnTo'])) {
2057 $params['returnTo'] = $params['target'];
2058 }
2059 if (isset($params['returnTo'])) {
2060 $auth->storeParam('target', $params['returnTo']);
2061 }
2062
2063 $this->logger->debug('Started SAML authentication request');
2064 if (!$auth->isAuthenticated()) {
2065 ilLoggerFactory::getLogger('auth')->debug('User is not authenticated, yet');
2066 if (!isset($request->getQueryParams()['idpentityid'], $request->getQueryParams()['saml_idp_id'])) {
2067 $activeIdps = ilSamlIdp::getActiveIdpList();
2068 if (1 === count($activeIdps)) {
2069 $idp = current($activeIdps);
2070
2071 ilLoggerFactory::getLogger('auth')->debug(sprintf(
2072 'Found exactly one active IDP with id %s: %s',
2073 $idp->getIdpId(),
2074 $idp->getEntityId()
2075 ));
2076
2077 $this->ctrl->setParameter($this, 'idpentityid', $idp->getEntityId());
2078 $this->ctrl->setParameter($this, 'saml_idp_id', $idp->getIdpId());
2079 $this->ctrl->setTargetScript('saml.php');
2080 $this->ctrl->redirect($this, 'doSamlAuthentication');
2081 } elseif ($activeIdps === []) {
2082 $this->logger->debug('Did not find any active IDP, skipp authentication process');
2083 $this->ctrl->redirect($this, 'showLoginPage');
2084 } else {
2085 $this->logger->debug('Found multiple active IPDs, presenting IDP selection...');
2086 $this->showSamlIdpSelection($auth, $activeIdps);
2087 return;
2088 }
2089 }
2090
2091 $auth->storeParam('idpId', (int) $request->getQueryParams()['saml_idp_id']);
2092 $this->logger->debug(sprintf(
2093 'Stored relevant IDP id in session: %s',
2094 (string) $auth->getParam('idpId')
2095 ));
2096 }
2097
2098 // re-init
2099 $auth = $factory->auth();
2100
2101 $this->logger->debug('Checking SAML authentication status...');
2102 $auth->protectResource();
2103 $this->logger->debug(
2104 'SAML authentication successful, continuing with ILIAS internal authentication process...'
2105 );
2106
2107 $idpId = (int) $auth->getParam('idpId');
2108
2109 $this->logger->debug(sprintf(
2110 'Internal SAML IDP id fetched from session: %s',
2111 (string) $idpId
2112 ));
2113
2114 if ($idpId < 1) {
2115 $this->logger->debug(
2116 'No valid internal IDP id found (most probably due to IDP initiated SSO), trying fallback determination...'
2117 );
2118 $authData = $auth->getAuthDataArray();
2119 if (isset($authData['saml:sp:IdP'])) {
2120 $idpId = ilSamlIdp::geIdpIdByEntityId($authData['saml:sp:IdP']);
2121 $this->logger->debug(sprintf(
2122 'Searching active ILIAS IDP by entity id "%s" results in: %s',
2123 $authData['saml:sp:IdP'],
2124 (string) $idpId
2125 ));
2126 } else {
2127 $this->logger->debug(
2128 'Could not execute fallback determination, no IDP entity ID found SAML authentication session data'
2129 );
2130 }
2131 }
2132
2133 $target = $auth->popParam('target');
2134
2135 $this->logger->debug(sprintf(
2136 'Retrieved "target" parameter: %s',
2137 print_r($target, true)
2138 ));
2139
2140 $credentials = new ilAuthFrontendCredentialsSaml($auth, $request);
2141 $credentials->initFromRequest();
2142
2143 $provider_factory = new ilAuthProviderFactory();
2144 $provider = $provider_factory->getProviderByAuthMode($credentials, ilUtil::stripSlashes(
2145 ilAuthUtils::AUTH_SAML . '_' . $idpId
2146 ));
2147
2148 if ($target) {
2149 $credentials->setReturnTo($target);
2150 }
2151
2152 $status = ilAuthStatus::getInstance();
2153
2154 $frontend_factory = new ilAuthFrontendFactory();
2155 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
2156 $frontend = $frontend_factory->getFrontend(
2157 $this->authSession,
2158 $status,
2159 $credentials,
2160 [$provider]
2161 );
2162
2163 $frontend->authenticate();
2164
2165 switch ($status->getStatus()) {
2167 $this->logger->debug('Authentication successful; Redirecting to starting page.');
2169 return;
2170
2172 $this->ctrl->redirect($this, 'showAccountMigration');
2173 return;
2174
2176 $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
2177 $this->ctrl->redirect($this, 'showLoginPage');
2178 return;
2179 }
2180
2181 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
2182 $this->showLoginPage();
2183 }
Class ilAuthFrontendCredentialsSaml.
Class ilSamlAuthFactory.
static getActiveIdpList()
static geIdpIdByEntityId(string $entityId)
showSamlIdpSelection(ilSamlAuth $auth, array $idps)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
$factory
Definition: metadata.php:75
$auth
Definition: metadata.php:76

References $auth, $factory, $params, $provider, ilAuthUtils\AUTH_SAML, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilSamlIdp\geIdpIdByEntityId(), ilSamlIdp\getActiveIdpList(), ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, ilAuthStatus\STATUS_AUTHENTICATION_FAILED, and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ doShibbolethAuthentication()

ilStartUpGUI::doShibbolethAuthentication ( )
protected

Trying shibboleth authentication.

Definition at line 525 of file class.ilStartUpGUI.php.

525 : void
526 {
527 $this->getLogger()->debug('Trying shibboleth authentication');
528
529 $credentials = new ilAuthFrontendCredentialsShibboleth();
530 $credentials->initFromRequest();
531
532 $provider_factory = new ilAuthProviderFactory();
533 $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_SHIBBOLETH);
534
535 $status = ilAuthStatus::getInstance();
536
537 $frontend_factory = new ilAuthFrontendFactory();
538 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
539 $frontend = $frontend_factory->getFrontend(
540 $this->authSession,
541 $status,
542 $credentials,
543 array($provider)
544 );
545
546 $frontend->authenticate();
547
548 switch ($status->getStatus()) {
550 $this->logger->debug('Authentication successful; Redirecting to starting page.');
552 return;
553
555 $this->ctrl->redirect($this, 'showAccountMigration');
556 return;
557
559 $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
560 $this->ctrl->redirect($this, 'showLoginPage');
561 return;
562 }
563 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
564 $this->showLoginPage();
565 }

References $provider, ilAuthUtils\AUTH_SHIBBOLETH, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilAuthStatus\getInstance(), getLogger(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

+ Here is the call graph for this function:

◆ doStandardAuthentication()

ilStartUpGUI::doStandardAuthentication ( )
protected

Check form input; authenticate user.

Definition at line 708 of file class.ilStartUpGUI.php.

708 : void
709 {
710 $form = $this->initStandardLoginForm();
711 if ($form->checkInput()) {
712 $this->getLogger()->debug('Trying to authenticate user.');
713
714 $auth_callback = function () use ($form) {
715 include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendCredentials.php';
716 $credentials = new ilAuthFrontendCredentials();
717 $credentials->setUsername($form->getInput('username'));
718 $credentials->setPassword($form->getInput('password'));
719
720 // set chosen auth mode
721 include_once './Services/Authentication/classes/class.ilAuthModeDetermination.php';
723 if (ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection()) {
724 $credentials->setAuthMode($form->getInput('auth_mode'));
725 }
726
727 include_once './Services/Authentication/classes/Provider/class.ilAuthProviderFactory.php';
728 $provider_factory = new ilAuthProviderFactory();
729 $providers = $provider_factory->getProviders($credentials);
730
731 include_once './Services/Authentication/classes/class.ilAuthStatus.php';
732 $status = ilAuthStatus::getInstance();
733
734 include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendFactory.php';
735 $frontend_factory = new ilAuthFrontendFactory();
736 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
737 $frontend = $frontend_factory->getFrontend(
738 $this->authSession,
739 $status,
740 $credentials,
741 $providers
742 );
743
744 $frontend->authenticate();
745
746 return $status;
747 };
748
749 if (null !== ($auth_duration = $this->setting->get("auth_duration"))) {
750 $duration = $this->http->durations()->callbackDuration((int) $auth_duration);
751 $status = $duration->stretch($auth_callback);
752 } else {
753 $status = $auth_callback();
754 }
755
756 switch ($status->getStatus()) {
758 ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
760 return;
761
763 $uname = ilObjUser::_lookupLogin($status->getAuthenticatedUserId());
764 $this->showLoginPage($this->initCodeForm($uname));
765 return;
766
768 $this->ctrl->redirect($this, 'showAccountMigration');
769 // no break
771 $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason());
772 $this->showLoginPage($form);
773 return;
774 }
775 }
776 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
777 $this->showLoginPage($form);
778 }
const STATUS_CODE_ACTIVATION_REQUIRED
static _hasMultipleAuthenticationMethods()
static _lookupLogin(int $a_user_id)
initStandardLoginForm()
Initialize the standard.
initCodeForm(string $a_username)

References ilAuthModeDetermination\_getInstance(), ilAuthUtils\_hasMultipleAuthenticationMethods(), ilObjUser\_lookupLogin(), ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilAuthStatus\getInstance(), getLogger(), ilLoggerFactory\getLogger(), ILIAS\FileDelivery\http(), initCodeForm(), initStandardLoginForm(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, ilAuthStatus\STATUS_AUTHENTICATION_FAILED, and ilAuthStatus\STATUS_CODE_ACTIVATION_REQUIRED.

+ Here is the call graph for this function:

◆ executeCommand()

ilStartUpGUI::executeCommand ( )

execute command

Returns
mixed
See also
register.php

Definition at line 141 of file class.ilStartUpGUI.php.

142 {
143 $cmd = $this->ctrl->getCmd("processIndexPHP");
144 $next_class = $this->ctrl->getNextClass($this);
145 switch ($next_class) {
146 case 'ilLoginPageGUI':
147 break;
148
149 case "ilaccountregistrationgui":
150 require_once("Services/Registration/classes/class.ilAccountRegistrationGUI.php");
151 return $this->ctrl->forwardCommand(new ilAccountRegistrationGUI());
152
153 case "ilpasswordassistancegui":
154 require_once("Services/Init/classes/class.ilPasswordAssistanceGUI.php");
155 return $this->ctrl->forwardCommand(new ilPasswordAssistanceGUI());
156
157 case strtolower(ilAccessibilityControlConceptGUI::class):
158 return $this->ctrl->forwardCommand(new ilAccessibilityControlConceptGUI());
159
160 default:
161 if (method_exists($this, $cmd)) {
162 $this->$cmd();
163 return null;
164 }
165 }
166
167 // because this class now implements ilCtrlSecurityInterface,
168 // it may occur that commands are null, therefore I added
169 // this as a fallback method.
170 $this->showLoginPageOrStartupPage();
171 return null;
172 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilAccountRegistrationGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']

References ILIAS\Repository\ctrl().

Referenced by jumpToPasswordAssistance(), and jumpToRegistration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAcceptance()

ilStartUpGUI::getAcceptance ( )
protected

Get terms of service.

Definition at line 1438 of file class.ilStartUpGUI.php.

1438 : void
1439 {
1440 $this->showTermsOfService();
1441 }

◆ getLogger()

ilStartUpGUI::getLogger ( )

Get logger.

Definition at line 177 of file class.ilStartUpGUI.php.

177 : ilLogger
178 {
179 return $this->logger;
180 }
Component logger with individual log levels by component id.

References $logger.

Referenced by doApacheAuthentication(), doCasAuthentication(), doLTIAuthentication(), doShibbolethAuthentication(), doStandardAuthentication(), and showLoginPage().

+ Here is the caller graph for this function:

◆ getLoginPageEditorHTML()

ilStartUpGUI::getLoginPageEditorHTML ( )
protected

Get HTML of ILIAS login page editor.

Returns
string html

Definition at line 968 of file class.ilStartUpGUI.php.

968 : string
969 {
970 include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php';
972 $active_lang = $lpe->getIliasEditorLanguage($this->lng->getLangKey());
973
974 if (!$active_lang) {
975 return '';
976 }
977
978 // if page does not exist, return nothing
979 include_once './Services/COPage/classes/class.ilPageUtil.php';
980 if (!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang))) {
981 return '';
982 }
983
984 // get page object
985 $page_gui = new ilLoginPageGUI(ilLanguage::lookupId($active_lang));
986
987 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
988 $page_gui->setStyleId(0);
989
990 $page_gui->setPresentationTitle("");
991 $page_gui->setTemplateOutput(false);
992 $page_gui->setHeader("");
993 $ret = $page_gui->showPage();
994
995 return $ret;
996 }
static lookupId(string $a_lang_key)
Lookup obj_id of language.
Login page GUI class.
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)

References ilPageUtil\_existsAndNotEmpty(), ilAuthLoginPageEditorSettings\getInstance(), ILIAS\Repository\lng(), and ilLanguage\lookupId().

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSafePostCommands()

ilStartUpGUI::getSafePostCommands ( )

@inheritDoc

Implements ilCtrlSecurityInterface.

Definition at line 129 of file class.ilStartUpGUI.php.

129 : array
130 {
131 return [
132 'doStandardAuthentication',
133 ];
134 }

◆ getUnsafeGetCommands()

ilStartUpGUI::getUnsafeGetCommands ( )

@inheritDoc

Implements ilCtrlSecurityInterface.

Definition at line 119 of file class.ilStartUpGUI.php.

119 : array
120 {
121 return [
122 'doLogout'
123 ];
124 }

◆ initCodeForm()

ilStartUpGUI::initCodeForm ( string  $a_username)
protected

Definition at line 371 of file class.ilStartUpGUI.php.

372 {
373 $this->lng->loadLanguageModule("auth");
374 $form = new ilPropertyFormGUI();
375 $form->setFormAction($this->ctrl->getFormAction($this, 'showcodeform'));
376 $form->setTitle($this->lng->txt('auth_account_code_title'));
377
378 $count = new ilTextInputGUI($this->lng->txt('auth_account_code'), 'code');
379 $count->setRequired(true);
380 $count->setInfo($this->lng->txt('auth_account_code_info'));
381 $form->addItem($count);
382
383 // #11658
384 $uname = new ilHiddenInputGUI("uname");
385 $uname->setValue($a_username);
386 $form->addItem($uname);
387 $form->addCommandButton('processCode', $this->lng->txt('send'));
388 return $form;
389 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
This class represents a text property in a property form.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by doStandardAuthentication(), processCode(), and showCodeForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStandardLoginForm()

ilStartUpGUI::initStandardLoginForm ( )
protected

Initialize the standard.

Returns
\ilPropertyFormGUI

Definition at line 466 of file class.ilStartUpGUI.php.

467 {
468 include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
469 $form = new ilPropertyFormGUI();
470 $form->setFormAction($this->ctrl->getFormAction($this, 'doStandardAuthentication'));
471 $form->setName("formlogin");
472 $form->setShowTopButtons(false);
473 $form->setTitle($this->lng->txt("login_to_ilias"));
474
475 include_once './Services/Authentication/classes/class.ilAuthModeDetermination.php';
477 if (ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection()) {
478 $visible_auth_methods = array();
479 $radg = new ilRadioGroupInputGUI($this->lng->txt("auth_selection"), "auth_mode");
480 foreach (ilAuthUtils::_getMultipleAuthModeOptions($this->lng) as $key => $option) {
481 if (isset($option['hide_in_ui']) && $option['hide_in_ui']) {
482 continue;
483 }
484
485 $op1 = new ilRadioOption($option['txt'], $key);
486 $radg->addOption($op1);
487 if (isset($option['checked'])) {
488 $radg->setValue($key);
489 }
490 $visible_auth_methods[] = $op1;
491 }
492
493 if (count($visible_auth_methods) === 1) {
494 $first_auth_method = current($visible_auth_methods);
495 $hidden_auth_method = new ilHiddenInputGUI("auth_mode");
496 $hidden_auth_method->setValue($first_auth_method->getValue());
497 $form->addItem($hidden_auth_method);
498 } else {
499 $form->addItem($radg);
500 }
501 }
502
503 $ti = new ilTextInputGUI($this->lng->txt("username"), "username");
504 $ti->setSize(20);
505 $ti->setRequired(true);
506 $form->addItem($ti);
507
508 $pi = new ilPasswordInputGUI($this->lng->txt("password"), "password");
509 $pi->setUseStripSlashes(false);
510 $pi->setRetype(false);
511 $pi->setSkipSyntaxCheck(true);
512 $pi->setSize(20);
513 $pi->setDisableHtmlAutoComplete(false);
514 $pi->setRequired(true);
515 $form->addItem($pi);
516
517 $form->addCommandButton("doStandardAuthentication", $this->lng->txt("log_in"));
518
519 return $form;
520 }
static _getMultipleAuthModeOptions(ilLanguage $lng)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key, ilAuthModeDetermination\_getInstance(), ilAuthUtils\_getMultipleAuthModeOptions(), ilAuthUtils\_hasMultipleAuthenticationMethods(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by doStandardAuthentication(), and showLoginForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTargetFromQuery()

ilStartUpGUI::initTargetFromQuery ( )
protected

Definition at line 105 of file class.ilStartUpGUI.php.

105 : string
106 {
107 if ($this->http->wrapper()->query()->has('target')) {
108 return $this->http->wrapper()->query()->retrieve(
109 'target',
110 $this->refinery->kindlyTo()->string()
111 );
112 }
113 return '';
114 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by showShibbolethLoginForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jumpToPasswordAssistance()

ilStartUpGUI::jumpToPasswordAssistance ( )

jump to password assistance

See also
pwassist.php

Definition at line 197 of file class.ilStartUpGUI.php.

197 : void
198 {
199 $this->ctrl->setCmdClass("ilpasswordassistancegui");
200 $this->ctrl->setCmd("");
201 $this->executeCommand();
202 }
executeCommand()
execute command

References ILIAS\Repository\ctrl(), and executeCommand().

+ Here is the call graph for this function:

◆ jumpToRegistration()

ilStartUpGUI::jumpToRegistration ( )

jump to registration gui

See also
register.php

Definition at line 186 of file class.ilStartUpGUI.php.

186 : void
187 {
188 $this->ctrl->setCmdClass("ilaccountregistrationgui");
189 $this->ctrl->setCmd("");
190 $this->executeCommand();
191 }

References ILIAS\Repository\ctrl(), and executeCommand().

+ Here is the call graph for this function:

◆ logoutUrl()

static ilStartUpGUI::logoutUrl ( array  $parameters = [])
static

Return the logout URL with a valid CSRF token.

Without the token the logout won't be successful.

Parameters
array<string,string>$parameters

Definition at line 2226 of file class.ilStartUpGUI.php.

2226 : string
2227 {
2228 global $DIC;
2229
2230 $defaults = ['lang' => $DIC->user()->getCurrentLanguage()];
2231 $parameters = '&' . http_build_query(array_merge($defaults, $parameters));
2232
2233 $DIC->ctrl()->setTargetScript('logout.php');
2234 $url = $DIC->ctrl()->getLinkTargetByClass([self::class], 'doLogout') . $parameters;
2235 $DIC->ctrl()->setTargetScript('ilias.php');
2236
2237 return $url;
2238 }
$url

References $DIC, and $url.

Referenced by ILIAS\User\Provider\UserMetaBarProvider\getMetaBarItems(), ilTermsOfServiceWithdrawalGUIHelper\getWithdrawalSectionForModal(), and ilAuthProviderOpenIdConnect\handleLogout().

+ Here is the caller graph for this function:

◆ migrateAccount()

ilStartUpGUI::migrateAccount ( )
protected

Definition at line 1176 of file class.ilStartUpGUI.php.

1176 : void
1177 {
1178 if (!isset($this->httpRequest->getParsedBody()['account_migration'])) {
1179 $this->showAccountMigration(
1180 $this->lng->txt('select_one')
1181 );
1182 return;
1183 }
1184
1185 if (
1186 ((int) $this->httpRequest->getParsedBody()['account_migration'] === self::ACCOUNT_MIGRATION_MIGRATE) &&
1187 (
1188 !isset($this->httpRequest->getParsedBody()['mig_username']) ||
1189 !is_string($this->httpRequest->getParsedBody()['mig_username']) ||
1190 0 === strlen($this->httpRequest->getParsedBody()['mig_username']) ||
1191 !isset($this->httpRequest->getParsedBody()['mig_password']) ||
1192 !is_string($this->httpRequest->getParsedBody()['mig_password'])
1193 )
1194 ) {
1195 $this->showAccountMigration(
1196 $this->lng->txt('err_wrong_login')
1197 );
1198 return;
1199 }
1200
1201 if ((int) $this->httpRequest->getParsedBody()['account_migration'] == self::ACCOUNT_MIGRATION_MIGRATE) {
1202 $this->doMigration();
1203 return;
1204 } elseif ((int) $this->httpRequest->getParsedBody()['account_migration'] == static::ACCOUNT_MIGRATION_NEW) {
1205 $this->doMigrationNewAccount();
1206 return;
1207 }
1208 return;
1209 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ printToGlobalTemplate()

static ilStartUpGUI::printToGlobalTemplate (   $tpl)
static
Parameters
ilTemplate | ilGlobalTemplateInterface$tpl

Definition at line 333 of file class.ilStartUpGUI.php.

333 : void
334 {
335 global $DIC;
336 $gtpl = $DIC['tpl'];
337 $gtpl->setContent($tpl->get());
338 $gtpl->printToStdout("DEFAULT", false, true);
339 }

References $DIC, and $tpl.

Referenced by ilAccountRegistrationGUI\executeCommand(), ilPasswordAssistanceGUI\showAssignPasswordForm(), ilPasswordAssistanceGUI\showAssistanceForm(), showCodeForm(), showLoginPage(), ilPasswordAssistanceGUI\showMessageForm(), and ilPasswordAssistanceGUI\showUsernameAssistanceForm().

+ Here is the caller graph for this function:

◆ processCode()

ilStartUpGUI::processCode ( )
protected
Todo:
needs rafactoring

Definition at line 394 of file class.ilStartUpGUI.php.

394 : ?bool
395 {
396 $uname = $_POST["uname"];
397 $form = $this->initCodeForm($uname);
398 if ($uname && $form->checkInput()) {
399 $code = $form->getInput("code");
400 if (ilAccountCode::isUnusedCode($code)) {
401 $valid_until = ilAccountCode::getCodeValidUntil($code);
402 if (!$user_id = ilObjUser::_lookupId($uname)) {
403 $this->showLoginPage();
404 return false;
405 }
406 $invalid_code = false;
407 $user = new ilObjUser($user_id);
408
409 if ($valid_until === "0") {
411 } else {
412 if (is_numeric($valid_until)) {
413 $valid_until = strtotime("+" . $valid_until . "days");
414 } else {
415 $valid_until = explode("-", $valid_until);
416 $valid_until = mktime(
417 23,
418 59,
419 59,
420 $valid_until[1],
421 $valid_until[2],
422 $valid_until[0]
423 );
424 if ($valid_until < time()) {
425 $invalid_code = true;
426 }
427 }
428
429 if (!$invalid_code) {
431 $user->setTimeLimitUntil($valid_until);
432 }
433 }
434
435 if (!$invalid_code) {
436 $user->setActive(true);
438 // apply registration code role assignments
440 // apply registration code tie limits
442
443 $user->update();
444
445 $this->ctrl->setParameter($this, "cu", 1);
446 $this->lng->loadLanguageModule('auth');
447 $this->mainTemplate->setOnScreenMessage('success', $GLOBALS['DIC']->language()->txt('auth_activation_code_success'), true);
448 $this->ctrl->redirect($this, "showLoginPage");
449 }
450 }
451
452 $this->lng->loadLanguageModule("user");
453 $field = $form->getItemByPostVar("code");
454 $field->setAlert($this->lng->txt("user_account_code_not_valid"));
455 }
456
457 $form->setValuesByPost();
458 $this->showCodeForm($uname, $form);
459 return null;
460 }
static getCodeValidUntil(string $code)
static useCode(string $code)
static isUnusedCode(string $code)
static applyAccessLimits(ilObjUser $user, string $code)
static applyRoleAssignments(ilObjUser $user, string $code)
User class.
setActive(bool $a_active, int $a_owner=0)
set user active state and updates system fields appropriately
setTimeLimitUntil(?int $a_until)
static _lookupId($a_user_str)
setTimeLimitUnlimited(bool $a_unlimited)
showCodeForm($a_username=null, $a_form=null)

References $GLOBALS, $user, ilObjUser\_lookupId(), ilAccountCode\applyAccessLimits(), ilAccountCode\applyRoleAssignments(), ILIAS\Repository\ctrl(), ilAccountCode\getCodeValidUntil(), initCodeForm(), ilAccountCode\isUnusedCode(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), ilObjUser\setActive(), ilObjUser\setTimeLimitUnlimited(), ilObjUser\setTimeLimitUntil(), showCodeForm(), showLoginPage(), ilObjUser\update(), and ilAccountCode\useCode().

+ Here is the call graph for this function:

◆ processIndexPHP()

ilStartUpGUI::processIndexPHP ( )
protected

process index.php

Definition at line 1584 of file class.ilStartUpGUI.php.

1584 : void
1585 {
1586 global $ilIliasIniFile, $ilAuth, $ilSetting;
1587
1588 // In case of an valid session, redirect to starting page
1589 if ($this->authSession->isValid()) {
1590 if (!$this->user->isAnonymous() || ilPublicSectionSettings::getInstance()->isEnabledForDomain(
1591 $this->httpRequest->getServerParams()['SERVER_NAME']
1592 )) {
1594 return;
1595 }
1596 }
1597
1598 if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) {
1600 }
1601
1602 // otherwise show login page
1603 $this->showLoginPage();
1604 }
static goToPublicSection()
go to public section
global $ilSetting
Definition: privfeed.php:17
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10

References $_SERVER, $ilIliasIniFile, $ilSetting, ilPublicSectionSettings\getInstance(), ilInitialisation\goToPublicSection(), ilInitialisation\redirectToStartingPage(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ purgePlaceholders()

ilStartUpGUI::purgePlaceholders ( string  $page_editor_html)
protected

Purge page editor html from unused placeholders.

Definition at line 1093 of file class.ilStartUpGUI.php.

1093 : string
1094 {
1095 return str_replace(
1096 array(
1097 '[list-registration-link]',
1098 '[list-user-agreement]',
1099 '[list-login-form]',
1100 '[list-cas-login-form]',
1101 '[list-saml-login]',
1102 '[list-shibboleth-login-form]',
1103 '[list-openid-connect-login]'
1104 ),
1105 array('', '', '', '', '', '', ''),
1106 $page_editor_html
1107 );
1108 }

Referenced by showLoginPage().

+ Here is the caller graph for this function:

◆ retrieveMessagesFromSession()

ilStartUpGUI::retrieveMessagesFromSession ( )
protected

Definition at line 341 of file class.ilStartUpGUI.php.

References $messages, ilSession\get(), ilGlobalTemplateInterface\MESSAGE_TYPE_FAILURE, ilGlobalTemplateInterface\MESSAGE_TYPE_INFO, ilGlobalTemplateInterface\MESSAGE_TYPE_QUESTION, and ilGlobalTemplateInterface\MESSAGE_TYPE_SUCCESS.

+ Here is the call graph for this function:

◆ showAccountMigration()

ilStartUpGUI::showAccountMigration ( string  $message = '')

Show account migration screen.

Definition at line 1113 of file class.ilStartUpGUI.php.

1113 : void
1114 {
1115 $this->help->setSubScreenId('account_migration');
1116
1117 $tpl = self::initStartUpTemplate('tpl.login_account_migration.html');
1118
1119 $form = new ilPropertyFormGUI();
1120 $form->setFormAction($this->ctrl->getFormAction($this, 'migrateAccount'));
1121
1122 $form->setTitle($this->lng->txt('auth_account_migration'));
1123 $form->addCommandButton('migrateAccount', $this->lng->txt('save'));
1124 $form->addCommandButton('showLogin', $this->lng->txt('cancel'));
1125
1126 $rad = new ilRadioGroupInputGUI($this->lng->txt('auth_account_migration_name'), 'account_migration');
1127 $rad->setValue(1);
1128
1129 $keep = new ilRadioOption(
1130 $this->lng->txt('auth_account_migration_keep'),
1131 static::ACCOUNT_MIGRATION_MIGRATE,
1132 $this->lng->txt('auth_info_migrate')
1133 );
1134 $user = new ilTextInputGUI($this->lng->txt('login'), 'mig_username');
1135 $user->setRequired(true);
1136 $user->setValue(
1138 (string) ($this->httpRequest->getParsedBody()['mig_username'] ?? '')
1139 )
1140 );
1141 $user->setSize(32);
1142 $user->setMaxLength(128);
1143 $keep->addSubItem($user);
1144
1145 $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'mig_password');
1146 $pass->setRetype(false);
1147 $pass->setRequired(true);
1148 $pass->setValue(
1150 (string) ($this->httpRequest->getParsedBody()['mig_password'] ?? '')
1151 )
1152 );
1153 $pass->setSize(12);
1154 $pass->setMaxLength(128);
1155 $keep->addSubItem($pass);
1156 $rad->addOption($keep);
1157
1158 $new = new ilRadioOption(
1159 $this->lng->txt('auth_account_migration_new'),
1160 static::ACCOUNT_MIGRATION_NEW,
1161 $this->lng->txt('auth_info_add')
1162 );
1163 $rad->addOption($new);
1164
1165 $form->addItem($rad);
1166
1167 $tpl->setVariable('MIG_FORM', $form->getHTML());
1168
1169 if (strlen($message)) {
1170 $this->mainTemplate->setOnScreenMessage('failure', $message);
1171 }
1172
1174 }
$message
Definition: xapiexit.php:32

References $message, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), and ilLegacyFormElementsUtil\prepareFormOutput().

+ Here is the call graph for this function:

◆ showCASLoginForm()

ilStartUpGUI::showCASLoginForm ( string  $page_editor_html)
protected

Show cas login.

Definition at line 831 of file class.ilStartUpGUI.php.

831 : string
832 {
833 // cas login link
834 if ($this->setting->get("cas_active")) {
835 $tpl = new ilTemplate('tpl.login_form_cas.html', true, true, 'Services/Init');
836 $tpl->setVariable("TXT_CAS_LOGIN", $this->lng->txt("login_to_ilias_via_cas"));
837 $tpl->setVariable("TXT_CAS_LOGIN_BUTTON", ilUtil::getImagePath("cas_login_button.png"));
838 $tpl->setVariable("TXT_CAS_LOGIN_INSTRUCTIONS", $this->setting->get("cas_login_instructions"));
839 $this->ctrl->setParameter($this, "forceCASLogin", "1");
840 $tpl->setVariable("TARGET_CAS_LOGIN", $this->ctrl->getLinkTarget($this, "doCasAuthentication"));
841 $this->ctrl->setParameter($this, "forceCASLogin", "");
842
843 return $this->substituteLoginPageElements(
844 $GLOBALS['tpl'],
845 $page_editor_html,
846 $tpl->get(),
847 '[list-cas-login-form]',
848 'CAS_LOGIN_FORM'
849 );
850 }
851 return $page_editor_html;
852 }
substituteLoginPageElements( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
Substitute login page elements.
special template class to simplify handling of ITX/PEAR
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References $GLOBALS, $tpl, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ILIAS\Repository\lng(), and substituteLoginPageElements().

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCodeForm()

ilStartUpGUI::showCodeForm (   $a_username = null,
  $a_form = null 
)
protected

Definition at line 359 of file class.ilStartUpGUI.php.

359 : void
360 {
361 $this->help->setSubScreenId('code_input');
362
363 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt("time_limit_reached"));
364
365 $tpl = self::initStartUpTemplate("tpl.login_reactivate_code.html");
366 $tpl->setVariable("FORM", ($a_form ?? $this->initCodeForm($a_username))->getHTML());
367
369 }

References $tpl, ILIAS\Repository\help(), initCodeForm(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), and printToGlobalTemplate().

Referenced by processCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginForm()

ilStartUpGUI::showLoginForm ( string  $page_editor_html,
ilPropertyFormGUI  $form = null 
)
protected

Show login form.

Definition at line 783 of file class.ilStartUpGUI.php.

783 : string
784 {
785 global $tpl;
786
787 // @todo move this to auth utils.
788 // login via ILIAS (this also includes ldap)
789 // If local authentication is enabled for shibboleth users, we
790 // display the login form for ILIAS here.
791 if (($this->setting->get("auth_mode") != ilAuthUtils::AUTH_SHIBBOLETH ||
792 $this->setting->get("shib_auth_allow_local")) &&
793 $this->setting->get("auth_mode") != ilAuthUtils::AUTH_CAS) {
794 if (!$form instanceof ilPropertyFormGUI) {
795 $form = $this->initStandardLoginForm();
796 }
797
798 return $this->substituteLoginPageElements(
799 $tpl,
800 $page_editor_html,
801 $form->getHTML(),
802 '[list-login-form]',
803 'LOGIN_FORM'
804 );
805 }
806 return $page_editor_html;
807 }

References $tpl, ilAuthUtils\AUTH_CAS, ilAuthUtils\AUTH_SHIBBOLETH, initStandardLoginForm(), and substituteLoginPageElements().

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginInformation()

ilStartUpGUI::showLoginInformation ( string  $page_editor_html,
ilGlobalTemplateInterface  $tpl 
)
protected

Show login information.

Definition at line 812 of file class.ilStartUpGUI.php.

812 : string
813 {
814 if (strlen($page_editor_html)) {
815 // page editor active return
816 return $page_editor_html;
817 }
818
819 $loginSettings = new ilSetting("login_settings");
820 $information = $loginSettings->get("login_message_" . $this->lng->getLangKey());
821
822 if (strlen(trim($information))) {
823 $tpl->setVariable("TXT_LOGIN_INFORMATION", $information);
824 }
825 return $page_editor_html;
826 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $tpl, and ILIAS\Repository\lng().

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginPage()

ilStartUpGUI::showLoginPage ( ilPropertyFormGUI  $form = null)
protected
Parameters
\ilPropertyFormGUI | null$form
Todo:
check for forced authentication like ecs, ... Show login page

Definition at line 263 of file class.ilStartUpGUI.php.

263 : void
264 {
265 global $tpl;
266
267 $this->help->setSubScreenId('login');
268
269 $this->getLogger()->debug('Showing login page');
270
271 $extUid = $this->http->wrapper()->query()->retrieve(
272 'ext_uid',
273 $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
274 );
275 $soapPw = $this->http->wrapper()->query()->retrieve(
276 'soap_pw',
277 $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
278 );
279 $credentials = new ilAuthFrontendCredentialsSoap(
280 $GLOBALS['DIC']->http()->request(),
281 $this->ctrl,
282 $this->setting
283 );
284 $credentials->setUsername($extUid);
285 $credentials->setPassword($soapPw);
286 $credentials->tryAuthenticationOnLoginPage();
287
288 $frontend = new ilAuthFrontendCredentialsApache($this->httpRequest, $this->ctrl);
289 $frontend->tryAuthenticationOnLoginPage();
290
291 $tpl = self::initStartUpTemplate("tpl.login.html");
294
295 $page_editor_html = $this->getLoginPageEditorHTML();
296 $page_editor_html = $this->showOpenIdConnectLoginForm($page_editor_html);
297 $page_editor_html = $this->showLoginInformation($page_editor_html, $tpl);
298 $page_editor_html = $this->showLoginForm($page_editor_html, $form);
299 $page_editor_html = $this->showCASLoginForm($page_editor_html);
300 $page_editor_html = $this->showShibbolethLoginForm($page_editor_html);
301 $page_editor_html = $this->showSamlLoginForm($page_editor_html);
302 $page_editor_html = $this->showRegistrationLinks($page_editor_html);
303 $page_editor_html = $this->showTermsOfServiceLink($page_editor_html);
304 $page_editor_html = $this->purgePlaceholders($page_editor_html);
305
306 // check expired session and send message
307 if ($this->authSession->isExpired() || $this->http->wrapper()->query()->has('session_expired')) {
308 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('auth_err_expired'));
309 } elseif ($this->http->wrapper()->query()->has('reg_confirmation_msg')) {
310 $this->lng->loadLanguageModule('registration');
311 $message_key = $this->http->wrapper()->query()->retrieve(
312 'reg_confirmation_msg',
313 $this->refinery->kindlyTo()->string()
314 );
315 $message_type = "reg_account_confirmation_successful" === $message_key ?
317 $this->mainTemplate->setOnScreenMessage(
318 $message_type,
319 $this->lng->txt($message_key)
320 );
321 }
322 if ($page_editor_html !== '') {
323 $tpl->setVariable('LPE', $page_editor_html);
324 }
325 $tosWithdrawalGui = new ilTermsOfServiceWithdrawalGUIHelper($this->user);
326 $tosWithdrawalGui->setWithdrawalInfoForLoginScreen($this->httpRequest);
328 }
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
showShibbolethLoginForm(string $page_editor_html)
Show shibboleth login form.
showLoginInformation(string $page_editor_html, ilGlobalTemplateInterface $tpl)
Show login information.
showOpenIdConnectLoginForm(string $page_editor_html)
showSamlLoginForm(string $page_editor_html)
showLoginForm(string $page_editor_html, ilPropertyFormGUI $form=null)
Show login form.
getLoginPageEditorHTML()
Get HTML of ILIAS login page editor.
showCASLoginForm(string $page_editor_html)
Show cas login.
purgePlaceholders(string $page_editor_html)
Purge page editor html from unused placeholders.
showTermsOfServiceLink(string $page_editor_html)
Show terms of service link.
showRegistrationLinks(string $page_editor_html)
Show registration, password forgotten, client slection links.

References $GLOBALS, $tpl, ILIAS\Repository\ctrl(), ilObjStyleSheet\getContentStylePath(), getLogger(), getLoginPageEditorHTML(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), ilGlobalTemplateInterface\MESSAGE_TYPE_FAILURE, ilGlobalTemplateInterface\MESSAGE_TYPE_SUCCESS, printToGlobalTemplate(), purgePlaceholders(), ILIAS\Repository\refinery(), showCASLoginForm(), showLoginForm(), showLoginInformation(), showOpenIdConnectLoginForm(), showRegistrationLinks(), showSamlLoginForm(), showShibbolethLoginForm(), showTermsOfServiceLink(), and ILIAS\Repository\user().

Referenced by doApacheAuthentication(), doCasAuthentication(), doLTIAuthentication(), doShibbolethAuthentication(), doStandardAuthentication(), and processCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLogout()

ilStartUpGUI::showLogout ( )
protected

Show logout screen.

Definition at line 1319 of file class.ilStartUpGUI.php.

1319 : void
1320 {
1321 global $DIC;
1322
1323 $ilIliasIniFile = $DIC['ilIliasIniFile'];
1324
1325 $this->help->setSubScreenId('logout');
1326
1327 $tpl = self::initStartUpTemplate("tpl.logout.html");
1328 $client_id = '';
1329 if ($this->http->wrapper()->query()->has('client_id')) {
1330 $client_id = $this->http->wrapper()->query()->retrieve(
1331 'client_id',
1332 $this->refinery->kindlyTo()->string()
1333 );
1334 }
1335 if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) {
1336 $tpl->setCurrentBlock("homelink");
1337 $tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $this->lng->getLangKey());
1338 $tpl->setVariable("TXT_HOME", $this->lng->txt("home"));
1339 $tpl->parseCurrentBlock();
1340 }
1341
1342 $tosWithdrawalGui = new ilTermsOfServiceWithdrawalGUIHelper($this->user);
1343
1344 $tpl->setVariable("TXT_PAGEHEADLINE", $this->lng->txt("logout"));
1345 $tpl->setVariable(
1346 "TXT_LOGOUT_TEXT",
1347 $this->lng->txt("logout_text") . $tosWithdrawalGui->getWithdrawalTextForLogoutScreen($this->httpRequest)
1348 );
1349 $tpl->setVariable("TXT_LOGIN", $this->lng->txt("login_to_ilias"));
1350 $tpl->setVariable(
1351 "CLIENT_ID",
1352 "?client_id=" . $client_id . "&cmd=force_login&lang=" . $this->lng->getLangKey()
1353 );
1354
1356 }
$client_id
Definition: ltiauth.php:68

References $_SERVER, $client_id, $DIC, $ilIliasIniFile, $tpl, ilPublicSectionSettings\getInstance(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ showNoCookiesScreen()

ilStartUpGUI::showNoCookiesScreen ( )

show help screen, if cookies are disabled to do: link to online help here

Definition at line 1409 of file class.ilStartUpGUI.php.

1409 : void
1410 {
1411 global $tpl;
1412
1413 $str = "<p style=\"margin:15px;\">
1414 You need to enable Session Cookies in your Browser to use ILIAS.
1415 <br/>
1416 <br/><b>Firefox</b>
1417 <br/>Tools -> Options -> Privacy -> Cookies
1418 <br/>Enable 'Allow sites to set cookies' and activate option 'Keep
1419 <br/>cookies' auf 'until I close Firefox'
1420 <br/>
1421 <br/><b>Mozilla/Netscape</b>
1422 <br/>Edit -> Preferences -> Privacy&Security -> Cookies
1423 <br/>Go to 'Cookie Lifetime Policy' and check option 'Accept for current
1424 <br/>session only'.
1425 <br/>
1426 <br/><b>Internet Explorer</b>
1427 <br/>Tools -> Internet Options -> Privacy -> Advanced
1428 <br/>- Check 'Override automatic cookie handling'
1429 <br/>- Check 'Always allow session cookies'
1430 </p>";
1431 $tpl->setVariable("CONTENT", $str);
1432 $tpl->printToStdout();
1433 }

References $tpl.

◆ showOpenIdConnectLoginForm()

ilStartUpGUI::showOpenIdConnectLoginForm ( string  $page_editor_html)
protected

Definition at line 1961 of file class.ilStartUpGUI.php.

1961 : string
1962 {
1963 $oidc_settings = ilOpenIdConnectSettings::getInstance();
1964 if ($oidc_settings->getActive()) {
1965 $tpl = new ilTemplate('tpl.login_element.html', true, true, 'Services/OpenIdConnect');
1966
1967 $this->lng->loadLanguageModule('auth');
1968 $tpl->setVariable('TXT_OIDCONNECT_HEADER', $this->lng->txt('auth_oidc_login_element_info'));
1969
1970 $target = $this->initTargetFromQuery();
1971 $target_str = empty($target) ? '' : ('?target=' . $target);
1972 switch ($oidc_settings->getLoginElementType()) {
1974 $tpl->setVariable('SCRIPT_OIDCONNECT_T', ILIAS_HTTP_PATH . '/openidconnect.php' . $target_str);
1975 $tpl->setVariable('TXT_OIDC', $oidc_settings->getLoginElemenText());
1976 break;
1977
1979 $tpl->setVariable('SCRIPT_OIDCONNECT_I', ILIAS_HTTP_PATH . '/openidconnect.php' . $target_str);
1980 $tpl->setVariable('IMG_SOURCE', $oidc_settings->getImageFilePath());
1981 break;
1982 }
1983
1984 return $this->substituteLoginPageElements(
1985 $GLOBALS['tpl'],
1986 $page_editor_html,
1987 $tpl->get(),
1988 '[list-openid-connect-login]',
1989 'OPEN_ID_CONNECT_LOGIN_FORM'
1990 );
1991 }
1992
1993 return $page_editor_html;
1994 }

References $GLOBALS, $tpl, ilOpenIdConnectSettings\getInstance(), ILIAS\Repository\lng(), ilOpenIdConnectSettings\LOGIN_ELEMENT_TYPE_IMG, and ilOpenIdConnectSettings\LOGIN_ELEMENT_TYPE_TXT.

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRegistrationLinks()

ilStartUpGUI::showRegistrationLinks ( string  $page_editor_html)
protected

Show registration, password forgotten, client slection links.

Definition at line 1001 of file class.ilStartUpGUI.php.

1001 : string
1002 {
1003 global $tpl, $ilIliasIniFile;
1004
1005 $rtpl = new ilTemplate('tpl.login_registration_links.html', true, true, 'Services/Init');
1006
1007 // allow new registrations?
1008 include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
1010 $rtpl->setCurrentBlock("new_registration");
1011 $rtpl->setVariable("REGISTER", $this->lng->txt("registration"));
1012 $rtpl->setVariable(
1013 "CMD_REGISTER",
1014 $this->ctrl->getLinkTargetByClass("ilaccountregistrationgui", "")
1015 );
1016 $rtpl->parseCurrentBlock();
1017 }
1018 // allow password assistance? Surpress option if Authmode is not local database
1019 if ($this->setting->get("password_assistance")) {
1020 $rtpl->setCurrentBlock("password_assistance");
1021 $rtpl->setVariable("FORGOT_PASSWORD", $this->lng->txt("forgot_password"));
1022 $rtpl->setVariable("FORGOT_USERNAME", $this->lng->txt("forgot_username"));
1023 $rtpl->setVariable(
1024 "CMD_FORGOT_PASSWORD",
1025 $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "")
1026 );
1027 $rtpl->setVariable(
1028 "CMD_FORGOT_USERNAME",
1029 $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "showUsernameAssistanceForm")
1030 );
1031 $rtpl->setVariable("LANG_ID", $this->lng->getLangKey());
1032 $rtpl->parseCurrentBlock();
1033 }
1034
1035 if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1036 $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, "read", "", ROOT_FOLDER_ID)) {
1037 $rtpl->setCurrentBlock("homelink");
1038 $rtpl->setVariable(
1039 "CLIENT_ID",
1040 "?client_id=" . CLIENT_ID . "&lang=" . $this->lng->getLangKey()
1041 );
1042 $rtpl->setVariable("TXT_HOME", $this->lng->txt("home"));
1043 $rtpl->parseCurrentBlock();
1044 }
1045
1046 return $this->substituteLoginPageElements(
1047 $tpl,
1048 $page_editor_html,
1049 $rtpl->get(),
1050 '[list-registration-link]',
1051 'REG_PWD_CLIENT_LINKS'
1052 );
1053 }
const ROOT_FOLDER_ID
Definition: constants.php:32

References $_SERVER, $ilIliasIniFile, $tpl, ilRegistrationSettings\_lookupRegistrationType(), ILIAS\Repository\access(), ANONYMOUS_USER_ID, CLIENT_ID, ILIAS\Repository\ctrl(), ilPublicSectionSettings\getInstance(), ilRegistrationSettings\IL_REG_DISABLED, ILIAS\Repository\lng(), and ROOT_FOLDER_ID.

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSamlIdpSelection()

ilStartUpGUI::showSamlIdpSelection ( ilSamlAuth  $auth,
array  $idps 
)
protected
Parameters
ilSamlAuth$auth
ilSamlIdp[]$idps

Definition at line 2189 of file class.ilStartUpGUI.php.

2189 : void
2190 {
2191 global $DIC;
2192
2193 $this->help->setSubScreenId('saml_idp_selection');
2194
2195 self::initStartUpTemplate(array('tpl.saml_idp_selection.html', 'Services/Saml'));
2196
2197 $factory = $DIC->ui()->factory();
2198 $renderer = $DIC->ui()->renderer();
2199 $DIC->ctrl()->setTargetScript('saml.php');
2200 $items = [];
2201 $table = new ilSamlIdpSelectionTableGUI($this, 'doSamlAuthentication');
2202 foreach ($idps as $idp) {
2203 $DIC->ctrl()->setParameter($this, 'saml_idp_id', $idp->getIdpId());
2204 $DIC->ctrl()->setParameter($this, 'idpentityid', urlencode($idp->getEntityId()));
2205
2206 $items[] = [
2207 'idp_link' => $renderer->render(
2208 $factory->link()->standard(
2209 $idp->getEntityId(),
2210 $this->ctrl->getLinkTarget($this, 'doSamlAuthentication')
2211 )
2212 )
2213 ];
2214 }
2215
2216 $table->setData($items);
2217 $this->mainTemplate->setVariable('CONTENT', $table->getHtml());
2218 $this->mainTemplate->printToStdout('DEFAULT', false);
2219 }
Class ilSamlIdpSelectionTableGUI.

References $DIC, $factory, ILIAS\Repository\help(), and ILIAS\Repository\mainTemplate().

+ Here is the call graph for this function:

◆ showSamlLoginForm()

ilStartUpGUI::showSamlLoginForm ( string  $page_editor_html)
protected

Definition at line 1929 of file class.ilStartUpGUI.php.

1929 : string
1930 {
1931 require_once 'Services/Saml/classes/class.ilSamlIdp.php';
1932 require_once 'Services/Saml/classes/class.ilSamlSettings.php';
1933
1934 if (count(ilSamlIdp::getActiveIdpList()) > 0 && ilSamlSettings::getInstance()->isDisplayedOnLoginPage()) {
1935 $tpl = new ilTemplate('tpl.login_form_saml.html', true, true, 'Services/Saml');
1936
1937 $return = '';
1938 $target = $this->initTargetFromQuery();
1939 if (strlen($target)) {
1940 $return = '?returnTo=' . urlencode(ilUtil::stripSlashes($target));
1941 }
1942
1943 $tpl->setVariable('SAML_SCRIPT_URL', './saml.php' . $return);
1944 $tpl->setVariable('TXT_LOGIN', $this->lng->txt('saml_log_in'));
1945 $tpl->setVariable('LOGIN_TO_ILIAS_VIA_SAML', $this->lng->txt('login_to_ilias_via_saml'));
1946 $tpl->setVariable('TXT_SAML_LOGIN_TXT', $this->lng->txt('saml_login_form_txt'));
1947 $tpl->setVariable('TXT_SAML_LOGIN_INFO_TXT', $this->lng->txt('saml_login_form_info_txt'));
1948
1949 return $this->substituteLoginPageElements(
1950 $GLOBALS['tpl'],
1951 $page_editor_html,
1952 $tpl->get(),
1953 '[list-saml-login]',
1954 'SAML_LOGIN_FORM'
1955 );
1956 }
1957
1958 return $page_editor_html;
1959 }

References $GLOBALS, $tpl, ilSamlIdp\getActiveIdpList(), ilSamlSettings\getInstance(), ILIAS\Repository\lng(), and ilUtil\stripSlashes().

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showShibbolethLoginForm()

ilStartUpGUI::showShibbolethLoginForm ( string  $page_editor_html)
protected

Show shibboleth login form.

Definition at line 857 of file class.ilStartUpGUI.php.

857 : string
858 {
859 $target = $this->initTargetFromQuery();
860
861 // shibboleth login link
862 if ($this->setting->get("shib_active")) {
863 $tpl = new ilTemplate('tpl.login_form_shibboleth.html', true, true, 'Services/Init');
864
865 $tpl->setVariable(
866 'SHIB_FORMACTION',
867 './shib_login.php'
868 ); // Bugfix http://ilias.de/mantis/view.php?id=10662 {$tpl->setVariable('SHIB_FORMACTION', $this->ctrl->getFormAction($this));}
869 $federation_name = $this->setting->get("shib_federation_name");
870 $admin_mail = ' <a href="mailto:' . $this->setting->get("admin_email") . '">ILIAS ' . $this->lng->txt(
871 "administrator"
872 ) . '</a>.';
873 if ($this->setting->get("shib_hos_type") == 'external_wayf') {
874 $tpl->setCurrentBlock("shibboleth_login");
875 $tpl->setVariable("TXT_SHIB_LOGIN", $this->lng->txt("login_to_ilias_via_shibboleth"));
876 $tpl->setVariable("IL_TARGET", $target);
877 $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $this->setting->get("shib_federation_name"));
878 $tpl->setVariable("TXT_SHIB_LOGIN_BUTTON", $this->setting->get("shib_login_button"));
879 $tpl->setVariable(
880 "TXT_SHIB_LOGIN_INSTRUCTIONS",
881 sprintf(
882 $this->lng->txt("shib_general_login_instructions"),
883 $federation_name,
884 $admin_mail
885 )
886 );
887 $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $this->setting->get("shib_login_instructions"));
888 $tpl->parseCurrentBlock();
889 } elseif ($this->setting->get("shib_hos_type") == 'embedded_wayf') {
890 $tpl->setCurrentBlock("shibboleth_custom_login");
891 $customInstructions = stripslashes($this->setting->get("shib_login_instructions"));
892 $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $customInstructions);
893 $tpl->parseCurrentBlock();
894 } else {
895 $tpl->setCurrentBlock("shibboleth_wayf_login");
896 $tpl->setVariable("TXT_SHIB_LOGIN", $this->lng->txt("login_to_ilias_via_shibboleth"));
897 $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $this->setting->get("shib_federation_name"));
898 $tpl->setVariable(
899 "TXT_SELECT_HOME_ORGANIZATION",
900 sprintf(
901 $this->lng->txt("shib_select_home_organization"),
902 $this->setting->get("shib_federation_name")
903 )
904 );
905 $tpl->setVariable("TXT_CONTINUE", $this->lng->txt("btn_next"));
906 $tpl->setVariable("TXT_SHIB_HOME_ORGANIZATION", $this->lng->txt("shib_home_organization"));
907 $tpl->setVariable(
908 "TXT_SHIB_LOGIN_INSTRUCTIONS",
909 sprintf(
910 $this->lng->txt("shib_general_wayf_login_instructions"),
911 $admin_mail
912 )
913 );
914 $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $this->setting->get("shib_login_instructions"));
915
916 $ilShibbolethWAYF = new ilShibbolethWAYF();
917
918 $tpl->setVariable("TXT_SHIB_INVALID_SELECTION", $ilShibbolethWAYF->showNotice());
919 $tpl->setVariable("SHIB_IDP_LIST", $ilShibbolethWAYF->generateSelection());
920 $tpl->setVariable("ILW_TARGET", $target);
921 $tpl->parseCurrentBlock();
922 }
923
924 return $this->substituteLoginPageElements(
925 $GLOBALS['tpl'],
926 $page_editor_html,
927 $tpl->get(),
928 '[list-shibboleth-login-form]',
929 'SHIB_LOGIN_FORM'
930 );
931 }
932
933 return $page_editor_html;
934 }
Class ShibbolethWAYF.

References $GLOBALS, $tpl, initTargetFromQuery(), ILIAS\Repository\lng(), and substituteLoginPageElements().

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTermsOfService()

ilStartUpGUI::showTermsOfService ( bool  $accepted = false)
protected

Show terms of service.

Parameters
bool$accepted
Exceptions
ilTermsOfServiceMissingDatabaseAdapterException
ilTermsOfServiceNoSignableDocumentFoundException
ilTermsOfServiceUnexpectedCriteriaBagContentException

Definition at line 1499 of file class.ilStartUpGUI.php.

1499 : void
1500 {
1501 $this->help->setSubScreenId('terms_of_service');
1502
1503 $back_to_login = ('getAcceptance' !== $this->ctrl->getCmd());
1504 $target = $this->initTargetFromQuery();
1505
1506 if (!$this->user->getId()) {
1507 $this->user->setId(ANONYMOUS_USER_ID);
1508 }
1509
1510 $tpl = self::initStartUpTemplate('tpl.view_terms_of_service.html', $back_to_login, !$back_to_login);
1511
1512 $is_read_only_view = true;
1513
1514 $helper = new ilTermsOfServiceHelper();
1515 $handleDocument = $helper->isGloballyEnabled() && $this->termsOfServiceEvaluation->hasDocument();
1516 if ($handleDocument) {
1517 $document = $this->termsOfServiceEvaluation->document();
1518 if (
1519 'confirmAcceptance' === $this->ctrl->getCmd() ||
1520 'getAcceptance' === $this->ctrl->getCmd()
1521 ) {
1522 if ($accepted) {
1523 $helper->trackAcceptance($this->user, $document);
1524
1525 if (ilSession::get('orig_request_target')) {
1526 $target = ilSession::get('orig_request_target');
1527 ilSession::set('orig_request_target', '');
1528 $this->ctrl->redirectToURL($target);
1529 } else {
1530 $this->ctrl->redirectToURL('index.php?target=' . $target . '&client_id=' . CLIENT_ID);
1531 }
1532 }
1533
1534 $this->mainTemplate->setTitle($this->lng->txt('accept_usr_agreement'));
1535 $this->mainTemplate->setOnScreenMessage('info', $this->lng->txt('accept_usr_agreement_intro'));
1536 $is_read_only_view = false;
1537
1538 $tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, $this->ctrl->getCmd()));
1539 $tpl->setVariable('ACCEPT_TERMS_OF_SERVICE', $this->lng->txt('accept_usr_agreement'));
1540 $tpl->setVariable('TXT_ACCEPT', $this->lng->txt('accept_usr_agreement_btn'));
1541 $tpl->setVariable('DENY_TERMS_OF_SERVICE', $this->lng->txt('deny_usr_agreement'));
1542 $tpl->setVariable(
1543 'DENIAL_BUTTON',
1544 $this->dic->ui()->renderer()->render(
1545 $this->dic->ui()->factory()->button()->standard(
1546 $this->dic->language()->txt('deny_usr_agreement_btn'),
1547 self::logoutUrl(['withdraw_consent' => ''])
1548 )
1549 )
1550 );
1551 }
1552
1553 $tpl->setPermanentLink('usr', 0, 'agreement');
1554 $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $document->content());
1555 } else {
1556 $tpl->setVariable(
1557 'TERMS_OF_SERVICE_CONTENT',
1558 sprintf(
1559 $this->lng->txt('no_agreement_description'),
1562 )
1563 )
1564 );
1565 }
1566
1567 if ($is_read_only_view) {
1568 if ($this->user->isAnonymous()) {
1569 $this->lng->loadLanguageModule('tos');
1570 $this->mainTemplate->setTitle($this->lng->txt('tos_accept_usr_agreement_anonymous'));
1571 $this->mainTemplate->setOnScreenMessage('info', $this->lng->txt('tos_accept_usr_agreement_anonymous_intro'));
1572 } else {
1573 $this->mainTemplate->setTitle($this->lng->txt('usr_agreement'));
1574 $this->mainTemplate->setOnScreenMessage('info', $this->lng->txt('usr_agreement_footer_intro'));
1575 }
1576 }
1577
1579 }
static set(string $a_var, $a_val)
Set a value.

References $tpl, ANONYMOUS_USER_ID, CLIENT_ID, ILIAS\Repository\ctrl(), ilSession\get(), ilSystemSupportContacts\getMailsToAddress(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), ilLegacyFormElementsUtil\prepareFormOutput(), ilSession\set(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ showTermsOfServiceLink()

ilStartUpGUI::showTermsOfServiceLink ( string  $page_editor_html)
protected

Show terms of service link.

Definition at line 1058 of file class.ilStartUpGUI.php.

1058 : string
1059 {
1060 global $tpl;
1061
1062 if (!$this->user->getId()) {
1063 $this->user->setId(ANONYMOUS_USER_ID);
1064 }
1065
1066 $helper = new ilTermsOfServiceHelper();
1067 if ($helper->isGloballyEnabled() && $this->termsOfServiceEvaluation->hasDocument()) {
1068 $utpl = new ilTemplate('tpl.login_terms_of_service_link.html', true, true, 'Services/Init');
1069 $utpl->setVariable('TXT_TERMS_OF_SERVICE', $this->lng->txt('usr_agreement'));
1070 $utpl->setVariable('LINK_TERMS_OF_SERVICE', $this->ctrl->getLinkTarget($this, 'showTermsOfService'));
1071
1072 return $this->substituteLoginPageElements(
1073 $tpl,
1074 $page_editor_html,
1075 $utpl->get(),
1076 '[list-user-agreement]',
1077 'USER_AGREEMENT'
1078 );
1079 }
1080
1081 return $this->substituteLoginPageElements(
1082 $GLOBALS['tpl'],
1083 $page_editor_html,
1084 '',
1085 '[list-user-agreement]',
1086 'USER_AGREEMENT'
1087 );
1088 }

References $GLOBALS, $tpl, ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by showLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ substituteLoginPageElements()

ilStartUpGUI::substituteLoginPageElements (   $tpl,
string  $page_editor_html,
string  $element_html,
string  $placeholder,
string  $fallback_tplvar 
)
protected

Substitute login page elements.

Parameters
ilTemplate | ilGlobalTemplateInterface$tpl
string$page_editor_html
string$element_html
string$placeholder
string$fallback_tplvarreturn string $page_editor_html

Definition at line 945 of file class.ilStartUpGUI.php.

951 : string {
952 if (!strlen($page_editor_html)) {
953 $tpl->setVariable($fallback_tplvar, $element_html);
954 return $page_editor_html;
955 }
956 // Try to replace placeholders
957 if (!stristr($page_editor_html, $placeholder)) {
958 $tpl->setVariable($fallback_tplvar, $element_html);
959 return $page_editor_html;
960 }
961 return str_replace($placeholder, $element_html, $page_editor_html);
962 }

References $tpl.

Referenced by showCASLoginForm(), showLoginForm(), and showShibbolethLoginForm().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilStartUpGUI::$access
protected

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

◆ $authSession

ilAuthSession ilStartUpGUI::$authSession
protected

Definition at line 45 of file class.ilStartUpGUI.php.

◆ $ctrl

ilCtrlInterface ilStartUpGUI::$ctrl
protected

Definition at line 37 of file class.ilStartUpGUI.php.

◆ $dic

ILIAS DI Container ilStartUpGUI::$dic
protected

Definition at line 44 of file class.ilStartUpGUI.php.

◆ $eventHandler

ilAppEventHandler ilStartUpGUI::$eventHandler
protected

Definition at line 46 of file class.ilStartUpGUI.php.

◆ $help

ilHelpGUI ilStartUpGUI::$help
protected

Definition at line 52 of file class.ilStartUpGUI.php.

◆ $http

HTTPServices ilStartUpGUI::$http
protected

Definition at line 51 of file class.ilStartUpGUI.php.

◆ $httpRequest

ServerRequestInterface ilStartUpGUI::$httpRequest
protected

Definition at line 43 of file class.ilStartUpGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilStartUpGUI::$lng
protected

Definition at line 38 of file class.ilStartUpGUI.php.

◆ $logger

ilLogger ilStartUpGUI::$logger
protected

Definition at line 39 of file class.ilStartUpGUI.php.

Referenced by getLogger().

◆ $mainTemplate

ilGlobalTemplateInterface ilStartUpGUI::$mainTemplate
protected

Definition at line 40 of file class.ilStartUpGUI.php.

Referenced by __construct().

◆ $refinery

RefineryFactory ilStartUpGUI::$refinery
protected

Definition at line 50 of file class.ilStartUpGUI.php.

◆ $setting

ilSetting ilStartUpGUI::$setting
protected

Definition at line 47 of file class.ilStartUpGUI.php.

◆ $termsOfServiceEvaluation

ilTermsOfServiceDocumentEvaluation ilStartUpGUI::$termsOfServiceEvaluation
protected

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

Referenced by __construct().

◆ $user

ilObjUser ilStartUpGUI::$user
protected

Definition at line 41 of file class.ilStartUpGUI.php.

Referenced by __construct(), and processCode().

◆ ACCOUNT_MIGRATION_MIGRATE

const ilStartUpGUI::ACCOUNT_MIGRATION_MIGRATE = 1
protected

Definition at line 34 of file class.ilStartUpGUI.php.

◆ ACCOUNT_MIGRATION_NEW

const ilStartUpGUI::ACCOUNT_MIGRATION_NEW = 2
protected

Definition at line 35 of file class.ilStartUpGUI.php.


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