ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 doShibbolethAuthentication ()
 
 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(), 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.
ilGlobalTemplateInterface $mainTemplate
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
ServerRequestInterface $httpRequest
mainTemplate()
+ Here is the call graph for this function:

Member Function Documentation

◆ buildAccountMigrationForm()

ilStartUpGUI::buildAccountMigrationForm ( )
private

Definition at line 1120 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().

1121  {
1122  $field_factory = $this->ui_factory->input()->field();
1123 
1124  $keep = $field_factory->group(
1125  [
1126  self::PROP_USERNAME => $field_factory->text($this->lng->txt('login'))->withRequired(true),
1127  self::PROP_PASSWORD => $field_factory
1128  ->password($this->lng->txt('password'))
1129  ->withRequired(true)
1130  ->withRevelation(true)
1131  ->withAdditionalTransformation(
1132  $this->refinery->custom()->transformation(
1133  static function (ILIAS\Data\Password $value): string {
1134  return $value->toString();
1135  }
1136  )
1137  ),
1138  ],
1139  $this->lng->txt('auth_account_migration_keep'),
1140  $this->lng->txt('auth_info_migrate')
1141  );
1142 
1143  $new = $field_factory->group(
1144  [],
1145  $this->lng->txt('auth_account_migration_new'),
1146  $this->lng->txt('auth_info_add')
1147  );
1148 
1149  $fields = [
1150  self::PROP_ACCOUNT_MIGRATION => $field_factory->switchableGroup(
1151  [
1152  self::PROP_ACCOUNT_MIGRATION_MIGRATE => $keep,
1153  self::PROP_ACCOUNT_MIGRATION_NEW => $new,
1154  ],
1155  $this->lng->txt('auth_account_migration_name')
1156  )->withRequired(true)->withValue(self::PROP_ACCOUNT_MIGRATION_MIGRATE)
1157  ];
1158 
1159  $sections = [$field_factory->section($fields, $this->lng->txt('auth_account_migration'))];
1160 
1161  return $this->ui_factory->input()
1162  ->container()
1163  ->form()
1164  ->standard($this->ctrl->getFormAction($this, 'migrateAccount'), $sections)
1165  ->withDedicatedName('login_form')
1166  ->withSubmitLabel($this->lng->txt('save'))
1169  }
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(), null, 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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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'))];
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 713 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(), mainTemplate(), ilInitialisation\redirectToStartingPage(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

713  : void
714  {
715  $this->getLogger()->debug('Trying apache authentication');
716 
717  $credentials = new ilAuthFrontendCredentialsApache($this->httpRequest, $this->ctrl);
718  $credentials->initFromRequest();
719 
720  $provider_factory = new ilAuthProviderFactory();
721  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_APACHE);
722 
723  $status = ilAuthStatus::getInstance();
724 
725  $frontend_factory = new \ilAuthFrontendFactory();
726  $frontend_factory->setContext(\ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
727  $frontend = $frontend_factory->getFrontend(
728  $this->authSession,
729  $status,
730  $credentials,
731  [$provider]
732  );
733  $frontend->authenticate();
734 
735  switch ($status->getStatus()) {
737  if ($credentials->hasValidTargetUrl()) {
738  $this->logger->debug(
739  sprintf(
740  'Authentication successful. Redirecting to starting page: %s',
741  $credentials->getTargetUrl()
742  )
743  );
744  $this->ctrl->redirectToURL($credentials->getTargetUrl());
745  }
746  $this->logger->debug(
747  'Authentication successful, but no valid target URL given. Redirecting to default starting page.'
748  );
750 
751  // no break
753  $this->ctrl->redirect($this, 'showAccountMigration');
754 
755  // no break
757  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
758  $this->ctrl->redirectToURL(
760  $this->ctrl->getLinkTarget($this, 'showLoginPage', '', false, false),
761  'passed_sso=1'
762  )
763  );
764  }
765 
766  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
767  $this->showLoginPage();
768  }
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
const STATUS_AUTHENTICATION_FAILED
$provider
Definition: ltitoken.php:80
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
mainTemplate()
+ Here is the call graph for this function:

◆ doCasAuthentication()

ilStartUpGUI::doCasAuthentication ( )
private

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

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

639  : void
640  {
641  $this->getLogger()->debug('Trying cas authentication');
642  $credentials = new ilAuthFrontendCredentialsCAS();
643 
644  $provider_factory = new ilAuthProviderFactory();
645  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_CAS);
646 
647  $status = ilAuthStatus::getInstance();
648 
649  $frontend_factory = new ilAuthFrontendFactory();
650  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
651  $frontend = $frontend_factory->getFrontend(
652  $this->authSession,
653  $status,
654  $credentials,
655  [$provider]
656  );
657  $frontend->authenticate();
658 
659  switch ($status->getStatus()) {
661  $this->getLogger()->debug('Authentication successful.');
663 
664  // no break
666  default:
667  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt($status->getReason()));
668  $this->showLoginPage();
669  }
670  }
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
$provider
Definition: ltitoken.php:80
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
mainTemplate()
Auth frontend credentials for CAS auth.
+ Here is the call graph for this function:

◆ doLTIAuthentication()

ilStartUpGUI::doLTIAuthentication ( )
private

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

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

672  : void
673  {
674  $this->getLogger()->debug('Trying lti authentication');
675 
676  $credentials = new ilAuthFrontendCredentialsLTI();
677  $credentials->initFromRequest();
678 
679  $provider_factory = new ilAuthProviderFactory();
680  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_PROVIDER_LTI);
681 
682  $status = ilAuthStatus::getInstance();
683 
684  $frontend_factory = new ilAuthFrontendFactory();
685  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
686  $frontend = $frontend_factory->getFrontend(
687  $this->authSession,
688  $status,
689  $credentials,
690  [$provider]
691  );
692  $frontend->authenticate();
693 
694  switch ($status->getStatus()) {
696  ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
698 
699  // no break
701  $this->ctrl->redirect($this, 'showAccountMigration');
702 
703  // no break
705  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt($status->getReason()), true);
706  $this->ctrl->redirect($this, 'showLoginPage');
707  }
708 
709  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
710  $this->showLoginPage();
711  }
static getLogger(string $a_component_id)
Get component logger.
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
Auth credentials for lti oauth based authentication.
$provider
Definition: ltitoken.php:80
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
mainTemplate()
+ 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 1252 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(), mainTemplate(), ilAuthFrontend\MIG_TRIGGER_AUTHMODE, null, ilInitialisation\redirectToStartingPage(), showAccountMigration(), and ilAuthStatus\STATUS_AUTHENTICATED.

Referenced by migrateAccount().

1252  : void
1253  {
1254  $username = $migration_request_data[self::PROP_USERNAME];
1255  $password = $migration_request_data[self::PROP_PASSWORD];
1256 
1257  $this->logger->debug('Starting account migration for user: ' . ilSession::get('mig_ext_account'));
1258 
1259  $credentials = new ilAuthFrontendCredentials();
1260  $credentials->setUsername($username);
1261  $credentials->setPassword($password);
1262 
1263  $provider_factory = new ilAuthProviderFactory();
1264  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_LOCAL);
1265 
1266  $status = ilAuthStatus::getInstance();
1267 
1268  $frontend_factory = new ilAuthFrontendFactory();
1269  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1270  $frontend = $frontend_factory->getFrontend(
1271  $this->authSession,
1272  $status,
1273  $credentials,
1274  [$provider]
1275  );
1276  $frontend->authenticate();
1277 
1278  switch ($status->getStatus()) {
1280  $this->getLogger()->debug('Account migration: authentication successful for ' . $username);
1281 
1282  $provider = $provider_factory->getProviderByAuthMode(
1283  $credentials,
1285  );
1286  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1287  $frontend = $frontend_factory->getFrontend(
1288  $GLOBALS['DIC']['ilAuthSession'],
1289  $status,
1290  $credentials,
1291  [$provider]
1292  );
1293 
1294  if ($frontend->migrateAccount($GLOBALS['DIC']['ilAuthSession'])) {
1296  }
1297 
1298  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'), true);
1299  $this->ctrl->redirect($this, 'showAccountMigration');
1300 
1301  // no break
1302  default:
1303  $this->getLogger()->info('Account migration failed for user ' . $username);
1304  $this->showAccountMigration(null, $GLOBALS['lng']->txt('err_wrong_login'));
1305  }
1306  }
static get(string $a_var)
showAccountMigration(?ILIAS\UI\Component\Input\Container\Form\Form $form=null, string $message='')
Factory for auth frontend classes.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$provider
Definition: ltitoken.php:80
$GLOBALS["DIC"]
Definition: wac.php:53
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
mainTemplate()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doMigrationNewAccount()

ilStartUpGUI::doMigrationNewAccount ( )
private

Definition at line 1217 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(), mainTemplate(), ilAuthFrontend\MIG_EXTERNAL_ACCOUNT, ilAuthFrontend\MIG_TRIGGER_AUTHMODE, and ilInitialisation\redirectToStartingPage().

Referenced by migrateAccount().

1217  : void
1218  {
1219  $credentials = new ilAuthFrontendCredentials();
1220  $credentials->setUsername(ilSession::get(ilAuthFrontend::MIG_EXTERNAL_ACCOUNT));
1221 
1222  $provider_factory = new ilAuthProviderFactory();
1223  $provider = $provider_factory->getProviderByAuthMode(
1224  $credentials,
1226  );
1227 
1228  $this->logger->debug('Using provider: ' . get_class($provider) . ' for further processing.');
1229 
1230  $status = ilAuthStatus::getInstance();
1231 
1232  $frontend_factory = new ilAuthFrontendFactory();
1233  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1234  $frontend = $frontend_factory->getFrontend(
1235  $GLOBALS['DIC']['ilAuthSession'],
1236  $status,
1237  $credentials,
1238  [$provider]
1239  );
1240 
1241  if ($frontend->migrateAccountNew()) {
1243  }
1244 
1245  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
1246  $this->ctrl->redirect($this, 'showAccountMigration');
1247  }
static get(string $a_var)
Factory for auth frontend classes.
$provider
Definition: ltitoken.php:80
$GLOBALS["DIC"]
Definition: wac.php:53
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
mainTemplate()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doOpenIdConnectAuthentication()

ilStartUpGUI::doOpenIdConnectAuthentication ( )
private

Definition at line 1801 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(), mainTemplate(), ilInitialisation\redirectToStartingPage(), showLoginPage(), ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

1801  : void
1802  {
1803  $this->getLogger()->debug('Trying openid connect authentication');
1804 
1805  $credentials = new ilAuthFrontendCredentialsOpenIdConnect();
1806  $credentials->initFromRequest();
1807 
1808  $provider_factory = new ilAuthProviderFactory();
1809  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_OPENID_CONNECT);
1810 
1811  $status = ilAuthStatus::getInstance();
1812 
1813  $frontend_factory = new ilAuthFrontendFactory();
1814  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1815  $frontend = $frontend_factory->getFrontend(
1816  $this->authSession,
1817  $status,
1818  $credentials,
1819  [$provider]
1820  );
1821  $frontend->authenticate();
1822 
1823  switch ($status->getStatus()) {
1825  $this->logger->debug('Authentication successful; Redirecting to starting page.');
1826  if ($credentials->getRedirectionTarget()) {
1827  ilInitialisation::redirectToStartingPage($credentials->getRedirectionTarget());
1828  }
1830 
1831  // no break
1833  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
1834  $this->ctrl->redirect($this, 'showLoginPage');
1835  }
1836 
1837  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
1838  $this->showLoginPage();
1839  }
const AUTH_OPENID_CONNECT
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
$provider
Definition: ltitoken.php:80
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
mainTemplate()
+ Here is the call graph for this function:

◆ doSamlAuthentication()

ilStartUpGUI::doSamlAuthentication ( )
private

Definition at line 1841 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(), mainTemplate(), ilInitialisation\redirectToStartingPage(), showLoginPage(), showSamlIdpSelection(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, ilAuthStatus\STATUS_AUTHENTICATION_FAILED, and ilUtil\stripSlashes().

1841  : void
1842  {
1843  $this->getLogger()->debug('Trying saml authentication');
1844  $request = $this->httpRequest;
1845  $params = $request->getQueryParams();
1846 
1847  $factory = new ilSamlAuthFactory();
1848  $auth = $factory->auth();
1849 
1850  if (isset($params['action']) && $params['action'] === 'logout') {
1851  $logout_url = $params['logout_url'] ?? '';
1852  $this->logger->info(sprintf('Requested SAML logout: %s', $logout_url));
1853  $auth->logout($logout_url);
1854  }
1855 
1856  if (isset($params['target']) && !isset($params['returnTo'])) {
1857  $params['returnTo'] = $params['target'];
1858  }
1859 
1860  if (isset($params['returnTo'])) {
1861  $auth->storeParam('target', $params['returnTo']);
1862  }
1863 
1864  $this->logger->debug('Started SAML authentication request');
1865  if (!$auth->isAuthenticated()) {
1866  ilLoggerFactory::getLogger('auth')->debug('User is not authenticated, yet');
1867  if (!isset($request->getQueryParams()['idpentityid'], $request->getQueryParams()['saml_idp_id'])) {
1868  $activeIdps = ilSamlIdp::getActiveIdpList();
1869  if (count($activeIdps) === 1) {
1870  $idp = current($activeIdps);
1871 
1872  ilLoggerFactory::getLogger('auth')->debug(
1873  sprintf(
1874  'Found exactly one active IDP with id %s: %s',
1875  $idp->getIdpId(),
1876  $idp->getEntityId()
1877  )
1878  );
1879 
1880  $this->ctrl->setParameter($this, 'idpentityid', $idp->getEntityId());
1881  $this->ctrl->setParameter($this, 'saml_idp_id', $idp->getIdpId());
1882  $this->ctrl->setTargetScript('saml.php');
1883  $this->ctrl->redirect($this, 'doSamlAuthentication');
1884  } elseif ($activeIdps === []) {
1885  $this->logger->debug('Did not find any active IDP, skipp authentication process');
1886  $this->ctrl->redirect($this, 'showLoginPage');
1887  } else {
1888  $this->logger->debug('Found multiple active IPDs, presenting IDP selection...');
1889  $this->showSamlIdpSelection($auth, $activeIdps);
1890  return;
1891  }
1892  }
1893 
1894  $auth->storeParam('idpId', (int) $request->getQueryParams()['saml_idp_id']);
1895  $this->logger->debug(sprintf('Stored relevant IDP id in session: %s', $auth->getParam('idpId')));
1896  }
1897 
1898  $auth = $factory->auth();
1899 
1900  $this->logger->debug('Checking SAML authentication status...');
1901  $auth->protectResource();
1902  $this->logger->debug(
1903  'SAML authentication successful, continuing with ILIAS internal authentication process...'
1904  );
1905 
1906  $idpId = (int) $auth->getParam('idpId');
1907 
1908  $this->logger->debug(
1909  sprintf(
1910  'Internal SAML IDP id fetched from session: %s',
1911  $idpId
1912  )
1913  );
1914 
1915  if ($idpId < 1) {
1916  $this->logger->debug(
1917  'No valid internal IDP id found (most probably due to IDP initiated SSO), trying fallback determination...'
1918  );
1919  $authData = $auth->getAuthDataArray();
1920  if (isset($authData['saml:sp:IdP'])) {
1921  $idpId = ilSamlIdp::geIdpIdByEntityId($authData['saml:sp:IdP']);
1922  $this->logger->debug(
1923  sprintf(
1924  'Searching active ILIAS IDP by entity id "%s" results in: %s',
1925  $authData['saml:sp:IdP'],
1926  $idpId
1927  )
1928  );
1929  } else {
1930  $this->logger->debug(
1931  'Could not execute fallback determination, no IDP entity ID found SAML authentication session data'
1932  );
1933  }
1934  }
1935 
1936  $target = $auth->popParam('target');
1937 
1938  $this->logger->debug(sprintf('Retrieved "target" parameter: %s', print_r($target, true)));
1939 
1940  $credentials = new ilAuthFrontendCredentialsSaml($auth, $request);
1941  $credentials->initFromRequest();
1942 
1943  $provider_factory = new ilAuthProviderFactory();
1944  $provider = $provider_factory->getProviderByAuthMode(
1945  $credentials,
1947  ilAuthUtils::AUTH_SAML . '_' . $idpId
1948  )
1949  );
1950 
1951  if ($target) {
1952  $credentials->setReturnTo($target);
1953  } else {
1954  $target = $credentials->getReturnTo();
1955  }
1956 
1957  $status = ilAuthStatus::getInstance();
1958 
1959  $frontend_factory = new ilAuthFrontendFactory();
1960  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1961  $frontend = $frontend_factory->getFrontend(
1962  $this->authSession,
1963  $status,
1964  $credentials,
1965  [$provider]
1966  );
1967  $frontend->authenticate();
1968 
1969  switch ($status->getStatus()) {
1971  $this->logger->debug('Authentication successful; Redirecting to starting page.');
1973 
1974  // no break
1976  $this->ctrl->redirect($this, 'showAccountMigration');
1977 
1978  // no break
1980  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
1981  $this->ctrl->redirect($this, 'showLoginPage');
1982  }
1983 
1984  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
1985  $this->showLoginPage();
1986  }
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="")
Factory for auth frontend classes.
$provider
Definition: ltitoken.php:80
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
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
mainTemplate()
+ Here is the call graph for this function:

◆ doShibbolethAuthentication()

ilStartUpGUI::doShibbolethAuthentication ( )
private

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

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

598  : void
599  {
600  $this->getLogger()->debug('Trying shibboleth authentication');
601 
602  $credentials = new ilAuthFrontendCredentialsShibboleth();
603  $credentials->initFromRequest();
604 
605  $provider_factory = new ilAuthProviderFactory();
606  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_SHIBBOLETH);
607 
608  $status = ilAuthStatus::getInstance();
609 
610  $frontend_factory = new ilAuthFrontendFactory();
611  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
612  $frontend = $frontend_factory->getFrontend(
613  $this->authSession,
614  $status,
615  $credentials,
616  [$provider]
617  );
618  $frontend->authenticate();
619 
620  switch ($status->getStatus()) {
622  $this->logger->debug('Authentication successful; Redirecting to starting page.');
624 
625  // no break
627  $this->ctrl->redirect($this, 'showAccountMigration');
628 
629  // no break
631  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
632  $this->ctrl->redirect($this, 'showLoginPage');
633  }
634 
635  $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'));
636  $this->showLoginPage();
637  }
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
$provider
Definition: ltitoken.php:80
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const STATUS_ACCOUNT_MIGRATION_REQUIRED
mainTemplate()
+ Here is the call graph for this function:

◆ doStandardAuthentication()

ilStartUpGUI::doStandardAuthentication ( )
private

Definition at line 770 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(), mainTemplate(), null, ilInitialisation\redirectToStartingPage(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, ilAuthStatus\STATUS_AUTHENTICATION_FAILED, and ilAuthStatus\STATUS_CODE_ACTIVATION_REQUIRED.

770  : void
771  {
772  $form = $this->buildStandardLoginForm();
773  $form_valid = false;
774  $form_data = null;
775  if ($this->http->request()->getMethod() === 'POST') {
776  $form = $form->withRequest($this->http->request());
777  $form_data = $form->getData();
778  $form_valid = $form_data !== null;
779  }
780 
781  if (!$form_valid) {
782  $this->showLoginPage($form);
783  return;
784  }
785 
786  $this->getLogger()->debug('Trying to authenticate user.');
787 
788  $auth_callback = function () use ($form_data) {
789  $credentials = new ilAuthFrontendCredentials();
790  $credentials->setUsername($form_data[self::PROP_USERNAME]);
791  $credentials->setPassword($form_data[self::PROP_PASSWORD]);
792 
794  if (ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection()) {
795  $credentials->setAuthMode($form_data[self::PROP_AUTH_MODE]);
796  }
797 
798  $provider_factory = new ilAuthProviderFactory();
799  $providers = $provider_factory->getProviders($credentials);
800 
801  $status = ilAuthStatus::getInstance();
802 
803  $frontend_factory = new ilAuthFrontendFactory();
804  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
805  $frontend = $frontend_factory->getFrontend(
806  $this->authSession,
807  $status,
808  $credentials,
809  $providers
810  );
811  $frontend->authenticate();
812 
813  return $status;
814  };
815 
816  if (($auth_duration = $this->setting->get('auth_duration')) !== null) {
817  $duration = $this->http->durations()->callbackDuration((int) $auth_duration);
818  $status = $duration->stretch($auth_callback);
819  } else {
820  $status = $auth_callback();
821  }
822 
823  switch ($status->getStatus()) {
825  ilLoggerFactory::getLogger('auth')->debug(
826  'Authentication successful; Redirecting to starting page.'
827  );
829 
830  // no break
832  $uname = ilObjUser::_lookupLogin($status->getAuthenticatedUserId());
833  $this->showLoginPage($this->buildCodeForm($uname));
834  return;
835 
837  $this->ctrl->redirect($this, 'showAccountMigration');
838 
839  // no break
841  $this->mainTemplate->setOnScreenMessage('failure', $status->getTranslatedReason());
842  $this->showLoginPage($form);
843  }
844  }
static getLogger(string $a_component_id)
Get component logger.
static _hasMultipleAuthenticationMethods()
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
$duration
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
const STATUS_CODE_ACTIVATION_REQUIRED
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
mainTemplate()
buildCodeForm(?string $username=null)
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 994 of file class.ilStartUpGUI.php.

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

Referenced by showLoginPage(), and showLogout().

994  : string
995  {
996  $ipe_settings = ilAuthPageEditorSettings::getInstance($ipe_context);
997 
998  $ipe_language = $ipe_settings->getIliasEditorLanguage($this->lng->getLangKey());
999  if (!$ipe_language) {
1000  return '';
1001  }
1002 
1003  // if page does not exist, return nothing
1004  if (!ilPageUtil::_existsAndNotEmpty($ipe_context->pageType(), ilLanguage::lookupId($ipe_language))) {
1005  return '';
1006  }
1007 
1008  $this->dic->contentStyle()->gui()->addCss($this->mainTemplate, ilObjAuthSettings::getAuthSettingsRefId());
1009 
1010  $page_gui = new ($ipe_context->pageUiClass())(ilLanguage::lookupId($ipe_language));
1011 
1012  $page_gui->setStyleId(0);
1013 
1014  $page_gui->setPresentationTitle('');
1015  $page_gui->setTemplateOutput(false);
1016  $page_gui->setHeader('');
1017 
1018  return $page_gui->showPage();
1019  }
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)
mainTemplate()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogger()

ilStartUpGUI::getLogger ( )
private

◆ 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 1679 of file class.ilStartUpGUI.php.

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

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

1684  global $DIC;
1685 
1686  $tpl = new ilGlobalTemplate('tpl.main.html', true, true);
1687 
1688  $tpl->addBlockfile('CONTENT', 'content', 'tpl.startup_screen.html', 'components/ILIAS/Init');
1689 
1690  $view_title = $DIC->language()->txt('login_to_ilias');
1691  if ($a_show_back) {
1692  // #13400
1693  $param = 'client_id=' . CLIENT_ID . '&lang=' . $DIC->language()->getLangKey();
1694 
1695  $tpl->setCurrentBlock('link_item_bl');
1696  $tpl->setVariable('LINK_TXT', $view_title);
1697  $tpl->setVariable('LINK_URL', 'login.php?cmd=force_login&' . $param);
1698  $tpl->parseCurrentBlock();
1699 
1700  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1701  $DIC->access()->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1702  $tpl->setVariable('LINK_URL', 'index.php?' . $param);
1703  $tpl->setVariable('LINK_TXT', $DIC->language()->txt('home'));
1704  $tpl->parseCurrentBlock();
1705  }
1706  } elseif ($a_show_logout) {
1707  $view_title = $DIC->language()->txt('logout');
1708  $tpl->setCurrentBlock('link_item_bl');
1709  $tpl->setVariable('LINK_TXT', $view_title);
1710  $tpl->setVariable('LINK_URL', self::logoutUrl());
1711  $tpl->parseCurrentBlock();
1712  }
1713 
1714  if (is_array($a_tmpl)) {
1715  $template_file = $a_tmpl[0];
1716  $template_dir = $a_tmpl[1];
1717  } else {
1718  $template_file = $a_tmpl;
1719  $template_dir = 'components/ILIAS/Init';
1720  }
1721 
1722  $tpl->addBlockFile('STARTUP_CONTENT', 'startup_content', $template_file, $template_dir);
1723 
1724  PageContentProvider::setViewTitle($view_title);
1725  $short_title = trim($DIC->settings()->get('short_inst_name') ?? '');
1726  if ($short_title === '') {
1727  $short_title = 'ILIAS';
1728  }
1729  PageContentProvider::setShortTitle($short_title);
1730 
1731  $header_title = ilObjSystemFolder::_getHeaderTitle();
1732  PageContentProvider::setTitle($header_title);
1733 
1734  return $tpl;
1735  }
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:26
$param
Definition: xapitoken.php:46
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: shib_login.php:22
+ 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 2033 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().

2033  : string
2034  {
2035  global $DIC;
2036 
2037  $defaults = ['lang' => $DIC->user()->getCurrentLanguage()];
2038  $parameters = '&' . http_build_query(array_merge($defaults, $parameters));
2039 
2040  $DIC->ctrl()->setTargetScript('logout.php');
2041  $url = $DIC->ctrl()->getLinkTargetByClass([self::class], 'doLogout') . $parameters;
2042  $DIC->ctrl()->setTargetScript('ilias.php');
2043 
2044  return $url;
2045  }
$url
Definition: shib_logout.php:66
global $DIC
Definition: shib_login.php:22
+ 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 1187 of file class.ilStartUpGUI.php.

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

1187  : void
1188  {
1189  $form = $this->buildAccountMigrationForm();
1190  $form_valid = false;
1191  $form_data = null;
1192  if ($this->http->request()->getMethod() === 'POST') {
1193  $form = $form->withRequest($this->http->request());
1194  $form_data = $form->getData();
1195  $form_valid = $form_data !== null;
1196  }
1197 
1198  if (!$form_valid) {
1199  $this->showAccountMigration($form, $this->lng->txt('form_input_not_valid'));
1200  return;
1201  }
1202 
1203  $account_migration = $form_data[self::PROP_ACCOUNT_MIGRATION];
1204  $account_migration_mode = $account_migration[0];
1205  if ($account_migration_mode === self::PROP_ACCOUNT_MIGRATION_MIGRATE) {
1206  $this->doMigration($account_migration[1]);
1207  } elseif ($account_migration_mode === self::PROP_ACCOUNT_MIGRATION_NEW) {
1208  $this->doMigrationNewAccount();
1209  } else {
1210  $this->showAccountMigration(
1211  $form,
1212  $this->lng->txt('form_input_not_valid')
1213  );
1214  }
1215  }
showAccountMigration(?ILIAS\UI\Component\Input\Container\Form\Form $form=null, string $message='')
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
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\getAssignPasswordForm(), 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:22
+ 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(), mainTemplate(), null, 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  }
setTimeLimitUnlimited(bool $a_unlimited)
static getCodeValidUntil(string $code)
static _lookupId($a_user_str)
setTimeLimitUntil(?int $a_until)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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:53
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static isUnusedCode(string $code)
showCodeForm(?string $username=null, ?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
static useCode(string $code)
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
static applyRoleAssignments(ilObjUser $user, string $code)
mainTemplate()
static applyAccessLimits(ilObjUser $user, string $code)
buildCodeForm(?string $username=null)
+ Here is the call graph for this function:

◆ processIndexPHP()

ilStartUpGUI::processIndexPHP ( )
private

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

References $_COOKIE, $_GET, $_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(), 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(), mainTemplate(), ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_FAILURE, ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_SUCCESS, ilObjUser\PASSWD_PLAIN, ilUtil\redirect(), ilInitialisation\redirectToStartingPage(), ILIAS\Repository\refinery(), ilSession\set(), ilObjUser\setActive(), ilUtil\setCookie(), ilObjUser\setLastPasswordChangeTS(), ilObjUser\setPasswd(), showLoginPage(), ilObjUser\update(), and ILIAS\Repository\user().

1408  : void
1409  {
1410  if ($this->authSession->isValid()) {
1411  if (!$this->user->isAnonymous() || ilPublicSectionSettings::getInstance()->isEnabledForDomain(
1412  $this->httpRequest->getServerParams()['SERVER_NAME']
1413  )) {
1415  return;
1416  }
1417  }
1418 
1419  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) {
1421  }
1422 
1423  $this->showLoginPage();
1424  }
static goToPublicSection()
go to public section
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
static redirectToStartingPage(string $target='')
+ Here is the call graph for this function:

◆ purgePlaceholders()

ilStartUpGUI::purgePlaceholders ( string  $page_editor_html)
private

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

Referenced by showLoginPage().

1101  : string
1102  {
1103  return str_replace(
1104  [
1105  '[list-language-selection]',
1106  '[list-registration-link]',
1107  '[list-user-agreement]',
1108  '[list-dpro-agreement]',
1109  '[list-login-form]',
1110  '[list-cas-login-form]',
1111  '[list-saml-login]',
1112  '[list-shibboleth-login-form]',
1113  '[list-openid-connect-login]'
1114  ],
1115  '',
1116  $page_editor_html
1117  );
1118  }
+ 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 $messages, ilSession\get(), ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_FAILURE, ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_INFO, ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_QUESTION, and ILIAS\UICore\GlobalTemplate\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)
$messages
Definition: xapiexit.php:21
+ 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 1171 of file class.ilStartUpGUI.php.

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

Referenced by doMigration(), and migrateAccount().

1174  : void {
1175  $this->help->setSubScreenId('account_migration');
1176 
1177  $tpl = self::initStartUpTemplate('tpl.login_account_migration.html');
1178  $tpl->setVariable('MIG_FORM', $this->ui_renderer->render($form ?? $this->buildAccountMigrationForm()));
1179 
1180  if ($message !== '') {
1181  $this->mainTemplate->setOnScreenMessage('failure', $message);
1182  }
1183 
1184  self::printToGlobalTemplate($tpl);
1185  }
$message
Definition: xapiexit.php:31
mainTemplate()
+ 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 870 of file class.ilStartUpGUI.php.

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

Referenced by showLoginPage().

870  : string
871  {
872  if ($this->setting->get('cas_active')) {
873  $tpl = new ilTemplate('tpl.login_form_cas.html', true, true, 'components/ILIAS/Init');
874  $tpl->setVariable('TXT_CAS_LOGIN', $this->lng->txt('login_to_ilias_via_cas'));
875  $tpl->setVariable('TXT_CAS_LOGIN_BUTTON', ilUtil::getImagePath('auth/cas_login_button.png'));
876  $tpl->setVariable('TXT_CAS_LOGIN_INSTRUCTIONS', $this->setting->get('cas_login_instructions'));
877  $this->ctrl->setParameter($this, 'forceCASLogin', '1');
878  $tpl->setVariable('TARGET_CAS_LOGIN', $this->ctrl->getLinkTarget($this, 'doCasAuthentication'));
879  $this->ctrl->setParameter($this, 'forceCASLogin', '');
880 
881  return $this->substituteLoginPageElements(
882  $GLOBALS['tpl'],
883  $page_editor_html,
884  $tpl->get(),
885  '[list-cas-login-form]',
886  'CAS_LOGIN_FORM'
887  );
888  }
889 
890  return $page_editor_html;
891  }
$GLOBALS["DIC"]
Definition: wac.php:53
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 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  }
mainTemplate()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLegalDocuments()

ilStartUpGUI::showLegalDocuments ( )
protected

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

References $DIC.

1400  : void
1401  {
1402  global $DIC;
1403  $tpl = self::initStartUpTemplate(['agreement.html', 'components/ILIAS/LegalDocuments'], true, false);
1404  $tpl->setVariable('CONTENT', $DIC['legalDocuments']->agreeContent(self::class, __FUNCTION__));
1405  self::printToGlobalTemplate($tpl);
1406  }
global $DIC
Definition: shib_login.php:22

◆ showLegalDocumentsLinks()

ilStartUpGUI::showLegalDocumentsLinks ( string  $page_editor_html)
private

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

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

Referenced by showLoginPage().

1074  : string
1075  {
1076  global $tpl;
1077  global $DIC;
1078 
1079  if (0 === $this->user->getId()) {
1080  $this->user->setId(ANONYMOUS_USER_ID);
1081  }
1082 
1083  $page_editor_html = $this->substituteLoginPageElements(
1084  $tpl,
1085  $page_editor_html,
1086  $DIC['legalDocuments']->loginPageHTML(TermsOfService::ID),
1087  '[list-user-agreement]',
1088  'USER_AGREEMENT'
1089  );
1090  $page_editor_html = $this->substituteLoginPageElements(
1091  $tpl,
1092  $page_editor_html,
1093  $DIC['legalDocuments']->loginPageHTML(DataProtection::ID),
1094  '[list-dpro-agreement]',
1095  'DPRO_AGREEMENT'
1096  );
1097 
1098  return $page_editor_html;
1099  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: shib_login.php:22
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 846 of file class.ilStartUpGUI.php.

References substituteLoginPageElements().

Referenced by showLoginPage().

849  : string {
850  global $tpl;
851 
852  return $this->substituteLoginPageElements(
853  $tpl,
854  $page_editor_html,
855  $this->ui_renderer->render($form ?? $this->buildStandardLoginForm()),
856  '[list-login-form]',
857  'LOGIN_FORM'
858  );
859  }
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 861 of file class.ilStartUpGUI.php.

Referenced by showLoginPage().

861  : string
862  {
863  if ($page_editor_html !== '') {
864  return $page_editor_html;
865  }
866 
867  return $page_editor_html;
868  }
+ 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(), mainTemplate(), ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_FAILURE, ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_SUCCESS, null, purgePlaceholders(), ILIAS\Repository\refinery(), showCASLoginForm(), showLegalDocumentsLinks(), showLoginForm(), showLoginInformation(), showOpenIdConnectLoginForm(), showRegistrationLinks(), showSamlLoginForm(), and showShibbolethLoginForm().

Referenced by doApacheAuthentication(), doCasAuthentication(), doLTIAuthentication(), doOpenIdConnectAuthentication(), doSamlAuthentication(), doShibbolethAuthentication(), 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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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:53
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)
mainTemplate()
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 $messages, ILIAS\FileDelivery\http(), ILIAS\Repository\logger(), 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()) {
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  }
$messages
Definition: xapiexit.php:21
static http()
Fetches the global http state from ILIAS.
showLoginPage(?ILIAS\UI\Component\Input\Container\Form\Form $form=null)
const SESSION_CLOSE_USER
static redirectToStartingPage(string $target='')
static setClosingContext(int $a_context)
set closing context (for statistics)
mainTemplate()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLogout()

ilStartUpGUI::showLogout ( )
private

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

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

1308  : void
1309  {
1310  if (!$this->authSession->isExpired() &&
1311  $this->authSession->isAuthenticated() &&
1312  !ilObjUser::_isAnonymous($this->authSession->getUserId())) {
1313  $this->ctrl->redirectToURL(ilUserUtil::getStartingPointAsUrl());
1314  }
1315 
1316  $this->help->setSubScreenId('logout');
1317 
1318  $tpl = self::initStartUpTemplate('tpl.logout.html');
1319  $client_id = $this->http->wrapper()->query()->retrieve(
1320  'client_id',
1321  $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
1322  );
1323  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) {
1324  $tpl->setCurrentBlock('homelink');
1325  $tpl->setVariable('CLIENT_ID', '?client_id=' . $client_id . '&lang=' . $this->lng->getLangKey());
1326  $tpl->setVariable('TXT_HOME', $this->lng->txt('home'));
1327  $tpl->parseCurrentBlock();
1328  }
1329 
1330  $tpl->setVariable('LPE', $this->getAuthPageEditorHtml(AuthPageEditorContext::LOGOUT));
1331  $tpl->setVariable('TXT_PAGEHEADLINE', $this->lng->txt('logout'));
1332  $tpl->setVariable('TXT_LOGIN', $this->lng->txt('login_to_ilias'));
1333  $tpl->setVariable(
1334  'CLIENT_ID',
1335  '?client_id=' . $client_id . '&cmd=force_login&lang=' . $this->lng->getLangKey()
1336  );
1337 
1338  self::printToGlobalTemplate($tpl);
1339  }
getAuthPageEditorHtml(AuthPageEditorContext $ipe_context)
static http()
Fetches the global http state from ILIAS.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
static _isAnonymous(int $usr_id)
$client_id
Definition: ltiauth.php:66
+ Here is the call graph for this function:

◆ showOpenIdConnectLoginForm()

ilStartUpGUI::showOpenIdConnectLoginForm ( string  $page_editor_html)
private

Definition at line 1766 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().

1766  : string
1767  {
1768  $oidc_settings = ilOpenIdConnectSettings::getInstance();
1769  if ($oidc_settings->getActive()) {
1770  $tpl = new ilTemplate('tpl.login_element.html', true, true, 'components/ILIAS/OpenIdConnect');
1771 
1772  $this->lng->loadLanguageModule('auth');
1773  $tpl->setVariable('TXT_OIDCONNECT_HEADER', $this->lng->txt('auth_oidc_login_element_info'));
1774 
1775  $target = $this->initTargetFromQuery();
1776  $target_str = empty($target) ? '' : ('?target=' . $target);
1777  switch ($oidc_settings->getLoginElementType()) {
1779  $tpl->setVariable('SCRIPT_OIDCONNECT_T', './openidconnect.php' . $target_str);
1780  $tpl->setVariable('TXT_OIDC', $oidc_settings->getLoginElemenText());
1781  break;
1782 
1784  $tpl->setVariable('SCRIPT_OIDCONNECT_I', './openidconnect.php' . $target_str);
1785  $tpl->setVariable('IMG_SOURCE', $oidc_settings->getImageFilePath());
1786  break;
1787  }
1788 
1789  return $this->substituteLoginPageElements(
1790  $GLOBALS['tpl'],
1791  $page_editor_html,
1792  $tpl->get(),
1793  '[list-openid-connect-login]',
1794  'OPEN_ID_CONNECT_LOGIN_FORM'
1795  );
1796  }
1797 
1798  return $page_editor_html;
1799  }
$GLOBALS["DIC"]
Definition: wac.php:53
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 1021 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().

1021  : string
1022  {
1023  global $tpl;
1024 
1025  $rtpl = new ilTemplate('tpl.login_registration_links.html', true, true, 'components/ILIAS/Init');
1026 
1027  // allow new registrations?
1029  $rtpl->setCurrentBlock('new_registration');
1030  $rtpl->setVariable('REGISTER', $this->lng->txt('registration'));
1031  $rtpl->setVariable(
1032  'CMD_REGISTER',
1033  $this->ctrl->getLinkTargetByClass(ilAccountRegistrationGUI::class)
1034  );
1035  $rtpl->parseCurrentBlock();
1036  }
1037  // allow password assistance? Surpress option if Authmode is not local database
1038  if ($this->setting->get('password_assistance')) {
1039  $rtpl->setCurrentBlock('password_assistance');
1040  $rtpl->setVariable('FORGOT_PASSWORD', $this->lng->txt('forgot_password'));
1041  $rtpl->setVariable('FORGOT_USERNAME', $this->lng->txt('forgot_username'));
1042  $rtpl->setVariable(
1043  'CMD_FORGOT_PASSWORD',
1044  $this->ctrl->getLinkTargetByClass(ilPasswordAssistanceGUI::class)
1045  );
1046  $rtpl->setVariable(
1047  'CMD_FORGOT_USERNAME',
1048  $this->ctrl->getLinkTargetByClass(ilPasswordAssistanceGUI::class, 'showUsernameAssistanceForm')
1049  );
1050  $rtpl->setVariable('LANG_ID', $this->lng->getLangKey());
1051  $rtpl->parseCurrentBlock();
1052  }
1053 
1054  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1055  $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1056  $rtpl->setCurrentBlock('homelink');
1057  $rtpl->setVariable(
1058  'CLIENT_ID',
1059  '?client_id=' . CLIENT_ID . '&lang=' . $this->lng->getLangKey()
1060  );
1061  $rtpl->setVariable('TXT_HOME', $this->lng->txt('home'));
1062  $rtpl->parseCurrentBlock();
1063  }
1064 
1065  return $this->substituteLoginPageElements(
1066  $tpl,
1067  $page_editor_html,
1068  $rtpl->get(),
1069  '[list-registration-link]',
1070  'REG_PWD_CLIENT_LINKS'
1071  );
1072  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const ROOT_FOLDER_ID
Definition: constants.php:32
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
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 1991 of file class.ilStartUpGUI.php.

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

Referenced by doSamlAuthentication().

1991  : void
1992  {
1993  $this->help->setSubScreenId('saml_idp_selection');
1994 
1995  self::initStartUpTemplate(['tpl.saml_idp_selection.html', 'components/ILIAS/Saml']);
1996 
1997  $this->ctrl->setTargetScript('saml.php');
1998  $items = [];
1999  foreach ($idps as $idp) {
2000  $this->ctrl->setParameter($this, 'saml_idp_id', $idp->getIdpId());
2001  $this->ctrl->setParameter($this, 'idpentityid', urlencode($idp->getEntityId()));
2002 
2003  $items[] = $this->ui_factory->link()->standard(
2004  $idp->getEntityId(),
2005  $this->ctrl->getLinkTarget($this, 'doSamlAuthentication')
2006  );
2007  }
2008 
2009  $components = [
2010  $this->ui_factory->panel()->standard(
2011  $this->lng->txt('auth_saml_idp_selection_table_title'),
2012  [
2013  $this->ui_factory->messageBox()->info($this->lng->txt('auth_saml_idp_selection_table_desc')),
2014  $this->ui_factory->listing()->unordered(
2015  array_map(
2016  fn($item) => $this->ui_renderer->render($item),
2017  $items
2018  )
2019  )
2020  ]
2021  )
2022  ];
2023 
2024  $this->mainTemplate->setVariable('CONTENT', $this->ui_renderer->render($components));
2025  $this->mainTemplate->printToStdout('DEFAULT', false);
2026  }
$components
mainTemplate()
+ 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 1737 of file class.ilStartUpGUI.php.

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

Referenced by showLoginPage().

1737  : string
1738  {
1739  if (count(ilSamlIdp::getActiveIdpList()) > 0 && ilSamlSettings::getInstance()->isDisplayedOnLoginPage()) {
1740  $tpl = new ilTemplate('tpl.login_form_saml.html', true, true, 'components/ILIAS/Saml');
1741 
1742  $return = '';
1743  $target = $this->initTargetFromQuery();
1744  if ($target !== '') {
1745  $return = '?returnTo=' . urlencode(ilUtil::stripSlashes($target));
1746  }
1747 
1748  $tpl->setVariable('SAML_SCRIPT_URL', './saml.php' . $return);
1749  $tpl->setVariable('TXT_LOGIN', $this->lng->txt('saml_log_in'));
1750  $tpl->setVariable('LOGIN_TO_ILIAS_VIA_SAML', $this->lng->txt('login_to_ilias_via_saml'));
1751  $tpl->setVariable('TXT_SAML_LOGIN_TXT', $this->lng->txt('saml_login_form_txt'));
1752  $tpl->setVariable('TXT_SAML_LOGIN_INFO_TXT', $this->lng->txt('saml_login_form_info_txt'));
1753 
1754  return $this->substituteLoginPageElements(
1755  $GLOBALS['tpl'],
1756  $page_editor_html,
1757  $tpl->get(),
1758  '[list-saml-login]',
1759  'SAML_LOGIN_FORM'
1760  );
1761  }
1762 
1763  return $page_editor_html;
1764  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
$GLOBALS["DIC"]
Definition: wac.php:53
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 893 of file class.ilStartUpGUI.php.

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

Referenced by showLoginPage().

893  : string
894  {
895  $target = $this->initTargetFromQuery();
896 
897  if ($this->setting->get('shib_active')) {
898  $tpl = new ilTemplate('tpl.login_form_shibboleth.html', true, true, 'components/ILIAS/Init');
899 
900  $tpl->setVariable(
901  'SHIB_FORMACTION',
902  './shib_login.php'
903  ); // Bugfix http://ilias.de/mantis/view.php?id=10662 {$tpl->setVariable('SHIB_FORMACTION', $this->ctrl->getFormAction($this));}
904  $federation_name = $this->setting->get('shib_federation_name');
905  $admin_mail = ' <a href="mailto:' . $this->setting->get('admin_email') . '">ILIAS ' . $this->lng->txt(
906  'administrator'
907  ) . '</a>.';
908  if ($this->setting->get('shib_hos_type') === 'external_wayf') {
909  $tpl->setCurrentBlock('shibboleth_login');
910  $tpl->setVariable('TXT_SHIB_LOGIN', $this->lng->txt('login_to_ilias_via_shibboleth'));
911  $tpl->setVariable('IL_TARGET', $target);
912  $tpl->setVariable('TXT_SHIB_FEDERATION_NAME', $this->setting->get('shib_federation_name'));
913  $tpl->setVariable('TXT_SHIB_LOGIN_BUTTON', $this->setting->get('shib_login_button'));
914  $tpl->setVariable(
915  'TXT_SHIB_LOGIN_INSTRUCTIONS',
916  sprintf(
917  $this->lng->txt('shib_general_login_instructions'),
918  $federation_name,
919  $admin_mail
920  )
921  );
922  $tpl->setVariable('TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS', $this->setting->get('shib_login_instructions'));
923  $tpl->parseCurrentBlock();
924  } elseif ($this->setting->get('shib_hos_type') == 'embedded_wayf') {
925  $tpl->setCurrentBlock('shibboleth_custom_login');
926  $customInstructions = stripslashes($this->setting->get('shib_login_instructions'));
927  $tpl->setVariable('TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS', $customInstructions);
928  $tpl->parseCurrentBlock();
929  } else {
930  $tpl->setCurrentBlock('shibboleth_wayf_login');
931  $tpl->setVariable('TXT_SHIB_LOGIN', $this->lng->txt('login_to_ilias_via_shibboleth'));
932  $tpl->setVariable('TXT_SHIB_FEDERATION_NAME', $this->setting->get('shib_federation_name'));
933  $tpl->setVariable(
934  'TXT_SELECT_HOME_ORGANIZATION',
935  sprintf(
936  $this->lng->txt('shib_select_home_organization'),
937  $this->setting->get('shib_federation_name')
938  )
939  );
940  $tpl->setVariable('TXT_CONTINUE', $this->lng->txt('btn_next'));
941  $tpl->setVariable('TXT_SHIB_HOME_ORGANIZATION', $this->lng->txt('shib_home_organization'));
942  $tpl->setVariable(
943  'TXT_SHIB_LOGIN_INSTRUCTIONS',
944  sprintf(
945  $this->lng->txt('shib_general_wayf_login_instructions'),
946  $admin_mail
947  )
948  );
949  $tpl->setVariable('TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS', $this->setting->get('shib_login_instructions'));
950 
951  $ilShibbolethWAYF = new ilShibbolethWAYF();
952 
953  $tpl->setVariable('TXT_SHIB_INVALID_SELECTION', $ilShibbolethWAYF->showNotice());
954  $tpl->setVariable('SHIB_IDP_LIST', $ilShibbolethWAYF->generateSelection());
955  $tpl->setVariable('ILW_TARGET', $target);
956  $tpl->parseCurrentBlock();
957  }
958 
959  return $this->substituteLoginPageElements(
960  $GLOBALS['tpl'],
961  $page_editor_html,
962  $tpl->get(),
963  '[list-shibboleth-login-form]',
964  'SHIB_LOGIN_FORM'
965  );
966  }
967 
968  return $page_editor_html;
969  }
$GLOBALS["DIC"]
Definition: wac.php:53
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 974 of file class.ilStartUpGUI.php.

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

980  : string {
981  if ($page_editor_html === '') {
982  $tpl->setVariable($fallback_tplvar, $element_html);
983  return $page_editor_html;
984  }
985 
986  if (stripos($page_editor_html, $placeholder) === false) {
987  $tpl->setVariable($fallback_tplvar, $element_html);
988  return $page_editor_html;
989  }
990 
991  return str_replace($placeholder, $element_html, $page_editor_html);
992  }
+ 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: