ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilStartUpGUI Class Reference

ilStartUpGUI: ilAccountRegistrationGUI, ilPasswordAssistanceGUI, ilLoginPageGUI, ilDashboardGUI ilStartUpGUI: ilMembershipOverviewGUI, ilDerivedTasksGUI, ilAccessibilityControlConceptGUI ilStartUpGUI: ilLogoutPageGUI More...

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

Public Member Functions

 __construct (ilObjUser $user=null, ilGlobalTemplateInterface $mainTemplate=null, ServerRequestInterface $httpRequest=null)
 
 getUnsafeGetCommands ()
 This method must return a list of unsafe GET commands. More...
 
 getSafePostCommands ()
 This method must return a list of safe POST commands. More...
 
 executeCommand ()
 

Static Public Member Functions

static setForcedCommand (string $cmd)
 
static printToGlobalTemplate ($tpl)
 
static initStartUpTemplate ( $a_tmpl, bool $a_show_back=false, bool $a_show_logout=false)
 This method enriches the global template with some user interface elements (language selection, headlines, back buttons, ...) for public service views. More...
 
static logoutUrl (array $parameters=[])
 Return the logout URL with a valid CSRF token. More...
 

Protected Member Functions

 showLegalDocuments ()
 

Private Member Functions

 checkForcedCommand (string $cmd)
 
 mergeValuesTrafo ()
 
 saniziteArrayElementsTrafo ()
 
 initTargetFromQuery ()
 
 getLogger ()
 
 jumpToRegistration ()
 
 jumpToPasswordAssistance ()
 
 showLoginPageOrStartupPage ()
 
 showLoginPage (ILIAS\UI\Component\Input\Container\Form\Form $form=null)
 
 retrieveMessagesFromSession ()
 
 showCodeForm (string $username=null, ILIAS\UI\Component\Input\Container\Form\Form $form=null)
 
 buildCodeForm (string $username=null)
 
 processCode ()
 
 buildStandardLoginForm ()
 
 doCasAuthentication ()
 
 doLTIAuthentication ()
 
 doApacheAuthentication ()
 
 doStandardAuthentication ()
 
 showLoginForm (string $page_editor_html, ILIAS\UI\Component\Input\Container\Form\Form $form=null)
 
 showLoginInformation (string $page_editor_html, ilGlobalTemplateInterface $tpl)
 
 showCASLoginForm (string $page_editor_html)
 
 showShibbolethLoginForm (string $page_editor_html)
 
 substituteLoginPageElements ( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
 
 getAuthPageEditorHtml (AuthPageEditorContext $ipe_context)
 
 showRegistrationLinks (string $page_editor_html)
 
 showLegalDocumentsLinks (string $page_editor_html)
 
 purgePlaceholders (string $page_editor_html)
 
 buildAccountMigrationForm ()
 
 showAccountMigration (ILIAS\UI\Component\Input\Container\Form\Form $form=null, string $message='')
 
 migrateAccount ()
 
 doMigrationNewAccount ()
 
 doMigration (array $migration_request_data)
 
 showLogout ()
 
 processIndexPHP ()
 
 showSamlLoginForm (string $page_editor_html)
 
 showOpenIdConnectLoginForm (string $page_editor_html)
 
 doOpenIdConnectAuthentication ()
 
 doSamlAuthentication ()
 
 showSamlIdpSelection (ilSamlAuth $auth, array $idps)
 

Private Attributes

const PROP_USERNAME = 'username'
 
const PROP_PASSWORD = 'password'
 
const PROP_AUTH_MODE = 'auth_mode'
 
const PROP_CODE = 'code'
 
const PROP_ACCOUNT_MIGRATION = 'account_migration'
 
const PROP_ACCOUNT_MIGRATION_NEW = 'account_migration_new'
 
const PROP_ACCOUNT_MIGRATION_MIGRATE = 'account_migration_migrate'
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilLogger $logger
 
ilGlobalTemplateInterface $mainTemplate
 
ilObjUser $user
 
ServerRequestInterface $httpRequest
 
ILIAS DI Container $dic
 
ilAuthSession $authSession
 
ilAppEventHandler $eventHandler
 
ilSetting $setting
 
ilAccessHandler $access
 
RefineryFactory $refinery
 
HTTPServices $http
 
ilHelpGUI $help
 
ILIAS UI Factory $ui_factory
 
ILIAS UI Renderer $ui_renderer
 

Static Private Attributes

static string $forced_cmd = ''
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, 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().

70  {
71  global $DIC;
72 
73  $this->dic = $DIC;
74 
75  $this->user = $user ?? $DIC->user();
76  $this->mainTemplate = $mainTemplate ?? $DIC->ui()->mainTemplate();
77  $this->httpRequest = $httpRequest ?? $DIC->http()->request();
78  $this->ctrl = $DIC->ctrl();
79  $this->lng = $DIC->language();
80  $this->lng->loadLanguageModule('auth');
81  $this->logger = ilLoggerFactory::getLogger('init');
82  $this->authSession = $DIC['ilAuthSession'];
83  $this->eventHandler = $DIC->event();
84  $this->setting = $DIC->settings();
85  $this->access = $DIC->access();
86  $this->help = $DIC->help();
87  $this->http = $DIC->http();
88  $this->refinery = $DIC->refinery();
89  $this->ui_factory = $DIC->ui()->factory();
90  $this->ui_renderer = $DIC->ui()->renderer();
91 
92  $this->ctrl->saveParameter($this, ['rep_ref_id', 'lang', 'target', 'client_id']);
93  $this->user->setLanguage($this->lng->getLangKey());
94  $this->help->setScreenIdComponent('init');
95  }
static getLogger(string $a_component_id)
Get component logger.
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:25
ServerRequestInterface $httpRequest
+ Here is the call graph for this function:

Member Function Documentation

◆ buildAccountMigrationForm()

ilStartUpGUI::buildAccountMigrationForm ( )
private

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), mergeValuesTrafo(), ILIAS\Repository\refinery(), saniziteArrayElementsTrafo(), and ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation().

Referenced by migrateAccount().

1097  {
1098  $field_factory = $this->ui_factory->input()->field();
1099 
1100  $keep = $field_factory->group(
1101  [
1102  self::PROP_USERNAME => $field_factory->text($this->lng->txt('login'))->withRequired(true),
1103  self::PROP_PASSWORD => $field_factory
1104  ->password($this->lng->txt('password'))
1105  ->withRequired(true)
1106  ->withRevelation(true)
1107  ->withAdditionalTransformation(
1108  $this->refinery->custom()->transformation(
1109  static function (ILIAS\Data\Password $value): string {
1110  return $value->toString();
1111  }
1112  )
1113  ),
1114  ],
1115  $this->lng->txt('auth_account_migration_keep'),
1116  $this->lng->txt('auth_info_migrate')
1117  );
1118 
1119  $new = $field_factory->group(
1120  [],
1121  $this->lng->txt('auth_account_migration_new'),
1122  $this->lng->txt('auth_info_add')
1123  );
1124 
1125  $fields = [
1126  self::PROP_ACCOUNT_MIGRATION => $field_factory->switchableGroup(
1127  [
1128  self::PROP_ACCOUNT_MIGRATION_MIGRATE => $keep,
1129  self::PROP_ACCOUNT_MIGRATION_NEW => $new,
1130  ],
1131  $this->lng->txt('auth_account_migration_name')
1132  )->withRequired(true)->withValue(self::PROP_ACCOUNT_MIGRATION_MIGRATE)
1133  ];
1134 
1135  $sections = [$field_factory->section($fields, $this->lng->txt('auth_account_migration'))];
1136 
1137  return $this->ui_factory->input()
1138  ->container()
1139  ->form()
1140  ->standard($this->ctrl->getFormAction($this, 'migrateAccount'), $sections)
1141  ->withDedicatedName('login_form')
1142  ->withSubmitLabel($this->lng->txt('save'))
1145  }
Interface Observer Contains several chained tasks and infos about them.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCodeForm()

ilStartUpGUI::buildCodeForm ( string  $username = null)
private

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), mergeValuesTrafo(), saniziteArrayElementsTrafo(), and ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation().

Referenced by doStandardAuthentication(), and processCode().

401  {
402  $this->lng->loadLanguageModule('auth');
403 
404  $field_factory = $this->ui_factory->input()->field();
405 
406  $username_field = $field_factory
407  ->hidden()
408  ->withRequired(true);
409  if ($username !== null) {
410  $username_field = $username_field->withValue($username);
411  }
412 
413  return $this->ui_factory
414  ->input()
415  ->container()
416  ->form()
417  ->standard(
418  $this->ctrl->getFormAction($this, 'processCode'),
419  [
420  $field_factory->section(
421  [
422  self::PROP_CODE => $field_factory
423  ->text(
424  $this->lng->txt('auth_account_code'),
425  $this->lng->txt('auth_account_code_info')
426  )
427  ->withRequired(true),
428  // #11658
429  self::PROP_USERNAME => $username_field,
430  ],
431  $this->lng->txt('auth_account_code_title'),
432  ),
433  ]
434  )
435  ->withSubmitLabel($this->lng->txt('send'))
438  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildStandardLoginForm()

ilStartUpGUI::buildStandardLoginForm ( )
private

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

References $lng, ilAuthModeDetermination\_getInstance(), ilAuthUtils\_getMultipleAuthModeOptions(), ilAuthUtils\_hasMultipleAuthenticationMethods(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), mergeValuesTrafo(), ILIAS\Repository\refinery(), saniziteArrayElementsTrafo(), and ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation().

Referenced by doStandardAuthentication().

520  {
521  $field_factory = $this->ui_factory->input()->field();
522 
523  $fields = [];
525  if (ilAuthUtils::_hasMultipleAuthenticationMethods() && $det->isManualSelection()) {
526  $auth_mode = $field_factory->radio($this->lng->txt('auth_selection'))->withRequired(true);
527  $visible_auth_methods = [];
528  foreach (ilAuthUtils::_getMultipleAuthModeOptions($this->lng) as $key => $option) {
529  if (isset($option['hide_in_ui']) && $option['hide_in_ui']) {
530  continue;
531  }
532 
533  $auth_mode = $auth_mode->withOption((string) $key, $option['txt']);
534 
535  if (isset($option['checked'])) {
536  $auth_mode = $auth_mode->withValue($key);
537  }
538  $visible_auth_methods[] = $key;
539  }
540 
541  if (count($visible_auth_methods) === 1) {
542  $auth_mode = $field_factory->hidden()->withRequired(true)->withValue(current($visible_auth_methods));
543  }
544 
545  $fields[self::PROP_AUTH_MODE] = $auth_mode;
546  }
547 
548  $fields += [
549  self::PROP_USERNAME => $field_factory
550  ->text($this->lng->txt('username'))
551  ->withRequired(
552  true,
553  $this->refinery->custom()->constraint(
554  static function (string $value): bool {
555  return $value !== '';
556  },
557  static function (Closure $lng, string $value): string {
558  return $lng('auth_required_username');
559  }
560  )
561  ),
562  self::PROP_PASSWORD => $field_factory
563  ->password($this->lng->txt('password'))
564  ->withRevelation(true)
565  ->withRequired(
566  true,
567  $this->refinery->custom()->constraint(
568  static function (string $value): bool {
569  return $value !== '';
570  },
571  static function (Closure $lng, string $value): string {
572  return $lng('auth_required_password');
573  }
574  )
575  )
576  ->withAdditionalTransformation(
577  $this->refinery->custom()->transformation(
578  static function (ILIAS\Data\Password $value): string {
579  return $value->toString();
580  }
581  )
582  ),
583  ];
584 
585  $sections = [$field_factory->section($fields, $this->lng->txt('login_to_ilias_via_login_form'))];
586 
587  return $this->ui_factory
588  ->input()
589  ->container()
590  ->form()
591  ->standard($this->ctrl->getFormAction($this, 'doStandardAuthentication'), $sections)
592  ->withDedicatedName('login_form')
593  ->withSubmitLabel($this->lng->txt('log_in'))
596  }
static _hasMultipleAuthenticationMethods()
Interface Observer Contains several chained tasks and infos about them.
static _getMultipleAuthModeOptions(ilLanguage $lng)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkForcedCommand()

ilStartUpGUI::checkForcedCommand ( string  $cmd)
private

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

Referenced by executeCommand().

102  : string
103  {
104  if (self::$forced_cmd) {
105  $cmd = self::$forced_cmd;
106  self::$forced_cmd = '';
107  }
108 
109  return $cmd;
110  }
+ Here is the caller graph for this function:

◆ doApacheAuthentication()

ilStartUpGUI::doApacheAuthentication ( )
private

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

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(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

689  : void
690  {
691  $this->getLogger()->debug('Trying apache authentication');
692 
693  $credentials = new ilAuthFrontendCredentialsApache($this->httpRequest, $this->ctrl);
694  $credentials->initFromRequest();
695 
696  $provider_factory = new ilAuthProviderFactory();
697  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_APACHE);
698 
699  $status = ilAuthStatus::getInstance();
700 
701  $frontend_factory = new \ilAuthFrontendFactory();
702  $frontend_factory->setContext(\ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
703  $frontend = $frontend_factory->getFrontend(
704  $this->authSession,
705  $status,
706  $credentials,
707  [$provider]
708  );
709  $frontend->authenticate();
710 
711  switch ($status->getStatus()) {
713  if ($credentials->hasValidTargetUrl()) {
714  $this->logger->debug(
715  sprintf(
716  'Authentication successful. Redirecting to starting page: %s',
717  $credentials->getTargetUrl()
718  )
719  );
720  $this->ctrl->redirectToURL($credentials->getTargetUrl());
721  }
722  $this->logger->debug(
723  'Authentication successful, but no valid target URL given. Redirecting to default starting page.'
724  );
726 
727  // no break
729  $this->ctrl->redirect($this, 'showAccountMigration');
730 
731  // no break
733  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
734  $this->ctrl->redirectToURL(
736  $this->ctrl->getLinkTarget($this, 'showLoginPage', '', false, false),
737  'passed_sso=1'
738  )
739  );
740  }
741 
742  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
743  $this->showLoginPage();
744  }
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
const STATUS_AUTHENTICATION_FAILED
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
$provider
Definition: ltitoken.php:80
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

◆ doCasAuthentication()

ilStartUpGUI::doCasAuthentication ( )
private

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

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.

598  : void
599  {
600  $this->getLogger()->debug('Trying cas authentication');
601  $credentials = new ilAuthFrontendCredentialsCAS();
602 
603  $provider_factory = new ilAuthProviderFactory();
604  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_CAS);
605 
606  $status = ilAuthStatus::getInstance();
607 
608  $frontend_factory = new ilAuthFrontendFactory();
609  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
610  $frontend = $frontend_factory->getFrontend(
611  $this->authSession,
612  $status,
613  $credentials,
614  [$provider]
615  );
616  $frontend->authenticate();
617 
618  switch ($status->getStatus()) {
620  $this->getLogger()->debug('Authentication successful.');
622 
623  // no break
625  default:
626  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt($status->getReason()));
627  $this->showLoginPage();
628  }
629  }
const STATUS_AUTHENTICATION_FAILED
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
$provider
Definition: ltitoken.php:80
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
Auth frontend credentials for CAS auth.
+ Here is the call graph for this function:

◆ doLTIAuthentication()

ilStartUpGUI::doLTIAuthentication ( )
private

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

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

631  : void
632  {
633  $this->getLogger()->debug('Trying lti authentication');
634 
635  $credentials = new ilAuthFrontendCredentialsLTI();
636  $credentials->initFromRequest();
637 
638  $provider_factory = new ilAuthProviderFactory();
639  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_PROVIDER_LTI);
640 
641  $status = ilAuthStatus::getInstance();
642 
643  $frontend_factory = new ilAuthFrontendFactory();
644  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
645  $frontend = $frontend_factory->getFrontend(
646  $this->authSession,
647  $status,
648  $credentials,
649  [$provider]
650  );
651  $frontend->authenticate();
652 
653  setcookie(session_name(), session_id(), [
654  'expires' => 0,
655  'path' => rtrim(IL_COOKIE_PATH, '/'),
656  'domain' => IL_COOKIE_DOMAIN,
657  'secure' => true,
658  'httponly' => true,
659  'samesite' => 'None'
660  ]);
661 
662  $lti_context_ids = ilSession::get("lti_context_ids");
663 
664  if (is_array($lti_context_ids) && isset($lti_context_ids[0])) {
665  $ref_id = $lti_context_ids[0];
666  $obj_type = ilObject::_lookupType($ref_id, true);
667  ilSession::set('orig_request_target', "goto.php?target=" . $obj_type . "_" . $ref_id . "&lti_context_id=" . $ref_id);
668  }
669 
670  switch ($status->getStatus()) {
672  ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
674 
675  // no break
677  $this->ctrl->redirect($this, 'showAccountMigration');
678 
679  // no break
681  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt($status->getReason()), true);
682  $this->ctrl->redirect($this, 'showLoginPage');
683  }
684 
685  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
686  $this->showLoginPage();
687  }
static get(string $a_var)
static getLogger(string $a_component_id)
Get component logger.
const STATUS_AUTHENTICATION_FAILED
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
Auth credentials for lti oauth based authentication.
$provider
Definition: ltitoken.php:80
$ref_id
Definition: ltiauth.php:66
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
static _lookupType(int $id, bool $reference=false)
const STATUS_ACCOUNT_MIGRATION_REQUIRED
static set(string $a_var, $a_val)
Set a value.
const IL_COOKIE_PATH(isset($_GET['client_id']))
Definition: index.php:47
+ Here is the call graph for this function:

◆ doMigration()

ilStartUpGUI::doMigration ( array  $migration_request_data)
private
Parameters
array<string,string>$migration_request_data

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

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

Referenced by migrateAccount().

1228  : void
1229  {
1230  $username = $migration_request_data[self::PROP_USERNAME];
1231  $password = $migration_request_data[self::PROP_PASSWORD];
1232 
1233  $this->logger->debug('Starting account migration for user: ' . ilSession::get('mig_ext_account'));
1234 
1235  $credentials = new ilAuthFrontendCredentials();
1236  $credentials->setUsername($username);
1237  $credentials->setPassword($password);
1238 
1239  $provider_factory = new ilAuthProviderFactory();
1240  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_LOCAL);
1241 
1242  $status = ilAuthStatus::getInstance();
1243 
1244  $frontend_factory = new ilAuthFrontendFactory();
1245  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1246  $frontend = $frontend_factory->getFrontend(
1247  $this->authSession,
1248  $status,
1249  $credentials,
1250  [$provider]
1251  );
1252  $frontend->authenticate();
1253 
1254  switch ($status->getStatus()) {
1256  $this->getLogger()->debug('Account migration: authentication successful for ' . $username);
1257 
1258  $provider = $provider_factory->getProviderByAuthMode(
1259  $credentials,
1261  );
1262  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1263  $frontend = $frontend_factory->getFrontend(
1264  $GLOBALS['DIC']['ilAuthSession'],
1265  $status,
1266  $credentials,
1267  [$provider]
1268  );
1269 
1270  if ($frontend->migrateAccount($GLOBALS['DIC']['ilAuthSession'])) {
1272  }
1273 
1274  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'), true);
1275  $this->ctrl->redirect($this, 'showAccountMigration');
1276 
1277  // no break
1278  default:
1279  $this->getLogger()->info('Account migration failed for user ' . $username);
1280  $this->showAccountMigration(null, $GLOBALS['lng']->txt('err_wrong_login'));
1281  }
1282  }
static get(string $a_var)
$provider
Definition: ltitoken.php:80
$GLOBALS["DIC"]
Definition: wac.php:30
showAccountMigration(ILIAS\UI\Component\Input\Container\Form\Form $form=null, string $message='')
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doMigrationNewAccount()

ilStartUpGUI::doMigrationNewAccount ( )
private

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

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

Referenced by migrateAccount().

1193  : void
1194  {
1195  $credentials = new ilAuthFrontendCredentials();
1196  $credentials->setUsername(ilSession::get(ilAuthFrontend::MIG_EXTERNAL_ACCOUNT));
1197 
1198  $provider_factory = new ilAuthProviderFactory();
1199  $provider = $provider_factory->getProviderByAuthMode(
1200  $credentials,
1202  );
1203 
1204  $this->logger->debug('Using provider: ' . get_class($provider) . ' for further processing.');
1205 
1206  $status = ilAuthStatus::getInstance();
1207 
1208  $frontend_factory = new ilAuthFrontendFactory();
1209  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1210  $frontend = $frontend_factory->getFrontend(
1211  $GLOBALS['DIC']['ilAuthSession'],
1212  $status,
1213  $credentials,
1214  [$provider]
1215  );
1216 
1217  if ($frontend->migrateAccountNew()) {
1219  }
1220 
1221  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
1222  $this->ctrl->redirect($this, 'showAccountMigration');
1223  }
static get(string $a_var)
$provider
Definition: ltitoken.php:80
$GLOBALS["DIC"]
Definition: wac.php:30
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doOpenIdConnectAuthentication()

ilStartUpGUI::doOpenIdConnectAuthentication ( )
private

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

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

1775  : void
1776  {
1777  $this->getLogger()->debug('Trying openid connect authentication');
1778 
1779  $credentials = new ilAuthFrontendCredentialsOpenIdConnect();
1780  $credentials->initFromRequest();
1781 
1782  $provider_factory = new ilAuthProviderFactory();
1783  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_OPENID_CONNECT);
1784 
1785  $status = ilAuthStatus::getInstance();
1786 
1787  $frontend_factory = new ilAuthFrontendFactory();
1788  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1789  $frontend = $frontend_factory->getFrontend(
1790  $this->authSession,
1791  $status,
1792  $credentials,
1793  [$provider]
1794  );
1795  $frontend->authenticate();
1796 
1797  switch ($status->getStatus()) {
1799  $this->logger->debug('Authentication successful; Redirecting to starting page.');
1800  if ($credentials->getRedirectionTarget()) {
1801  ilInitialisation::redirectToStartingPage($credentials->getRedirectionTarget());
1802  }
1804 
1805  // no break
1807  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
1808  $this->ctrl->redirect($this, 'showLoginPage');
1809  }
1810 
1811  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
1812  $this->showLoginPage();
1813  }
const AUTH_OPENID_CONNECT
const STATUS_AUTHENTICATION_FAILED
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
$provider
Definition: ltitoken.php:80
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
+ Here is the call graph for this function:

◆ doSamlAuthentication()

ilStartUpGUI::doSamlAuthentication ( )
private

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

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

1815  : void
1816  {
1817  $this->getLogger()->debug('Trying saml authentication');
1818  $request = $this->httpRequest;
1819  $params = $request->getQueryParams();
1820 
1821  $factory = new ilSamlAuthFactory();
1822  $auth = $factory->auth();
1823 
1824  if (isset($params['action']) && $params['action'] === 'logout') {
1825  $logout_url = $params['logout_url'] ?? '';
1826  $this->logger->info(sprintf('Requested SAML logout: %s', $logout_url));
1827  $auth->logout($logout_url);
1828  }
1829 
1830  if (isset($params['target']) && !isset($params['returnTo'])) {
1831  $params['returnTo'] = $params['target'];
1832  }
1833 
1834  if (isset($params['returnTo'])) {
1835  $auth->storeParam('target', $params['returnTo']);
1836  }
1837 
1838  $this->logger->debug('Started SAML authentication request');
1839  if (!$auth->isAuthenticated()) {
1840  ilLoggerFactory::getLogger('auth')->debug('User is not authenticated, yet');
1841  if (!isset($request->getQueryParams()['idpentityid'], $request->getQueryParams()['saml_idp_id'])) {
1842  $activeIdps = ilSamlIdp::getActiveIdpList();
1843  if (count($activeIdps) === 1) {
1844  $idp = current($activeIdps);
1845 
1846  ilLoggerFactory::getLogger('auth')->debug(
1847  sprintf(
1848  'Found exactly one active IDP with id %s: %s',
1849  $idp->getIdpId(),
1850  $idp->getEntityId()
1851  )
1852  );
1853 
1854  $this->ctrl->setParameter($this, 'idpentityid', $idp->getEntityId());
1855  $this->ctrl->setParameter($this, 'saml_idp_id', $idp->getIdpId());
1856  $this->ctrl->setTargetScript('saml.php');
1857  $this->ctrl->redirect($this, 'doSamlAuthentication');
1858  } elseif ($activeIdps === []) {
1859  $this->logger->debug('Did not find any active IDP, skipp authentication process');
1860  $this->ctrl->redirect($this, 'showLoginPage');
1861  } else {
1862  $this->logger->debug('Found multiple active IPDs, presenting IDP selection...');
1863  $this->showSamlIdpSelection($auth, $activeIdps);
1864  return;
1865  }
1866  }
1867 
1868  $auth->storeParam('idpId', (int) $request->getQueryParams()['saml_idp_id']);
1869  $this->logger->debug(sprintf('Stored relevant IDP id in session: %s', $auth->getParam('idpId')));
1870  }
1871 
1872  $auth = $factory->auth();
1873 
1874  $this->logger->debug('Checking SAML authentication status...');
1875  $auth->protectResource();
1876  $this->logger->debug(
1877  'SAML authentication successful, continuing with ILIAS internal authentication process...'
1878  );
1879 
1880  $idpId = (int) $auth->getParam('idpId');
1881 
1882  $this->logger->debug(
1883  sprintf(
1884  'Internal SAML IDP id fetched from session: %s',
1885  $idpId
1886  )
1887  );
1888 
1889  if ($idpId < 1) {
1890  $this->logger->debug(
1891  'No valid internal IDP id found (most probably due to IDP initiated SSO), trying fallback determination...'
1892  );
1893  $authData = $auth->getAuthDataArray();
1894  if (isset($authData['saml:sp:IdP'])) {
1895  $idpId = ilSamlIdp::geIdpIdByEntityId($authData['saml:sp:IdP']);
1896  $this->logger->debug(
1897  sprintf(
1898  'Searching active ILIAS IDP by entity id "%s" results in: %s',
1899  $authData['saml:sp:IdP'],
1900  $idpId
1901  )
1902  );
1903  } else {
1904  $this->logger->debug(
1905  'Could not execute fallback determination, no IDP entity ID found SAML authentication session data'
1906  );
1907  }
1908  }
1909 
1910  $target = $auth->popParam('target');
1911 
1912  $this->logger->debug(sprintf('Retrieved "target" parameter: %s', print_r($target, true)));
1913 
1914  $credentials = new ilAuthFrontendCredentialsSaml($auth, $request);
1915  $credentials->initFromRequest();
1916 
1917  $provider_factory = new ilAuthProviderFactory();
1918  $provider = $provider_factory->getProviderByAuthMode(
1919  $credentials,
1921  ilAuthUtils::AUTH_SAML . '_' . $idpId
1922  )
1923  );
1924 
1925  if ($target) {
1926  $credentials->setReturnTo($target);
1927  } else {
1928  $target = $credentials->getReturnTo();
1929  }
1930 
1931  $status = ilAuthStatus::getInstance();
1932 
1933  $frontend_factory = new ilAuthFrontendFactory();
1934  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1935  $frontend = $frontend_factory->getFrontend(
1936  $this->authSession,
1937  $status,
1938  $credentials,
1939  [$provider]
1940  );
1941  $frontend->authenticate();
1942 
1943  switch ($status->getStatus()) {
1945  $this->logger->debug('Authentication successful; Redirecting to starting page.');
1947 
1948  // no break
1950  $this->ctrl->redirect($this, 'showAccountMigration');
1951 
1952  // no break
1954  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
1955  $this->ctrl->redirect($this, 'showLoginPage');
1956  }
1957 
1958  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
1959  $this->showLoginPage();
1960  }
static getLogger(string $a_component_id)
Get component logger.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
const STATUS_AUTHENTICATION_FAILED
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
$provider
Definition: ltitoken.php:80
Class ilAuthFrontendCredentialsSaml.
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
showSamlIdpSelection(ilSamlAuth $auth, array $idps)
static geIdpIdByEntityId(string $entityId)
ServerRequestInterface $httpRequest
static getActiveIdpList()
const STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

◆ doStandardAuthentication()

ilStartUpGUI::doStandardAuthentication ( )
private

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

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

746  : void
747  {
748  $form = $this->buildStandardLoginForm();
749  $form_valid = false;
750  $form_data = null;
751  if ($this->http->request()->getMethod() === 'POST') {
752  $form = $form->withRequest($this->http->request());
753  $form_data = $form->getData();
754  $form_valid = $form_data !== null;
755  }
756 
757  if (!$form_valid) {
758  $this->showLoginPage($form);
759  return;
760  }
761 
762  $this->getLogger()->debug('Trying to authenticate user.');
763 
764  $auth_callback = function () use ($form_data) {
765  $credentials = new ilAuthFrontendCredentials();
766  $credentials->setUsername($form_data[self::PROP_USERNAME]);
767  $credentials->setPassword($form_data[self::PROP_PASSWORD]);
768 
770  if (ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection()) {
771  $credentials->setAuthMode($form_data[self::PROP_AUTH_MODE]);
772  }
773 
774  $provider_factory = new ilAuthProviderFactory();
775  $providers = $provider_factory->getProviders($credentials);
776 
777  $status = ilAuthStatus::getInstance();
778 
779  $frontend_factory = new ilAuthFrontendFactory();
780  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
781  $frontend = $frontend_factory->getFrontend(
782  $this->authSession,
783  $status,
784  $credentials,
785  $providers
786  );
787  $frontend->authenticate();
788 
789  return $status;
790  };
791 
792  if (($auth_duration = $this->setting->get('auth_duration')) !== null) {
793  $duration = $this->http->durations()->callbackDuration((int) $auth_duration);
794  $status = $duration->stretch($auth_callback);
795  } else {
796  $status = $auth_callback();
797  }
798 
799  switch ($status->getStatus()) {
801  ilLoggerFactory::getLogger('auth')->debug(
802  'Authentication successful; Redirecting to starting page.'
803  );
805 
806  // no break
808  $uname = ilObjUser::_lookupLogin($status->getAuthenticatedUserId());
809  $this->showLoginPage($this->buildCodeForm($uname));
810  return;
811 
813  $this->ctrl->redirect($this, 'showAccountMigration');
814 
815  // no break
817  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason());
818  $this->showLoginPage($form);
819  }
820  }
buildCodeForm(string $username=null)
static getLogger(string $a_component_id)
Get component logger.
static _hasMultipleAuthenticationMethods()
const STATUS_AUTHENTICATION_FAILED
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
$duration
static http()
Fetches the global http state from ILIAS.
const STATUS_CODE_ACTIVATION_REQUIRED
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

◆ executeCommand()

ilStartUpGUI::executeCommand ( )

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

References checkForcedCommand(), ILIAS\Repository\ctrl(), and showLoginPageOrStartupPage().

153  : void
154  {
155  $cmd = $this->checkForcedCommand($this->ctrl->getCmd('processIndexPHP'));
156 
157  $next_class = $this->ctrl->getNextClass($this) ?? '';
158 
159  switch (strtolower($next_class)) {
160  case strtolower(ilLoginPageGUI::class):
161  break;
162 
163  case strtolower(ilAccountRegistrationGUI::class):
164  $this->ctrl->forwardCommand(new ilAccountRegistrationGUI());
165  return;
166 
167  case strtolower(ilPasswordAssistanceGUI::class):
168  $this->ctrl->forwardCommand(new ilPasswordAssistanceGUI());
169  return;
170 
171  case strtolower(ilAccessibilityControlConceptGUI::class):
172  $this->ctrl->forwardCommand(new ilAccessibilityControlConceptGUI());
173  return;
174 
175  default:
176  if (method_exists($this, $cmd)) {
177  $this->$cmd();
178  return;
179  }
180  }
181 
182  // because this class now implements ilCtrlSecurityInterface,
183  // it may occur that commands are null, therefore I added
184  // this as a fallback method.
186  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilAccountRegistrationGUI.
checkForcedCommand(string $cmd)
+ Here is the call graph for this function:

◆ getAuthPageEditorHtml()

ilStartUpGUI::getAuthPageEditorHtml ( AuthPageEditorContext  $ipe_context)
private

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

References ilPageUtil\_existsAndNotEmpty(), ilObjAuthSettings\getAuthSettingsRefId(), ilAuthPageEditorSettings\getInstance(), ILIAS\Repository\lng(), ilLanguage\lookupId(), and ILIAS\Repository\mainTemplate().

Referenced by showLoginPage(), and showLogout().

970  : string
971  {
972  $ipe_settings = ilAuthPageEditorSettings::getInstance($ipe_context);
973 
974  $ipe_language = $ipe_settings->getIliasEditorLanguage($this->lng->getLangKey());
975  if (!$ipe_language) {
976  return '';
977  }
978 
979  // if page does not exist, return nothing
980  if (!ilPageUtil::_existsAndNotEmpty($ipe_context->pageType(), ilLanguage::lookupId($ipe_language))) {
981  return '';
982  }
983 
984  $this->dic->contentStyle()->gui()->addCss($this->mainTemplate, ilObjAuthSettings::getAuthSettingsRefId());
985 
986  $page_gui = new ($ipe_context->pageUiClass())(ilLanguage::lookupId($ipe_language));
987 
988  $page_gui->setStyleId(0);
989 
990  $page_gui->setPresentationTitle('');
991  $page_gui->setTemplateOutput(false);
992  $page_gui->setHeader('');
993 
994  return $page_gui->showPage();
995  }
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) ...
static lookupId(string $a_lang_key)
Lookup obj_id of language.
static getInstance(AuthPageEditorContext $context)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogger()

ilStartUpGUI::getLogger ( )
private

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

References $logger.

Referenced by doApacheAuthentication(), doCasAuthentication(), doLTIAuthentication(), doMigration(), doOpenIdConnectAuthentication(), doSamlAuthentication(), doStandardAuthentication(), and showLoginPage().

188  : ilLogger
189  {
190  return $this->logger;
191  }
+ Here is the caller graph for this function:

◆ getSafePostCommands()

ilStartUpGUI::getSafePostCommands ( )

This method must return a list of safe POST commands.

Safe post commands returned by this method will no longer be CSRF protected and will NOT be appended by an ilCtrlToken.

Returns
string[]

Implements ilCtrlSecurityInterface.

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

146  : array
147  {
148  return [
149  'doStandardAuthentication',
150  ];
151  }

◆ getUnsafeGetCommands()

ilStartUpGUI::getUnsafeGetCommands ( )

This method must return a list of unsafe GET commands.

Unsafe get commands returned by this method will now be CSRF protected, which means an ilCtrlToken is appended each time a link-target is generated to the class implementing this interface with a command from that list.

Tokens will be validated in

See also
ilCtrlInterface::getCmd(), whereas the fallback command will be used if the CSRF validation fails.
Returns
string[]

Implements ilCtrlSecurityInterface.

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

139  : array
140  {
141  return [
142  'doLogout'
143  ];
144  }

◆ initStartUpTemplate()

static ilStartUpGUI::initStartUpTemplate (   $a_tmpl,
bool  $a_show_back = false,
bool  $a_show_logout = false 
)
static

This method enriches the global template with some user interface elements (language selection, headlines, back buttons, ...) for public service views.

Parameters
string|array{0string, 1: string} $a_tmpl The template file as a string of as an array (index 0: template file, index 1: template directory)

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

References $_SERVER, $DIC, $param, ANONYMOUS_USER_ID, CLIENT_ID, ilPublicSectionSettings\getInstance(), and ROOT_FOLDER_ID.

Referenced by ilAccountRegistrationGUI\displayForm(), ilAccountRegistrationGUI\login(), ilPasswordAssistanceGUI\showAssignPasswordForm(), ilPasswordAssistanceGUI\showAssistanceForm(), ilPasswordAssistanceGUI\showMessageForm(), and ilPasswordAssistanceGUI\showUsernameAssistanceForm().

1658  global $DIC;
1659 
1660  $tpl = new ilGlobalTemplate('tpl.main.html', true, true);
1661 
1662  $tpl->addBlockfile('CONTENT', 'content', 'tpl.startup_screen.html', 'components/ILIAS/Init');
1663 
1664  $view_title = $DIC->language()->txt('login_to_ilias');
1665  if ($a_show_back) {
1666  // #13400
1667  $param = 'client_id=' . CLIENT_ID . '&lang=' . $DIC->language()->getLangKey();
1668 
1669  $tpl->setCurrentBlock('link_item_bl');
1670  $tpl->setVariable('LINK_TXT', $view_title);
1671  $tpl->setVariable('LINK_URL', 'login.php?cmd=force_login&' . $param);
1672  $tpl->parseCurrentBlock();
1673 
1674  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1675  $DIC->access()->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1676  $tpl->setVariable('LINK_URL', 'index.php?' . $param);
1677  $tpl->setVariable('LINK_TXT', $DIC->language()->txt('home'));
1678  $tpl->parseCurrentBlock();
1679  }
1680  } elseif ($a_show_logout) {
1681  $view_title = $DIC->language()->txt('logout');
1682  $tpl->setCurrentBlock('link_item_bl');
1683  $tpl->setVariable('LINK_TXT', $view_title);
1684  $tpl->setVariable('LINK_URL', self::logoutUrl());
1685  $tpl->parseCurrentBlock();
1686  }
1687 
1688  if (is_array($a_tmpl)) {
1689  $template_file = $a_tmpl[0];
1690  $template_dir = $a_tmpl[1];
1691  } else {
1692  $template_file = $a_tmpl;
1693  $template_dir = 'components/ILIAS/Init';
1694  }
1695 
1696  $tpl->addBlockFile('STARTUP_CONTENT', 'startup_content', $template_file, $template_dir);
1697 
1698  PageContentProvider::setViewTitle($view_title);
1699  $short_title = trim($DIC->settings()->get('short_inst_name') ?? '');
1700  if ($short_title === '') {
1701  $short_title = 'ILIAS';
1702  }
1703  PageContentProvider::setShortTitle($short_title);
1704 
1705  $header_title = ilObjSystemFolder::_getHeaderTitle();
1706  PageContentProvider::setTitle($header_title);
1707 
1708  return $tpl;
1709  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
special template class to simplify handling of ITX/PEAR
const ROOT_FOLDER_ID
Definition: constants.php:32
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$param
Definition: xapitoken.php:44
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTargetFromQuery()

ilStartUpGUI::initTargetFromQuery ( )
private

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

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

Referenced by showOpenIdConnectLoginForm(), showSamlLoginForm(), and showShibbolethLoginForm().

131  : string
132  {
133  return $this->http->wrapper()->query()->retrieve(
134  'target',
135  $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
136  );
137  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jumpToPasswordAssistance()

ilStartUpGUI::jumpToPasswordAssistance ( )
private

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

References ILIAS\Repository\ctrl().

198  : void
199  {
200  $this->ctrl->saveParameterByClass(ilPasswordAssistanceGUI::class, 'key');
201  $this->ctrl->redirectByClass(ilPasswordAssistanceGUI::class);
202  }
+ Here is the call graph for this function:

◆ jumpToRegistration()

ilStartUpGUI::jumpToRegistration ( )
private

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

References ILIAS\Repository\ctrl().

193  : void
194  {
195  $this->ctrl->redirectByClass(ilAccountRegistrationGUI::class);
196  }
+ 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 2007 of file class.ilStartUpGUI.php.

References $DIC, and $url.

Referenced by ILIAS\LegalDocuments\Provide\ProvideWithdrawal\__construct(), ILIAS\LegalDocuments\Conductor\__construct(), ILIAS\User\Provider\UserMetaBarProvider\getMetaBarItems(), ilAuthProviderOpenIdConnect\handleLogout(), and ILIAS\LegalDocuments\ConsumerToolbox\Blocks\routing().

2007  : string
2008  {
2009  global $DIC;
2010 
2011  $defaults = ['lang' => $DIC->user()->getCurrentLanguage()];
2012  $parameters = '&' . http_build_query(array_merge($defaults, $parameters));
2013 
2014  $DIC->ctrl()->setTargetScript('logout.php');
2015  $url = $DIC->ctrl()->getLinkTargetByClass([self::class], 'doLogout') . $parameters;
2016  $DIC->ctrl()->setTargetScript('ilias.php');
2017 
2018  return $url;
2019  }
$url
Definition: shib_logout.php:63
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ mergeValuesTrafo()

ilStartUpGUI::mergeValuesTrafo ( )
private

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

References ILIAS\Repository\refinery().

Referenced by buildAccountMigrationForm(), buildCodeForm(), and buildStandardLoginForm().

113  {
114  return $this->refinery->custom()->transformation(static function (array $values): array {
115  return array_merge(...$values);
116  });
117  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateAccount()

ilStartUpGUI::migrateAccount ( )
private

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

References buildAccountMigrationForm(), doMigration(), doMigrationNewAccount(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and showAccountMigration().

1163  : void
1164  {
1165  $form = $this->buildAccountMigrationForm();
1166  $form_valid = false;
1167  $form_data = null;
1168  if ($this->http->request()->getMethod() === 'POST') {
1169  $form = $form->withRequest($this->http->request());
1170  $form_data = $form->getData();
1171  $form_valid = $form_data !== null;
1172  }
1173 
1174  if (!$form_valid) {
1175  $this->showAccountMigration($form, $this->lng->txt('form_input_not_valid'));
1176  return;
1177  }
1178 
1179  $account_migration = $form_data[self::PROP_ACCOUNT_MIGRATION];
1180  $account_migration_mode = $account_migration[0];
1181  if ($account_migration_mode === self::PROP_ACCOUNT_MIGRATION_MIGRATE) {
1182  $this->doMigration($account_migration[1]);
1183  } elseif ($account_migration_mode === self::PROP_ACCOUNT_MIGRATION_NEW) {
1184  $this->doMigrationNewAccount();
1185  } else {
1186  $this->showAccountMigration(
1187  $form,
1188  $this->lng->txt('form_input_not_valid')
1189  );
1190  }
1191  }
static http()
Fetches the global http state from ILIAS.
showAccountMigration(ILIAS\UI\Component\Input\Container\Form\Form $form=null, string $message='')
doMigration(array $migration_request_data)
+ Here is the call graph for this function:

◆ printToGlobalTemplate()

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

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

References $DIC.

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

357  : void
358  {
359  global $DIC;
360  $gtpl = $DIC['tpl'];
361  $gtpl->setContent($tpl->get());
362  $gtpl->printToStdout('DEFAULT', false, true);
363  }
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ processCode()

ilStartUpGUI::processCode ( )
private

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

References $GLOBALS, $user_id, ilObjUser\_lookupId(), ilRegistrationCode\applyAccessLimits(), ilRegistrationCode\applyRoleAssignments(), buildCodeForm(), ILIAS\Repository\ctrl(), ilRegistrationCode\getCodeValidUntil(), ILIAS\FileDelivery\http(), ilRegistrationCode\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 ilRegistrationCode\useCode().

440  : void
441  {
442  $form = $this->buildCodeForm();
443  $form_valid = false;
444  $form_data = null;
445  if ($this->http->request()->getMethod() === 'POST') {
446  $form = $form->withRequest($this->http->request());
447  $form_data = $form->getData();
448  $form_valid = $form_data !== null;
449  }
450 
451  $uname = null;
452  if ($form_valid) {
453  $code = $form_data[self::PROP_CODE];
454  $uname = $form_data[self::PROP_USERNAME];
456  $valid_until = ilRegistrationCode::getCodeValidUntil($code);
457  if (!$user_id = ilObjUser::_lookupId($uname)) {
458  $this->showLoginPage();
459  return;
460  }
461  $invalid_code = false;
462  $user = new ilObjUser($user_id);
463  if ($valid_until === '0') {
465  } else {
466  if (is_numeric($valid_until)) {
467  $valid_until = strtotime('+' . $valid_until . 'days');
468  } else {
469  $valid_until = explode('-', $valid_until);
470  $valid_until = mktime(
471  23,
472  59,
473  59,
474  (int) $valid_until[1],
475  (int) $valid_until[2],
476  (int) $valid_until[0]
477  );
478  if ($valid_until < time()) {
479  $invalid_code = true;
480  }
481  }
482 
483  if (!$invalid_code) {
485  $user->setTimeLimitUntil($valid_until);
486  }
487  }
488 
489  if (!$invalid_code) {
490  $user->setActive(true);
492  // apply registration code role assignments
494  // apply registration code tie limits
496 
497  $user->update();
498 
499  $this->ctrl->setParameter($this, 'cu', 1);
500  $this->lng->loadLanguageModule('auth');
501  $this->mainTemplate->setOnScreenMessage(
502  'success',
503  $GLOBALS['DIC']->language()->txt('auth_activation_code_success'),
504  true
505  );
506  $this->ctrl->redirect($this, 'showLoginPage');
507  }
508  }
509 
510  $this->lng->loadLanguageModule('user');
511  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('user_account_code_not_valid'));
512  } else {
513  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
514  }
515 
516  $this->showCodeForm($uname, $form);
517  }
showCodeForm(string $username=null, ILIAS\UI\Component\Input\Container\Form\Form $form=null)
setTimeLimitUnlimited(bool $a_unlimited)
buildCodeForm(string $username=null)
static getCodeValidUntil(string $code)
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static _lookupId($a_user_str)
setTimeLimitUntil(?int $a_until)
setActive(bool $a_active, int $a_owner=0)
set user active state and updates system fields appropriately
static http()
Fetches the global http state from ILIAS.
$GLOBALS["DIC"]
Definition: wac.php:30
static isUnusedCode(string $code)
static useCode(string $code)
language()
description: > Example for rendring a language glyph.
Definition: language.php:25
static applyRoleAssignments(ilObjUser $user, string $code)
static applyAccessLimits(ilObjUser $user, string $code)
+ Here is the call graph for this function:

◆ processIndexPHP()

ilStartUpGUI::processIndexPHP ( )
private

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

References $_COOKIE, $_SERVER, $DIC, $location, $path, $ref_id, XapiProxy\$resp, ilObject\_getAllReferences(), ilCourseParticipant\_getInstanceByObjId(), ilObjCourse\_isActivated(), ilGroupParticipants\_isParticipant(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjCourse\_registrationEnabled(), ilObjUser\_verifyRegistrationHash(), ILIAS\Repository\access(), ANONYMOUS_USER_ID, CLIENT_ID, ILIAS\Repository\ctrl(), ilRBACAccessHandler\doActivationCheck(), ilRBACAccessHandler\doStatusCheck(), ilSecuritySettingsChecker\generatePasswords(), ilParticipants\getDefaultMemberRole(), ilPublicSectionSettings\getInstance(), ilObjectFactory\getInstanceByObjId(), ilObjUser\getLanguage(), ilLoggerFactory\getLogger(), ilObjUser\getPref(), ilInitialisation\goToPublicSection(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilGlobalTemplateInterface\MESSAGE_TYPE_FAILURE, ilGlobalTemplateInterface\MESSAGE_TYPE_SUCCESS, ilObjUser\PASSWD_PLAIN, ilUtil\redirect(), ilInitialisation\redirectToStartingPage(), ILIAS\Repository\refinery(), ROOT_FOLDER_ID, ilSession\set(), ilObjUser\setActive(), ilUtil\setCookie(), ilObjUser\setLastPasswordChangeTS(), ilObjUser\setPasswd(), showLoginPage(), ilObjUser\update(), and ILIAS\Repository\user().

1381  : void
1382  {
1383  if ($this->authSession->isValid()) {
1384  if (!$this->user->isAnonymous() || (
1385  ilPublicSectionSettings::getInstance()->isEnabledForDomain(
1386  $this->httpRequest->getServerParams()['SERVER_NAME']
1387  ) && $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)
1388  )) {
1390  return;
1391  }
1392  }
1393 
1394  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1395  $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1397  }
1398 
1399  $this->showLoginPage();
1400  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const ROOT_FOLDER_ID
Definition: constants.php:32
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static goToPublicSection()
go to public section
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
static redirectToStartingPage(string $target='')
+ Here is the call graph for this function:

◆ purgePlaceholders()

ilStartUpGUI::purgePlaceholders ( string  $page_editor_html)
private

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

Referenced by showLoginPage().

1077  : string
1078  {
1079  return str_replace(
1080  [
1081  '[list-language-selection]',
1082  '[list-registration-link]',
1083  '[list-user-agreement]',
1084  '[list-dpro-agreement]',
1085  '[list-login-form]',
1086  '[list-cas-login-form]',
1087  '[list-saml-login]',
1088  '[list-shibboleth-login-form]',
1089  '[list-openid-connect-login]'
1090  ],
1091  '',
1092  $page_editor_html
1093  );
1094  }
+ Here is the caller graph for this function:

◆ retrieveMessagesFromSession()

ilStartUpGUI::retrieveMessagesFromSession ( )
private
Returns
array<string, string>

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

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

Referenced by showLoginPageOrStartupPage().

368  : array
369  {
370  $messages = [];
371  $message_types = [
376  ];
377 
378  foreach ($message_types as $message_type) {
379  if (ilSession::get($message_type)) {
380  $messages[$message_type] = ilSession::get($message_type);
381  }
382  }
383 
384  return $messages;
385  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saniziteArrayElementsTrafo()

ilStartUpGUI::saniziteArrayElementsTrafo ( )
private

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

References ILIAS\Repository\refinery(), and ilArrayUtil\stripSlashesRecursive().

Referenced by buildAccountMigrationForm(), buildCodeForm(), and buildStandardLoginForm().

120  {
121  return $this->refinery->custom()->transformation(static function (array $values): array {
122  $processed_values = array_merge(
124  isset($values[self::PROP_PASSWORD]) ? [self::PROP_PASSWORD => $values[self::PROP_PASSWORD]] : []
125  );
126 
127  return $processed_values;
128  });
129  }
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setForcedCommand()

static ilStartUpGUI::setForcedCommand ( string  $cmd)
static

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

97  : void
98  {
99  self::$forced_cmd = $cmd;
100  }

◆ showAccountMigration()

ilStartUpGUI::showAccountMigration ( ILIAS\UI\Component\Input\Container\Form\Form  $form = null,
string  $message = '' 
)
private

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

References ILIAS\Repository\help(), and ILIAS\Repository\mainTemplate().

Referenced by doMigration(), and migrateAccount().

1150  : void {
1151  $this->help->setSubScreenId('account_migration');
1152 
1153  $tpl = self::initStartUpTemplate('tpl.login_account_migration.html');
1154  $tpl->setVariable('MIG_FORM', $this->ui_renderer->render($form ?? $this->buildAccountMigrationForm()));
1155 
1156  if ($message !== '') {
1157  $this->mainTemplate->setOnScreenMessage('failure', $message);
1158  }
1159 
1160  self::printToGlobalTemplate($tpl);
1161  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCASLoginForm()

ilStartUpGUI::showCASLoginForm ( string  $page_editor_html)
private

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

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

Referenced by showLoginPage().

846  : string
847  {
848  if ($this->setting->get('cas_active')) {
849  $tpl = new ilTemplate('tpl.login_form_cas.html', true, true, 'components/ILIAS/Init');
850  $tpl->setVariable('TXT_CAS_LOGIN', $this->lng->txt('login_to_ilias_via_cas'));
851  $tpl->setVariable('TXT_CAS_LOGIN_BUTTON', ilUtil::getImagePath('auth/cas_login_button.png'));
852  $tpl->setVariable('TXT_CAS_LOGIN_INSTRUCTIONS', $this->setting->get('cas_login_instructions'));
853  $this->ctrl->setParameter($this, 'forceCASLogin', '1');
854  $tpl->setVariable('TARGET_CAS_LOGIN', $this->ctrl->getLinkTarget($this, 'doCasAuthentication'));
855  $this->ctrl->setParameter($this, 'forceCASLogin', '');
856 
857  return $this->substituteLoginPageElements(
858  $GLOBALS['tpl'],
859  $page_editor_html,
860  $tpl->get(),
861  '[list-cas-login-form]',
862  'CAS_LOGIN_FORM'
863  );
864  }
865 
866  return $page_editor_html;
867  }
$GLOBALS["DIC"]
Definition: wac.php:30
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
substituteLoginPageElements( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCodeForm()

ilStartUpGUI::showCodeForm ( string  $username = null,
ILIAS\UI\Component\Input\Container\Form\Form  $form = null 
)
private

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

References ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\mainTemplate().

Referenced by processCode().

390  : void {
391  $this->help->setSubScreenId('code_input');
392 
393  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('time_limit_reached'));
394 
395  $tpl = self::initStartUpTemplate('tpl.login_reactivate_code.html');
396  $tpl->setVariable('FORM', $this->ui_renderer->render($form ?? $this->buildCodeForm($username)));
397  self::printToGlobalTemplate($tpl);
398  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLegalDocuments()

ilStartUpGUI::showLegalDocuments ( )
protected

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

References $DIC.

1373  : void
1374  {
1375  global $DIC;
1376  $tpl = self::initStartUpTemplate(['agreement.html', 'components/ILIAS/LegalDocuments'], true, false);
1377  $tpl->setVariable('CONTENT', $DIC['legalDocuments']->agreeContent(self::class, __FUNCTION__));
1378  self::printToGlobalTemplate($tpl);
1379  }
global $DIC
Definition: shib_login.php:25

◆ showLegalDocumentsLinks()

ilStartUpGUI::showLegalDocumentsLinks ( string  $page_editor_html)
private

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

References $DIC, ANONYMOUS_USER_ID, substituteLoginPageElements(), and ILIAS\Repository\user().

Referenced by showLoginPage().

1050  : string
1051  {
1052  global $tpl;
1053  global $DIC;
1054 
1055  if (0 === $this->user->getId()) {
1056  $this->user->setId(ANONYMOUS_USER_ID);
1057  }
1058 
1059  $page_editor_html = $this->substituteLoginPageElements(
1060  $tpl,
1061  $page_editor_html,
1062  $DIC['legalDocuments']->loginPageHTML(TermsOfService::ID),
1063  '[list-user-agreement]',
1064  'USER_AGREEMENT'
1065  );
1066  $page_editor_html = $this->substituteLoginPageElements(
1067  $tpl,
1068  $page_editor_html,
1069  $DIC['legalDocuments']->loginPageHTML(DataProtection::ID),
1070  '[list-dpro-agreement]',
1071  'DPRO_AGREEMENT'
1072  );
1073 
1074  return $page_editor_html;
1075  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: shib_login.php:25
substituteLoginPageElements( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginForm()

ilStartUpGUI::showLoginForm ( string  $page_editor_html,
ILIAS\UI\Component\Input\Container\Form\Form  $form = null 
)
private

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

References substituteLoginPageElements().

Referenced by showLoginPage().

825  : string {
826  global $tpl;
827 
828  return $this->substituteLoginPageElements(
829  $tpl,
830  $page_editor_html,
831  $this->ui_renderer->render($form ?? $this->buildStandardLoginForm()),
832  '[list-login-form]',
833  'LOGIN_FORM'
834  );
835  }
substituteLoginPageElements( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
+ 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 
)
private

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

Referenced by showLoginPage().

837  : string
838  {
839  if ($page_editor_html !== '') {
840  return $page_editor_html;
841  }
842 
843  return $page_editor_html;
844  }
+ Here is the caller graph for this function:

◆ showLoginPage()

ilStartUpGUI::showLoginPage ( ILIAS\UI\Component\Input\Container\Form\Form  $form = null)
private

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

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

Referenced by doApacheAuthentication(), doCasAuthentication(), doLTIAuthentication(), doOpenIdConnectAuthentication(), doSamlAuthentication(), doStandardAuthentication(), processCode(), processIndexPHP(), and showLoginPageOrStartupPage().

276  : void
277  {
278  global $tpl; // Don't remove this, the global variables will be replaced with a ilGlobalTemplate instnace
279 
280  $this->help->setSubScreenId('login');
281 
282  $this->getLogger()->debug('Showing login page');
283 
284  $extUid = $this->http->wrapper()->query()->retrieve(
285  'ext_uid',
286  $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
287  );
288 
289  $soapPw = $this->http->wrapper()->query()->retrieve(
290  'soap_pw',
291  $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
292  );
293 
294  $credentials = new ilAuthFrontendCredentialsSoap(
295  $GLOBALS['DIC']->http()->request(),
296  $this->ctrl,
297  $this->setting
298  );
299 
300  $credentials->setUsername($extUid);
301  $credentials->setPassword($soapPw);
302  $credentials->tryAuthenticationOnLoginPage();
303 
304  $frontend = new ilAuthFrontendCredentialsApache($this->httpRequest, $this->ctrl);
305  $frontend->tryAuthenticationOnLoginPage();
306 
307  $tpl = self::initStartUpTemplate('tpl.login.html');
310 
311  $page_editor_html = $this->getAuthPageEditorHtml(AuthPageEditorContext::LOGIN);
312  $page_editor_html = $this->showOpenIdConnectLoginForm($page_editor_html);
313  $page_editor_html = $this->showLoginInformation($page_editor_html, $tpl);
314  $page_editor_html = $this->showLoginForm($page_editor_html, $form);
315  $page_editor_html = $this->showCASLoginForm($page_editor_html);
316  $page_editor_html = $this->showShibbolethLoginForm($page_editor_html);
317  $page_editor_html = $this->showSamlLoginForm($page_editor_html);
318  $page_editor_html = $this->showRegistrationLinks($page_editor_html);
319  $page_editor_html = $this->showLegalDocumentsLinks($page_editor_html);
320  $page_editor_html = $this->purgePlaceholders($page_editor_html);
321 
322  // check expired session and send message
323  if ($this->authSession->isExpired() || $this->http->wrapper()->query()->has('session_expired')) {
324  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('auth_err_expired'));
325  } elseif ($this->http->wrapper()->query()->has('reg_confirmation_msg')) {
326  $this->lng->loadLanguageModule('registration');
327  $message_key = $this->http->wrapper()->query()->retrieve(
328  'reg_confirmation_msg',
329  $this->refinery->kindlyTo()->string()
330  );
331  $message_type = $message_key === 'reg_account_confirmation_successful' ?
333  $this->mainTemplate->setOnScreenMessage(
334  $message_type,
335  $this->lng->txt($message_key)
336  );
337  }
338 
339  if ($page_editor_html !== '') {
340  $tpl->setVariable('LPE', $page_editor_html);
341  }
342 
343  if ($this->authSession->isExpired()) {
344  // The usr_id is is still the one of the former logged-in user, so we have to unset it
345  $this->authSession->setAuthenticated(false, ANONYMOUS_USER_ID);
346  $this->dic->user()->setId($this->authSession->getUserId());
347  $this->dic->user()->read();
348  }
349 
350  $this->mainTemplate->setPermanentLink('auth', null, 'login');
351  self::printToGlobalTemplate($tpl);
352  }
showLoginInformation(string $page_editor_html, ilGlobalTemplateInterface $tpl)
const ANONYMOUS_USER_ID
Definition: constants.php:27
purgePlaceholders(string $page_editor_html)
getAuthPageEditorHtml(AuthPageEditorContext $ipe_context)
showOpenIdConnectLoginForm(string $page_editor_html)
showShibbolethLoginForm(string $page_editor_html)
static http()
Fetches the global http state from ILIAS.
$GLOBALS["DIC"]
Definition: wac.php:30
showLoginForm(string $page_editor_html, ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
showRegistrationLinks(string $page_editor_html)
showLegalDocumentsLinks(string $page_editor_html)
showSamlLoginForm(string $page_editor_html)
showCASLoginForm(string $page_editor_html)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginPageOrStartupPage()

ilStartUpGUI::showLoginPageOrStartupPage ( )
private

According to a (core) code base analysis (ILIAS 8.x until 10.x, 2024-11-05), there is curently no code that redirects to this command/action with "cmd=force_login" as query parameter in a case where the user is still considered as "logged-in". To address https://mantis.ilias.de/view.php?id=29991 we assume that we can ignore such requests to prevent "Logout without CSRF / Denial of Service for Users" and redirect the user to the start page instead.

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

References ILIAS\FileDelivery\http(), ILIAS\Repository\logger(), ILIAS\Repository\mainTemplate(), ilInitialisation\redirectToStartingPage(), ILIAS\Repository\refinery(), retrieveMessagesFromSession(), ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), showLoginPage(), and ILIAS\Repository\user().

Referenced by executeCommand().

204  : void
205  {
214  if ($this->authSession->isValid() && $this->authSession->getUserId() > 0 && !$this->user->isAnonymous()) {
216  }
217 
218  $is_forced_login = $this->http->wrapper()->query()->retrieve(
219  'cmd',
220  $this->refinery->byTrying([
221  $this->refinery->kindlyTo()->string(),
222  $this->refinery->always(
223  $this->http->wrapper()->post()->retrieve(
224  'cmd',
225  $this->refinery->byTrying([
226  $this->refinery->kindlyTo()->string(),
227  $this->refinery->always('')
228  ])
229  )
230  )
231  ])
232  ) === 'force_login';
233 
234  if ($is_forced_login) {
235  // Only allow this for anonymous user, see: showLoginPageOrStartupPage
236  $this->logger->debug('Force login');
237  $messages = [];
238  if ($this->authSession->isValid()) {
239  $messages = $this->retrieveMessagesFromSession();
240  $this->logger->debug('Valid session -> logout current user');
242  $this->authSession->logout();
243 
244  $this->eventHandler->raise(
245  'components/ILIAS/Authentication',
246  'afterLogout',
247  [
248  'username' => $this->user->getLogin(),
249  'is_explicit_logout' => false,
250  ]
251  );
252 
253  $this->dic->user()->setId($this->authSession->getUserId());
254  $this->dic->user()->read();
255  }
256 
257  $this->logger->debug('Show login page');
258  foreach ($messages as $type => $content) {
259  $this->mainTemplate->setOnScreenMessage($type, $content);
260  }
261 
262  $this->showLoginPage();
263  return;
264  }
265 
266  if ($this->authSession->isValid()) {
267  $this->logger->debug('Valid session -> redirect to starting page');
269  return;
270  }
271 
272  $this->logger->debug('No valid session -> show login');
273  $this->showLoginPage();
274  }
showLoginPage(ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static http()
Fetches the global http state from ILIAS.
const SESSION_CLOSE_USER
static redirectToStartingPage(string $target='')
static setClosingContext(int $a_context)
set closing context (for statistics)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLogout()

ilStartUpGUI::showLogout ( )
private

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

References $_SERVER, $client_id, $url, ilUtil\_getHttpPath(), ilObjUser\_isAnonymous(), ILIAS\Repository\access(), ANONYMOUS_USER_ID, CLIENT_ID, ILIAS\Repository\ctrl(), ilSession\get(), getAuthPageEditorHtml(), ilPublicSectionSettings\getInstance(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\mainTemplate(), ILIAS\Repository\refinery(), ROOT_FOLDER_ID, ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), ilUtil\setCookie(), and ILIAS\Repository\user().

1284  : void
1285  {
1286  if (!$this->authSession->isExpired() &&
1287  $this->authSession->isAuthenticated() &&
1288  !ilObjUser::_isAnonymous($this->authSession->getUserId())) {
1289  $this->ctrl->redirectToURL(ilUserUtil::getStartingPointAsUrl());
1290  }
1291 
1292  $this->help->setSubScreenId('logout');
1293 
1294  $tpl = self::initStartUpTemplate('tpl.logout.html');
1295  $client_id = $this->http->wrapper()->query()->retrieve(
1296  'client_id',
1297  $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
1298  );
1299 
1300  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1301  $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1302  $tpl->setCurrentBlock('homelink');
1303  $tpl->setVariable('CLIENT_ID', '?client_id=' . $client_id . '&lang=' . $this->lng->getLangKey());
1304  $tpl->setVariable('TXT_HOME', $this->lng->txt('home'));
1305  $tpl->parseCurrentBlock();
1306  }
1307 
1308  $tpl->setVariable('LPE', $this->getAuthPageEditorHtml(AuthPageEditorContext::LOGOUT));
1309  $tpl->setVariable('TXT_PAGEHEADLINE', $this->lng->txt('logout'));
1310  $tpl->setVariable('TXT_LOGIN', $this->lng->txt('login_to_ilias'));
1311  $tpl->setVariable(
1312  'CLIENT_ID',
1313  '?client_id=' . $client_id . '&cmd=force_login&lang=' . $this->lng->getLangKey()
1314  );
1315 
1316  self::printToGlobalTemplate($tpl);
1317  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const ROOT_FOLDER_ID
Definition: constants.php:32
getAuthPageEditorHtml(AuthPageEditorContext $ipe_context)
static http()
Fetches the global http state from ILIAS.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
static _isAnonymous(int $usr_id)
$client_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

◆ showOpenIdConnectLoginForm()

ilStartUpGUI::showOpenIdConnectLoginForm ( string  $page_editor_html)
private

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

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

Referenced by showLoginPage().

1740  : string
1741  {
1742  $oidc_settings = ilOpenIdConnectSettings::getInstance();
1743  if ($oidc_settings->getActive()) {
1744  $tpl = new ilTemplate('tpl.login_element.html', true, true, 'components/ILIAS/OpenIdConnect');
1745 
1746  $this->lng->loadLanguageModule('auth');
1747  $tpl->setVariable('TXT_OIDCONNECT_HEADER', $this->lng->txt('auth_oidc_login_element_info'));
1748 
1749  $target = $this->initTargetFromQuery();
1750  $target_str = empty($target) ? '' : ('?target=' . $target);
1751  switch ($oidc_settings->getLoginElementType()) {
1753  $tpl->setVariable('SCRIPT_OIDCONNECT_T', './openidconnect.php' . $target_str);
1754  $tpl->setVariable('TXT_OIDC', $oidc_settings->getLoginElemenText());
1755  break;
1756 
1758  $tpl->setVariable('SCRIPT_OIDCONNECT_I', './openidconnect.php' . $target_str);
1759  $tpl->setVariable('IMG_SOURCE', $oidc_settings->getImageFilePath());
1760  break;
1761  }
1762 
1763  return $this->substituteLoginPageElements(
1764  $GLOBALS['tpl'],
1765  $page_editor_html,
1766  $tpl->get(),
1767  '[list-openid-connect-login]',
1768  'OPEN_ID_CONNECT_LOGIN_FORM'
1769  );
1770  }
1771 
1772  return $page_editor_html;
1773  }
$GLOBALS["DIC"]
Definition: wac.php:30
substituteLoginPageElements( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRegistrationLinks()

ilStartUpGUI::showRegistrationLinks ( string  $page_editor_html)
private

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

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

Referenced by showLoginPage().

997  : string
998  {
999  global $tpl;
1000 
1001  $rtpl = new ilTemplate('tpl.login_registration_links.html', true, true, 'components/ILIAS/Init');
1002 
1003  // allow new registrations?
1005  $rtpl->setCurrentBlock('new_registration');
1006  $rtpl->setVariable('REGISTER', $this->lng->txt('registration'));
1007  $rtpl->setVariable(
1008  'CMD_REGISTER',
1009  $this->ctrl->getLinkTargetByClass(ilAccountRegistrationGUI::class)
1010  );
1011  $rtpl->parseCurrentBlock();
1012  }
1013  // allow password assistance? Surpress option if Authmode is not local database
1014  if ($this->setting->get('password_assistance')) {
1015  $rtpl->setCurrentBlock('password_assistance');
1016  $rtpl->setVariable('FORGOT_PASSWORD', $this->lng->txt('forgot_password'));
1017  $rtpl->setVariable('FORGOT_USERNAME', $this->lng->txt('forgot_username'));
1018  $rtpl->setVariable(
1019  'CMD_FORGOT_PASSWORD',
1020  $this->ctrl->getLinkTargetByClass(ilPasswordAssistanceGUI::class)
1021  );
1022  $rtpl->setVariable(
1023  'CMD_FORGOT_USERNAME',
1024  $this->ctrl->getLinkTargetByClass(ilPasswordAssistanceGUI::class, 'showUsernameAssistanceForm')
1025  );
1026  $rtpl->setVariable('LANG_ID', $this->lng->getLangKey());
1027  $rtpl->parseCurrentBlock();
1028  }
1029 
1030  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1031  $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1032  $rtpl->setCurrentBlock('homelink');
1033  $rtpl->setVariable(
1034  'CLIENT_ID',
1035  '?client_id=' . CLIENT_ID . '&lang=' . $this->lng->getLangKey()
1036  );
1037  $rtpl->setVariable('TXT_HOME', $this->lng->txt('home'));
1038  $rtpl->parseCurrentBlock();
1039  }
1040 
1041  return $this->substituteLoginPageElements(
1042  $tpl,
1043  $page_editor_html,
1044  $rtpl->get(),
1045  '[list-registration-link]',
1046  'REG_PWD_CLIENT_LINKS'
1047  );
1048  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const ROOT_FOLDER_ID
Definition: constants.php:32
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
const CLIENT_ID
Definition: constants.php:41
substituteLoginPageElements( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSamlIdpSelection()

ilStartUpGUI::showSamlIdpSelection ( ilSamlAuth  $auth,
array  $idps 
)
private
Parameters
list<ilSamlIdp>$idps

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

References $components, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\mainTemplate().

Referenced by doSamlAuthentication().

1965  : void
1966  {
1967  $this->help->setSubScreenId('saml_idp_selection');
1968 
1969  self::initStartUpTemplate(['tpl.saml_idp_selection.html', 'components/ILIAS/Saml']);
1970 
1971  $this->ctrl->setTargetScript('saml.php');
1972  $items = [];
1973  foreach ($idps as $idp) {
1974  $this->ctrl->setParameter($this, 'saml_idp_id', $idp->getIdpId());
1975  $this->ctrl->setParameter($this, 'idpentityid', urlencode($idp->getEntityId()));
1976 
1977  $items[] = $this->ui_factory->link()->standard(
1978  $idp->getEntityId(),
1979  $this->ctrl->getLinkTarget($this, 'doSamlAuthentication')
1980  );
1981  }
1982 
1983  $components = [
1984  $this->ui_factory->panel()->standard(
1985  $this->lng->txt('auth_saml_idp_selection_table_title'),
1986  [
1987  $this->ui_factory->messageBox()->info($this->lng->txt('auth_saml_idp_selection_table_desc')),
1988  $this->ui_factory->listing()->unordered(
1989  array_map(
1990  fn($item) => $this->ui_renderer->render($item),
1991  $items
1992  )
1993  )
1994  ]
1995  )
1996  ];
1997 
1998  $this->mainTemplate->setVariable('CONTENT', $this->ui_renderer->render($components));
1999  $this->mainTemplate->printToStdout('DEFAULT', false);
2000  }
$components
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSamlLoginForm()

ilStartUpGUI::showSamlLoginForm ( string  $page_editor_html)
private

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

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

Referenced by showLoginPage().

1711  : string
1712  {
1713  if (count(ilSamlIdp::getActiveIdpList()) > 0 && ilSamlSettings::getInstance()->isDisplayedOnLoginPage()) {
1714  $tpl = new ilTemplate('tpl.login_form_saml.html', true, true, 'components/ILIAS/Saml');
1715 
1716  $return = '';
1717  $target = $this->initTargetFromQuery();
1718  if ($target !== '') {
1719  $return = '?returnTo=' . urlencode(ilUtil::stripSlashes($target));
1720  }
1721 
1722  $tpl->setVariable('SAML_SCRIPT_URL', './saml.php' . $return);
1723  $tpl->setVariable('TXT_LOGIN', $this->lng->txt('saml_log_in'));
1724  $tpl->setVariable('LOGIN_TO_ILIAS_VIA_SAML', $this->lng->txt('login_to_ilias_via_saml'));
1725  $tpl->setVariable('TXT_SAML_LOGIN_TXT', $this->lng->txt('saml_login_form_txt'));
1726  $tpl->setVariable('TXT_SAML_LOGIN_INFO_TXT', $this->lng->txt('saml_login_form_info_txt'));
1727 
1728  return $this->substituteLoginPageElements(
1729  $GLOBALS['tpl'],
1730  $page_editor_html,
1731  $tpl->get(),
1732  '[list-saml-login]',
1733  'SAML_LOGIN_FORM'
1734  );
1735  }
1736 
1737  return $page_editor_html;
1738  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
$GLOBALS["DIC"]
Definition: wac.php:30
substituteLoginPageElements( $tpl, string $page_editor_html, string $element_html, string $placeholder, string $fallback_tplvar)
static getActiveIdpList()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showShibbolethLoginForm()

ilStartUpGUI::showShibbolethLoginForm ( string  $page_editor_html)
private

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

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

Referenced by showLoginPage().

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

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

Referenced by showCASLoginForm(), showLegalDocumentsLinks(), showLoginForm(), showOpenIdConnectLoginForm(), showRegistrationLinks(), showSamlLoginForm(), and showShibbolethLoginForm().

956  : string {
957  if ($page_editor_html === '') {
958  $tpl->setVariable($fallback_tplvar, $element_html);
959  return $page_editor_html;
960  }
961 
962  if (stripos($page_editor_html, $placeholder) === false) {
963  $tpl->setVariable($fallback_tplvar, $element_html);
964  return $page_editor_html;
965  }
966 
967  return str_replace($placeholder, $element_html, $page_editor_html);
968  }
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilStartUpGUI::$access
private

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

◆ $authSession

ilAuthSession ilStartUpGUI::$authSession
private

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

◆ $ctrl

ilCtrlInterface ilStartUpGUI::$ctrl
private

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

◆ $dic

ILIAS DI Container ilStartUpGUI::$dic
private

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

◆ $eventHandler

ilAppEventHandler ilStartUpGUI::$eventHandler
private

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

◆ $forced_cmd

string ilStartUpGUI::$forced_cmd = ''
staticprivate

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

◆ $help

ilHelpGUI ilStartUpGUI::$help
private

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

◆ $http

HTTPServices ilStartUpGUI::$http
private

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

◆ $httpRequest

ServerRequestInterface ilStartUpGUI::$httpRequest
private

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

Referenced by doSamlAuthentication().

◆ $lng

ilLanguage ilStartUpGUI::$lng
private

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

Referenced by buildStandardLoginForm().

◆ $logger

ilLogger ilStartUpGUI::$logger
private

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

Referenced by getLogger().

◆ $mainTemplate

ilGlobalTemplateInterface ilStartUpGUI::$mainTemplate
private

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

◆ $refinery

RefineryFactory ilStartUpGUI::$refinery
private

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

◆ $setting

ilSetting ilStartUpGUI::$setting
private

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

◆ $ui_factory

ILIAS UI Factory ilStartUpGUI::$ui_factory
private

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

◆ $ui_renderer

ILIAS UI Renderer ilStartUpGUI::$ui_renderer
private

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

◆ $user

ilObjUser ilStartUpGUI::$user
private

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

◆ PROP_ACCOUNT_MIGRATION

const ilStartUpGUI::PROP_ACCOUNT_MIGRATION = 'account_migration'
private

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

◆ PROP_ACCOUNT_MIGRATION_MIGRATE

const ilStartUpGUI::PROP_ACCOUNT_MIGRATION_MIGRATE = 'account_migration_migrate'
private

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

◆ PROP_ACCOUNT_MIGRATION_NEW

const ilStartUpGUI::PROP_ACCOUNT_MIGRATION_NEW = 'account_migration_new'
private

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

◆ PROP_AUTH_MODE

const ilStartUpGUI::PROP_AUTH_MODE = 'auth_mode'
private

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

◆ PROP_CODE

const ilStartUpGUI::PROP_CODE = 'code'
private

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

◆ PROP_PASSWORD

const ilStartUpGUI::PROP_PASSWORD = 'password'
private

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

◆ PROP_USERNAME

const ilStartUpGUI::PROP_USERNAME = 'username'
private

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


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