ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStartUpGUI Class Reference

StartUp GUI class. More...

+ Collaboration diagram for ilStartUpGUI:

Public Member Functions

 __construct (\ilObjUser $user=null, \ilTermsOfServiceDocumentEvaluation $termsOfServiceEvaluation=null, \ilGlobalTemplate $mainTemplate=null, ServerRequestInterface $httpRequest=null)
 ilStartUpGUI constructor. More...
 
 executeCommand ()
 execute command More...
 
 getLogger ()
 Get logger. More...
 
 jumpToRegistration ()
 jump to registration gui More...
 
 jumpToPasswordAssistance ()
 jump to password assistance More...
 
 showAccountMigration (string $message='')
 Show account migration screen. More...
 
 doLogout ()
 show logout screen More...
 
 showClientList ()
 show client list More...
 
 showNoCookiesScreen ()
 show help screen, if cookies are disabled More...
 

Static Public Member Functions

static printToGlobalTemplate ($tpl)
 
static _checkGoto ($a_target)
 

Data Fields

const ACCOUNT_MIGRATION_MIGRATE = 1
 
const ACCOUNT_MIGRATION_NEW = 2
 

Protected Member Functions

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

Protected Attributes

 $ctrl
 
 $lng
 
 $logger
 
 $mainTemplate
 
 $user
 
 $termsOfServiceEvaluation
 
 $httpRequest
 

Detailed Description

StartUp GUI class.

Handles Login and Registration.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ ilStartUpGUI: ilAccountRegistrationGUI, ilPasswordAssistanceGUI, ilLoginPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

ilStartUpGUI constructor.

Parameters
\ilObjUser | null$user

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

References $DIC, $httpRequest, $mainTemplate, $termsOfServiceEvaluation, $user, ilLoggerFactory\getLogger(), and user().

54  {
55  global $DIC;
56 
57  if ($user === null) {
58  $user = $DIC->user();
59  }
60  $this->user = $user;
61 
62  if ($termsOfServiceEvaluation === null) {
63  $termsOfServiceEvaluation = $DIC['tos.document.evaluator'];
64  }
65  $this->termsOfServiceEvaluation = $termsOfServiceEvaluation;
66 
67  if ($mainTemplate === null) {
68  $mainTemplate = $DIC->ui()->mainTemplate();
69  }
70  $this->mainTemplate = $mainTemplate;
71 
72  if ($httpRequest === null) {
73  $httpRequest = $DIC->http()->request();
74  }
75  $this->httpRequest = $httpRequest;
76 
77  $this->ctrl = $DIC->ctrl();
78  $this->lng = $DIC->language();
79  $this->lng->loadLanguageModule('auth');
80  $this->logger = ilLoggerFactory::getLogger('init');
81 
82  $this->ctrl->saveParameter($this, array("rep_ref_id", "lang", "target", "client_id"));
83 
84  $this->user->setLanguage($this->lng->getLangKey());
85  }
user()
Definition: user.php:4
$DIC
Definition: xapitoken.php:46
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ _checkGoto()

static ilStartUpGUI::_checkGoto (   $a_target)
static

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

References $_COOKIE, $_GET, $_SERVER, $_SESSION, $DIC, $ilSetting, $ilUser, $lng, $location, $param, $password, XapiProxy\$resp, $ret, $tpl, $type, $user, ilObject\_getAllReferences(), ilObjCourse\_isActivated(), ilGroupParticipants\_isParticipant(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjCourse\_registrationEnabled(), ilObjUser\_verifyRegistrationHash(), ilUtil\generatePasswords(), ilParticipants\getDefaultMemberRole(), ilPublicSectionSettings\getInstance(), ilObjectFactory\getInstanceByObjId(), ilLoggerFactory\getLogger(), ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, IL_PASSWD_PLAIN, ILIAS_HTTP_PATH, ilUtil\redirect(), and ilUtil\setCookie().

1579  {
1580  global $DIC;
1581  global $objDefinition, $ilPluginAdmin, $ilUser;
1582 
1583  $access = $DIC->access();
1584 
1585 
1586  if (is_object($ilPluginAdmin)) {
1587  // get user interface plugins
1588  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1589 
1590  // search
1591  foreach ($pl_names as $pl) {
1592  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1593  $gui_class = $ui_plugin->getUIClassInstance();
1594  $resp = $gui_class->checkGotoHook($a_target);
1595  if ($resp["target"] !== false) {
1596  $a_target = $resp["target"];
1597  break;
1598  }
1599  }
1600  }
1601 
1602  if ($a_target == "") {
1603  return false;
1604  }
1605 
1606  $t_arr = explode("_", $a_target);
1607  $type = $t_arr[0];
1608 
1609  if ($type == "git") {
1610  $type = "glo";
1611  }
1612 
1613  if ($type == "pg" | $type == "st") {
1614  $type = "lm";
1615  }
1616 
1617  $class = $objDefinition->getClassName($type);
1618  if ($class == "") {
1619  return false;
1620  }
1621 
1622  $location = $objDefinition->getLocation($type);
1623  $full_class = "ilObj" . $class . "Access";
1624  include_once($location . "/class." . $full_class . ".php");
1625 
1626  $ret = call_user_func(array($full_class, "_checkGoto"), $a_target);
1627 
1628  // if no access and repository object => check for parent course/group
1629  if (!$ret &&
1630  !stristr($a_target, "_wsp") &&
1631  $ilUser->getId() != ANONYMOUS_USER_ID && // #10637
1632  !$objDefinition->isAdministrationObject($type) &&
1633  $objDefinition->isRBACObject($type) &&
1634  $t_arr[1]) {
1635  global $tree, $rbacsystem, $ilAccess;
1636 
1637  // original type "pg" => pg_<page_id>[_<ref_id>]
1638  if ($t_arr[0] == "pg") {
1639  if (isset($t_arr[2])) {
1640  $ref_id = $t_arr[2];
1641  } else {
1642  $lm_id = ilLMObject::_lookupContObjID($t_arr[1]);
1643  $ref_id = ilObject::_getAllReferences($lm_id);
1644  if ($ref_id) {
1645  $ref_id = array_shift($ref_id);
1646  }
1647  }
1648  } else {
1649  $ref_id = $t_arr[1];
1650  }
1651 
1652  include_once "Services/Membership/classes/class.ilParticipants.php";
1653  $block_obj = array();
1654 
1655  // walk path to find parent container
1656  $path = $tree->getPathId($ref_id);
1657  array_pop($path);
1658  foreach ($path as $path_ref_id) {
1659  $redirect_infopage = false;
1660  $add_member_role = false;
1661 
1662  $ptype = ilObject::_lookupType($path_ref_id, true);
1663  $pobj_id = ilObject::_lookupObjId($path_ref_id);
1664 
1665  // core checks: timings/object-specific
1666  if (
1667  !$access->doActivationCheck('read', '', $path_ref_id, $ilUser->getId(), $pobj_id, $ptype) ||
1668  !$access->doStatusCheck('read', '', $path_ref_id, $ilUser->getId(), $pobj_id, $ptype)
1669  ) {
1670  // object in path is inaccessible - aborting
1671  return false;
1672  } elseif ($ptype == "crs") {
1673  // check if already participant
1674  include_once "Modules/Course/classes/class.ilCourseParticipant.php";
1675  $participants = new ilCourseParticipant($pobj_id, $ilUser->getId());
1676  if (!$participants->isAssigned()) {
1677  // subscription currently possible?
1678  include_once "Modules/Course/classes/class.ilObjCourse.php";
1679  if (ilObjCourse::_isActivated($pobj_id) &&
1681  $block_obj[] = $path_ref_id;
1682  $add_member_role = true;
1683  } else {
1684  $redirect_infopage = true;
1685  }
1686  }
1687  } elseif ($ptype == "grp") {
1688  // check if already participant
1689  include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1690  if (!ilGroupParticipants::_isParticipant($path_ref_id, $ilUser->getId())) {
1691  // subscription currently possible?
1692  include_once "Modules/Group/classes/class.ilObjGroup.php";
1693  $group_obj = new ilObjGroup($path_ref_id);
1694  if ($group_obj->isRegistrationEnabled()) {
1695  $block_obj[] = $path_ref_id;
1696  $add_member_role = true;
1697  } else {
1698  $redirect_infopage = true;
1699  }
1700  }
1701  }
1702 
1703  // add members roles for all "blocking" objects
1704  if ($add_member_role) {
1705  // cannot join? goto will never work, so redirect to current object
1706  $rbacsystem->resetPACache($ilUser->getId(), $path_ref_id);
1707  if (!$rbacsystem->checkAccess("join", $path_ref_id)) {
1708  $redirect_infopage = true;
1709  } else {
1710  $rbacsystem->addTemporaryRole(
1711  $ilUser->getId(),
1713  );
1714  }
1715  }
1716 
1717  // redirect to infopage of 1st blocking object in path
1718  if ($redirect_infopage) {
1719  if ($rbacsystem->checkAccess("visible", $path_ref_id)) {
1720  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI" .
1721  "&ref_id=" . $path_ref_id . "&cmd=infoScreen");
1722  } else {
1723  return false;
1724  }
1725  }
1726  }
1727 
1728 
1729  // check if access will be possible with all (possible) member roles added
1730  $rbacsystem->resetPACache($ilUser->getId(), $ref_id);
1731  if ($rbacsystem->checkAccess("read", $ref_id) && sizeof($block_obj)) { // #12128
1732  // this won't work with lm-pages (see above)
1733  // include_once "Services/Link/classes/class.ilLink.php";
1734  // $_SESSION["pending_goto"] = ilLink::_getStaticLink($ref_id, $type);
1735 
1736  // keep original target
1737  $_SESSION["pending_goto"] = "goto.php?target=" . $a_target;
1738 
1739  // redirect to 1st non-member object in path
1740  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI" .
1741  "&ref_id=" . array_shift($block_obj));
1742  }
1743  }
1744 
1745  return $ret;
1746  }
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
$_SESSION["AccountId"]
$type
$location
Definition: buildRTE.php:44
static _registrationEnabled($a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static getDefaultMemberRole($a_ref_id)
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _isActivated($a_obj_id)
Is activated.
$ret
Definition: parser.php:6
$DIC
Definition: xapitoken.php:46
Class ilObjGroup.
static redirect($a_script)
const IL_COMP_SERVICE
+ Here is the call graph for this function:

◆ doApacheAuthentication()

ilStartUpGUI::doApacheAuthentication ( )
protected

Try apache auth.

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

References $GLOBALS, ilUtil\appendUrlParameterString(), AUTH_APACHE, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), getLogger(), ilUtil\sendFailure(), and showLoginPage().

611  {
612  $this->getLogger()->debug('Trying apache authentication');
613 
614  $credentials = new \ilAuthFrontendCredentialsApache($this->httpRequest, $this->ctrl);
615  $credentials->initFromRequest();
616 
617  $provider_factory = new \ilAuthProviderFactory();
618  $provider = $provider_factory->getProviderByAuthMode($credentials, AUTH_APACHE);
619 
620  $status = \ilAuthStatus::getInstance();
621 
622  $frontend_factory = new \ilAuthFrontendFactory();
623  $frontend_factory->setContext(\ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
624  $frontend = $frontend_factory->getFrontend(
625  $GLOBALS['DIC']['ilAuthSession'],
626  $status,
627  $credentials,
628  array($provider)
629  );
630 
631  $frontend->authenticate();
632 
633  switch ($status->getStatus()) {
634  case \ilAuthStatus::STATUS_AUTHENTICATED:
635  if ($credentials->hasValidTargetUrl()) {
636  \ilLoggerFactory::getLogger('auth')->debug(sprintf(
637  'Authentication successful. Redirecting to starting page: %s',
638  $credentials->getTargetUrl()
639  ));
640  $this->ctrl->redirectToURL($credentials->getTargetUrl());
641  } else {
642  \ilLoggerFactory::getLogger('auth')->debug(
643  'Authentication successful, but no valid target URL given. Redirecting to default starting page.'
644  );
645  \ilInitialisation::redirectToStartingPage();
646  }
647  break;
648 
649  case \ilAuthStatus::STATUS_ACCOUNT_MIGRATION_REQUIRED:
650  $this->ctrl->redirect($this, 'showAccountMigration');
651  break;
652 
653  case \ilAuthStatus::STATUS_AUTHENTICATION_FAILED:
654  \ilUtil::sendFailure($status->getTranslatedReason(), true);
655  $this->ctrl->redirectToURL(\ilUtil::appendUrlParameterString(
656  $this->ctrl->getLinkTarget($this, 'showLoginPage', '', false, false),
657  'passed_sso=1'
658  ));
659  break;
660  }
661 
662  \ilUtil::sendFailure($this->lng->txt('err_wrong_login'));
663  $this->showLoginPage();
664  return false;
665  }
const AUTH_APACHE
getLogger()
Get logger.
showLoginPage(ilPropertyFormGUI $form=null)
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ doCasAuthentication()

ilStartUpGUI::doCasAuthentication ( )
protected

Try CAS auth.

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

References $DIC, $GLOBALS, AUTH_CAS, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), getLogger(), ilUtil\sendFailure(), showLoginPage(), ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

520  {
521  global $DIC;
522 
523  $this->getLogger()->debug('Trying cas authentication');
524 
525  include_once './Services/CAS/classes/class.ilAuthFrontendCredentialsCAS.php';
526  $credentials = new ilAuthFrontendCredentialsCAS();
527 
528  include_once './Services/Authentication/classes/Provider/class.ilAuthProviderFactory.php';
529  $provider_factory = new ilAuthProviderFactory();
530  $provider = $provider_factory->getProviderByAuthMode($credentials, AUTH_CAS);
531 
532  include_once './Services/Authentication/classes/class.ilAuthStatus.php';
533  $status = ilAuthStatus::getInstance();
534 
535  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendFactory.php';
536  $frontend_factory = new ilAuthFrontendFactory();
537  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
538  $frontend = $frontend_factory->getFrontend(
539  $GLOBALS['DIC']['ilAuthSession'],
540  $status,
541  $credentials,
542  array($provider)
543  );
544 
545  $frontend->authenticate();
546  switch ($status->getStatus()) {
548  $this->getLogger()->debug('Authentication successful.');
549  ilInitialisation::redirectToStartingPage();
550  break;
551 
553  default:
554  ilUtil::sendFailure($DIC->language()->txt($status->getReason()));
555  $this->showLoginPage();
556  return false;
557  }
558  }
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
const AUTH_CAS
getLogger()
Get logger.
showLoginPage(ilPropertyFormGUI $form=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
$DIC
Definition: xapitoken.php:46
Auth frontend credentials for CAS auth.
+ Here is the call graph for this function:

◆ doLogout()

ilStartUpGUI::doLogout ( )

show logout screen

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

References $_COOKIE, $client_id, $DIC, $GLOBALS, $ilIliasIniFile, $ilSetting, $lng, $user, AUTH_SAML, ilSession\get(), ILIAS_HTTP_PATH, ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), ilUtil\setCookie(), and user().

1314  {
1315  global $DIC;
1316 
1317  $ilSetting = $DIC->settings();
1318  $user = $DIC->user();
1319  $lng = $DIC->language();
1320  $ilIliasIniFile = $DIC['ilIliasIniFile'];
1321  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1322 
1323  $ilAppEventHandler->raise(
1324  'Services/Authentication',
1325  'beforeLogout',
1326  [
1327  'user_id' => $this->user->getId()
1328  ]
1329  );
1330 
1331  $user_language = $user->getLanguage();
1332  $had_external_authentication = ilSession::get('used_external_auth');
1333 
1335  $GLOBALS['DIC']['ilAuthSession']->logout();
1336 
1337  $GLOBALS['ilAppEventHandler']->raise(
1338  'Services/Authentication',
1339  'afterLogout',
1340  array(
1341  'username' => $this->user->getLogin()
1342  )
1343  );
1344 
1345  if ((int) $this->user->getAuthMode(true) == AUTH_SAML && $had_external_authentication) {
1346  $this->logger->info('Redirecting user to SAML logout script');
1347  $this->ctrl->redirectToURL('saml.php?action=logout&logout_url=' . urlencode(ILIAS_HTTP_PATH . '/login.php'));
1348  }
1349 
1350  // reset cookie
1351  $client_id = $_COOKIE["ilClientId"];
1352  ilUtil::setCookie("ilClientId", "");
1353 
1354  // redirect and show logout information
1355  $this->ctrl->setParameter($this, 'client_id', $client_id);
1356  $this->ctrl->setParameter($this, 'lang', $user_language);
1357  $this->ctrl->redirect($this, 'showLogout');
1358  }
static get($a_var)
Get a value.
const AUTH_SAML
user()
Definition: user.php:4
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
const SESSION_CLOSE_USER
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static setClosingContext($a_context)
set closing context (for statistics)
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46
$ilIliasIniFile
$client_id
$_COOKIE[session_name()]
Definition: xapitoken.php:39
+ Here is the call graph for this function:

◆ doLTIAuthentication()

ilStartUpGUI::doLTIAuthentication ( )
protected

Handle lti requests.

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

References $GLOBALS, AUTH_PROVIDER_LTI, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), getLogger(), ilUtil\sendFailure(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

564  {
565  $this->getLogger()->debug('Trying lti authentication');
566 
567  $credentials = new ilAuthFrontendCredentialsLTI();
568  $credentials->initFromRequest();
569 
570  $provider_factory = new ilAuthProviderFactory();
571  $provider = $provider_factory->getProviderByAuthMode($credentials, AUTH_PROVIDER_LTI);
572 
573  $status = ilAuthStatus::getInstance();
574 
575  $frontend_factory = new ilAuthFrontendFactory();
576  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
577  $frontend = $frontend_factory->getFrontend(
578  $GLOBALS['DIC']['ilAuthSession'],
579  $status,
580  $credentials,
581  array($provider)
582  );
583 
584  $frontend->authenticate();
585 
586  switch ($status->getStatus()) {
588  ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
589  ilInitialisation::redirectToStartingPage();
590  return;
591 
593  return $GLOBALS['ilCtrl']->redirect($this, 'showAccountMigration');
594 
596  ilUtil::sendFailure($GLOBALS['lng']->txt($status->getReason()), true);
597  $GLOBALS['ilCtrl']->redirect($this, 'showLoginPage');
598  return false;
599  }
600 
601  ilUtil::sendFailure($this->lng->txt('err_wrong_login'));
602  $this->showLoginPage();
603  return false;
604  }
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
Auth credentials for lti oauth based authentication.
getLogger()
Get logger.
showLoginPage(ilPropertyFormGUI $form=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
static getLogger($a_component_id)
Get component logger.
const AUTH_PROVIDER_LTI
const STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

◆ doMigration()

ilStartUpGUI::doMigration ( )
protected
Returns
bool

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

References $_POST, $GLOBALS, AUTH_LOCAL, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilSession\get(), ilAuthStatus\getInstance(), getLogger(), ilAuthFrontend\MIG_TRIGGER_AUTHMODE, ilUtil\sendFailure(), showAccountMigration(), and ilAuthStatus\STATUS_AUTHENTICATED.

Referenced by migrateAccount().

1211  : bool
1212  {
1213  $this->logger->debug('Starting account migration for user: ' . (string) ilSession::get('mig_ext_account'));
1214 
1215  $credentials = new ilAuthFrontendCredentials();
1216  $credentials->setUsername((string) $_POST['mig_username']);
1217  $credentials->setPassword((string) $_POST['mig_password']);
1218 
1219  $provider_factory = new ilAuthProviderFactory();
1220  $provider = $provider_factory->getProviderByAuthMode($credentials, AUTH_LOCAL);
1221 
1222  $status = ilAuthStatus::getInstance();
1223 
1224  $frontend_factory = new ilAuthFrontendFactory();
1225  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1226  $frontend = $frontend_factory->getFrontend(
1227  $GLOBALS['DIC']['ilAuthSession'],
1228  $status,
1229  $credentials,
1230  array($provider)
1231  );
1232 
1233  $frontend->authenticate();
1234 
1235  switch ($status->getStatus()) {
1237  $this->getLogger()->debug('Account migration: authentication successful for ' . (string) $_POST['mig_username']);
1238 
1239  $provider = $provider_factory->getProviderByAuthMode(
1240  $credentials,
1242  );
1243  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1244  $frontend = $frontend_factory->getFrontend(
1245  $GLOBALS['DIC']['ilAuthSession'],
1246  $status,
1247  $credentials,
1248  [$provider]
1249  );
1250  if (
1251  $frontend->migrateAccount($GLOBALS['DIC']['ilAuthSession'])
1252  ) {
1253  ilInitialisation::redirectToStartingPage();
1254  } else {
1255  ilUtil::sendFailure($this->lng->txt('err_wrong_login'), true);
1256  $this->ctrl->redirect($this, 'showAccountMigration');
1257  }
1258  break;
1259 
1260  default:
1261  $this->getLogger()->info('Account migration failed for user ' . (string) $_POST['mig_username']);
1262  $this->showAccountMigration($GLOBALS['lng']->txt('err_wrong_login'));
1263  return false;
1264  }
1265  }
Factory for auth frontend classes.
static get($a_var)
Get a value.
getLogger()
Get logger.
showAccountMigration(string $message='')
Show account migration screen.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
const AUTH_LOCAL
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doMigrationNewAccount()

ilStartUpGUI::doMigrationNewAccount ( )
protected
Returns
bool

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

References $GLOBALS, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilSession\get(), ilAuthStatus\getInstance(), ilAuthFrontend\MIG_EXTERNAL_ACCOUNT, ilAuthFrontend\MIG_TRIGGER_AUTHMODE, and ilUtil\sendFailure().

Referenced by migrateAccount().

1177  : bool
1178  {
1179  $credentials = new ilAuthFrontendCredentials();
1180  $credentials->setUsername(ilSession::get(ilAuthFrontend::MIG_EXTERNAL_ACCOUNT));
1181 
1182  $provider_factory = new ilAuthProviderFactory();
1183  $provider = $provider_factory->getProviderByAuthMode($credentials, ilSession::get(ilAuthFrontend::MIG_TRIGGER_AUTHMODE));
1184 
1185  $this->logger->debug('Using provider: ' . get_class($provider) . ' for further processing.');
1186 
1187  $status = ilAuthStatus::getInstance();
1188 
1189  $frontend_factory = new ilAuthFrontendFactory();
1190  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1191  $frontend = $frontend_factory->getFrontend(
1192  $GLOBALS['DIC']['ilAuthSession'],
1193  $status,
1194  $credentials,
1195  [$provider]
1196  );
1197 
1198  if ($frontend->migrateAccountNew()) {
1199  ilInitialisation::redirectToStartingPage();
1200  }
1201 
1202  ilUtil::sendFailure($this->lng->txt('err_wrong_login'));
1203  $this->ctrl->redirect($this, 'showAccountMigration');
1204 
1205  return true;
1206  }
Factory for auth frontend classes.
static get($a_var)
Get a value.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doOpenIdConnectAuthentication()

ilStartUpGUI::doOpenIdConnectAuthentication ( )
protected

do open id connect authentication

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

References $DIC, $GLOBALS, AUTH_OPENID_CONNECT, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), getLogger(), ilUtil\sendFailure(), showLoginPage(), ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

1968  {
1969  global $DIC;
1970 
1971  $this->getLogger()->debug('Trying openid connect authentication');
1972 
1973  $credentials = new ilAuthFrontendCredentialsOpenIdConnect();
1974  $credentials->initFromRequest();
1975 
1976  $provider_factory = new ilAuthProviderFactory();
1977  $provider = $provider_factory->getProviderByAuthMode($credentials, AUTH_OPENID_CONNECT);
1978 
1979  $status = ilAuthStatus::getInstance();
1980 
1981  $frontend_factory = new ilAuthFrontendFactory();
1982  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
1983  $frontend = $frontend_factory->getFrontend(
1984  $GLOBALS['DIC']['ilAuthSession'],
1985  $status,
1986  $credentials,
1987  array($provider)
1988  );
1989 
1990  $frontend->authenticate();
1991 
1992  switch ($status->getStatus()) {
1994  ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
1995  include_once './Services/Init/classes/class.ilInitialisation.php';
1996  ilInitialisation::redirectToStartingPage();
1997  return;
1998 
2000  ilUtil::sendFailure($status->getTranslatedReason(), true);
2001  $GLOBALS['ilCtrl']->redirect($this, 'showLoginPage');
2002  return false;
2003  }
2004 
2005  ilUtil::sendFailure($this->lng->txt('err_wrong_login'));
2006  $this->showLoginPage();
2007  return false;
2008  }
const STATUS_AUTHENTICATION_FAILED
const AUTH_OPENID_CONNECT
Factory for auth frontend classes.
getLogger()
Get logger.
showLoginPage(ilPropertyFormGUI $form=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
$DIC
Definition: xapitoken.php:46
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ doSamlAuthentication()

ilStartUpGUI::doSamlAuthentication ( )
protected
Returns
bool

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

References $_GET, $_POST, $auth, $DIC, $factory, $GLOBALS, AUTH_SAML, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilSamlIdp\geIdpIdByEntityId(), ilSamlIdp\getActiveIdpList(), ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), getLogger(), ilUtil\sendFailure(), showLoginPage(), showSamlIdpSelection(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, ilAuthStatus\STATUS_AUTHENTICATION_FAILED, and ilUtil\stripSlashes().

2015  {
2016  global $DIC;
2017 
2018  $this->getLogger()->debug('Trying saml authentication');
2019 
2020  $request = $DIC->http()->request();
2021  $params = $request->getQueryParams();
2022 
2023  $factory = new ilSamlAuthFactory();
2024  $auth = $factory->auth();
2025 
2026  if (isset($params['action']) && $params['action'] == 'logout') {
2027  $logout_url = isset($params['logout_url']) ? $params['logout_url'] : '';
2028  ilLoggerFactory::getLogger('auth')->info(sprintf('Requested SAML logout: %s', $logout_url));
2029  $auth->logout($logout_url);
2030  }
2031 
2032  if (isset($params['target']) && !isset($params['returnTo'])) {
2033  $params['returnTo'] = $params['target'];
2034  }
2035  if (isset($params['returnTo'])) {
2036  $auth->storeParam('target', $params['returnTo']);
2037  }
2038 
2039  ilLoggerFactory::getLogger('auth')->debug('Started SAML authentication request');
2040 
2041  if (!$auth->isAuthenticated()) {
2042  ilLoggerFactory::getLogger('auth')->debug('User is not authenticated, yet');
2043  if (!isset($_GET['idpentityid']) || !isset($_GET['saml_idp_id'])) {
2044  $activeIdps = ilSamlIdp::getActiveIdpList();
2045  if (1 == count($activeIdps)) {
2046  $idp = current($activeIdps);
2047  $_GET['idpentityid'] = $idp->getEntityId();
2048  $_GET['saml_idp_id'] = $idp->getIdpId();
2049 
2050  ilLoggerFactory::getLogger('auth')->debug(sprintf(
2051  'Found exactly one active IDP with id %s: %s',
2052  $idp->getIdpId(),
2053  $idp->getEntityId()
2054  ));
2055  } elseif (0 == count($activeIdps)) {
2056  ilLoggerFactory::getLogger('auth')->debug('Did not find any active IDP, skipp authentication process');
2057  $GLOBALS['DIC']->ctrl()->redirect($this, 'showLoginPage');
2058  } else {
2059  ilLoggerFactory::getLogger('auth')->debug('Found multiple active IPDs, presenting IDP selection...');
2060  $this->showSamlIdpSelection($auth, $activeIdps);
2061  return;
2062  }
2063  }
2064 
2065  $auth->storeParam('idpId', (int) $_GET['saml_idp_id']);
2066  ilLoggerFactory::getLogger('auth')->debug(sprintf(
2067  'Stored relevant IDP id in session: %s',
2068  (string) $auth->getParam('idpId')
2069  ));
2070  }
2071 
2072  // re-init
2073  $auth = $factory->auth();
2074 
2075  ilLoggerFactory::getLogger('auth')->debug('Checking SAML authentication status...');
2076 
2077  $auth->protectResource();
2078 
2079  ilLoggerFactory::getLogger('auth')->debug(
2080  'SAML authentication successful, continuing with ILIAS internal authentication process...'
2081  );
2082 
2083  $idpId = (int) $auth->getParam('idpId');
2084 
2085  ilLoggerFactory::getLogger('auth')->debug(sprintf(
2086  'Internal SAML IDP id fetched from session: %s',
2087  (string) $idpId
2088  ));
2089 
2090  if ($idpId < 1) {
2091  ilLoggerFactory::getLogger('auth')->debug(
2092  'No valid internal IDP id found (most probably due to IDP initiated SSO), trying fallback determination...'
2093  );
2094  $authData = $auth->getAuthDataArray();
2095  if (isset($authData['saml:sp:IdP'])) {
2096  $idpId = ilSamlIdp::geIdpIdByEntityId($authData['saml:sp:IdP']);
2097  ilLoggerFactory::getLogger('auth')->debug(sprintf(
2098  'Searching active ILIAS IDP by entity id "%s" results in: %s',
2099  $authData['saml:sp:IdP'],
2100  (string) $idpId
2101  ));
2102  } else {
2103  ilLoggerFactory::getLogger('auth')->debug(
2104  'Could not execute fallback determination, no IDP entity ID found SAML authentication session data'
2105  );
2106  }
2107  }
2108  $_GET['target'] = $auth->popParam('target');
2109 
2110  $_POST['auth_mode'] = AUTH_SAML . '_' . $idpId;
2111 
2112  $credentials = new ilAuthFrontendCredentialsSaml($auth);
2113  $credentials->initFromRequest();
2114 
2115  $provider_factory = new ilAuthProviderFactory();
2116  $provider = $provider_factory->getProviderByAuthMode($credentials, ilUtil::stripSlashes($_POST['auth_mode']));
2117 
2118  $status = ilAuthStatus::getInstance();
2119 
2120  $frontend_factory = new ilAuthFrontendFactory();
2121  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
2122  $frontend = $frontend_factory->getFrontend(
2123  $GLOBALS['DIC']['ilAuthSession'],
2124  $status,
2125  $credentials,
2126  array($provider)
2127  );
2128 
2129  $frontend->authenticate();
2130 
2131  switch ($status->getStatus()) {
2133  ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
2134  return ilInitialisation::redirectToStartingPage();
2135 
2137  return $GLOBALS['DIC']->ctrl()->redirect($this, 'showAccountMigration');
2138 
2140  ilUtil::sendFailure($status->getTranslatedReason(), true);
2141  $GLOBALS['DIC']->ctrl()->redirect($this, 'showLoginPage');
2142  return false;
2143  }
2144 
2145  ilUtil::sendFailure($this->lng->txt('err_wrong_login'));
2146  $this->showLoginPage();
2147 
2148  return false;
2149  }
static geIdpIdByEntityId($entityId)
$_GET["client_id"]
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
const AUTH_SAML
getLogger()
Get logger.
$auth
Definition: metadata.php:59
showLoginPage(ilPropertyFormGUI $form=null)
Class ilAuthFrontendCredentialsSaml.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
showSamlIdpSelection(\ilSamlAuth $auth, array $idps)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
$DIC
Definition: xapitoken.php:46
Class ilSamlAuthFactory.
static getLogger($a_component_id)
Get component logger.
static getActiveIdpList()
const STATUS_ACCOUNT_MIGRATION_REQUIRED
$_POST["username"]
$factory
Definition: metadata.php:58
+ Here is the call graph for this function:

◆ doShibbolethAuthentication()

ilStartUpGUI::doShibbolethAuthentication ( )
protected

Trying shibboleth authentication.

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

References $GLOBALS, AUTH_SHIBBOLETH, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), getLogger(), ilUtil\sendFailure(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

469  {
470  $this->getLogger()->debug('Trying shibboleth authentication');
471 
472  include_once './Services/AuthShibboleth/classes/class.ilAuthFrontendCredentialsShibboleth.php';
473  $credentials = new ilAuthFrontendCredentialsShibboleth();
474  $credentials->initFromRequest();
475 
476  include_once './Services/Authentication/classes/Provider/class.ilAuthProviderFactory.php';
477  $provider_factory = new ilAuthProviderFactory();
478  $provider = $provider_factory->getProviderByAuthMode($credentials, AUTH_SHIBBOLETH);
479 
480  include_once './Services/Authentication/classes/class.ilAuthStatus.php';
481  $status = ilAuthStatus::getInstance();
482 
483  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendFactory.php';
484  $frontend_factory = new ilAuthFrontendFactory();
485  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
486  $frontend = $frontend_factory->getFrontend(
487  $GLOBALS['DIC']['ilAuthSession'],
488  $status,
489  $credentials,
490  array($provider)
491  );
492 
493  $frontend->authenticate();
494 
495  switch ($status->getStatus()) {
497  ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
498  include_once './Services/Init/classes/class.ilInitialisation.php';
499  ilInitialisation::redirectToStartingPage();
500  return;
501 
503  return $GLOBALS['ilCtrl']->redirect($this, 'showAccountMigration');
504 
506  ilUtil::sendFailure($status->getTranslatedReason(), true);
507  $GLOBALS['ilCtrl']->redirect($this, 'showLoginPage');
508  return false;
509  }
510 
511  ilUtil::sendFailure($this->lng->txt('err_wrong_login'));
512  $this->showLoginPage();
513  return false;
514  }
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
const AUTH_SHIBBOLETH
getLogger()
Get logger.
showLoginPage(ilPropertyFormGUI $form=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get status instance.
static getLogger($a_component_id)
Get component logger.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

◆ doStandardAuthentication()

ilStartUpGUI::doStandardAuthentication ( )
protected

Check form input; authenticate user.

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

References $GLOBALS, ilAuthModeDetermination\_getInstance(), ilAuthUtils\_hasMultipleAuthenticationMethods(), ilObjUser\_lookupLogin(), ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), getLogger(), initCodeForm(), initStandardLoginForm(), ilUtil\sendFailure(), showLoginPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, ilAuthStatus\STATUS_AUTHENTICATION_FAILED, and ilAuthStatus\STATUS_CODE_ACTIVATION_REQUIRED.

671  {
672  $form = $this->initStandardLoginForm();
673  if ($form->checkInput()) {
674  $this->getLogger()->debug('Trying to authenticate user.');
675 
676  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendCredentials.php';
677  $credentials = new ilAuthFrontendCredentials();
678  $credentials->setUsername($form->getInput('username'));
679  $credentials->setPassword($form->getInput('password'));
680  $credentials->setCaptchaCode($form->getInput('captcha_code'));
681 
682  // set chosen auth mode
683  include_once './Services/Authentication/classes/class.ilAuthModeDetermination.php';
685  if (ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection()) {
686  $credentials->setAuthMode($form->getInput('auth_mode'));
687  }
688 
689  include_once './Services/Authentication/classes/Provider/class.ilAuthProviderFactory.php';
690  $provider_factory = new ilAuthProviderFactory();
691  $providers = $provider_factory->getProviders($credentials);
692 
693  include_once './Services/Authentication/classes/class.ilAuthStatus.php';
694  $status = ilAuthStatus::getInstance();
695 
696  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendFactory.php';
697  $frontend_factory = new ilAuthFrontendFactory();
698  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
699  $frontend = $frontend_factory->getFrontend(
700  $GLOBALS['DIC']['ilAuthSession'],
701  $status,
702  $credentials,
703  $providers
704  );
705 
706  $frontend->authenticate();
707 
708  switch ($status->getStatus()) {
710  ilLoggerFactory::getLogger('auth')->debug('Authentication successful; Redirecting to starting page.');
711  include_once './Services/Init/classes/class.ilInitialisation.php';
712  ilInitialisation::redirectToStartingPage();
713  return;
714 
716  $uname = ilObjUser::_lookupLogin($status->getAuthenticatedUserId());
717  return $this->showLoginPage($this->initCodeForm($uname));
718 
720  return $GLOBALS['ilCtrl']->redirect($this, 'showAccountMigration');
721 
723  ilUtil::sendFailure($status->getTranslatedReason());
724  return $this->showLoginPage($form);
725  }
726  }
727  ilUtil::sendFailure($this->lng->txt('err_wrong_login'));
728  $this->showLoginPage($form);
729  return false;
730  }
static _lookupLogin($a_user_id)
lookup login
initCodeForm($a_username)
static _hasMultipleAuthenticationMethods()
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
getLogger()
Get logger.
initStandardLoginForm()
Initialize the standard.
showLoginPage(ilPropertyFormGUI $form=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const STATUS_CODE_ACTIVATION_REQUIRED
static getInstance()
Get status instance.
static getLogger($a_component_id)
Get component logger.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

◆ executeCommand()

ilStartUpGUI::executeCommand ( )

execute command

See also
register.php

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

Referenced by jumpToPasswordAssistance(), and jumpToRegistration().

92  {
93  $cmd = $this->ctrl->getCmd("processIndexPHP", array('processIndexPHP','showLoginPage'));
94  $next_class = $this->ctrl->getNextClass($this);
95 
96  switch ($next_class) {
97  case 'ilLoginPageGUI':
98  break;
99 
100  case "ilaccountregistrationgui":
101  require_once("Services/Registration/classes/class.ilAccountRegistrationGUI.php");
102  return $this->ctrl->forwardCommand(new ilAccountRegistrationGUI());
103 
104  case "ilpasswordassistancegui":
105  require_once("Services/Init/classes/class.ilPasswordAssistanceGUI.php");
106  return $this->ctrl->forwardCommand(new ilPasswordAssistanceGUI());
107 
108  default:
109  if (method_exists($this, $cmd)) {
110  return $this->$cmd();
111  }
112  }
113  }
Class ilAccountRegistrationGUI.
Password assistance facility for users who have forgotten their password or for users for whom no pas...
+ Here is the caller graph for this function:

◆ getAcceptance()

ilStartUpGUI::getAcceptance ( )
protected

Get terms of service.

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

References showTermsOfService().

1491  {
1492  $this->showTermsOfService();
1493  }
showTermsOfService()
Show terms of service.
+ Here is the call graph for this function:

◆ getLogger()

ilStartUpGUI::getLogger ( )

Get logger.

Returns

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

References $logger.

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

120  {
121  return $this->logger;
122  }
+ Here is the caller graph for this function:

◆ getLoginPageEditorHTML()

ilStartUpGUI::getLoginPageEditorHTML ( )
protected

Get HTML of ILIAS login page editor.

Returns
string html

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

References $lng, $ret, $tpl, ilPageUtil\_existsAndNotEmpty(), ilAuthLoginPageEditorSettings\getInstance(), and ilLanguage\lookupId().

Referenced by showLoginPage().

924  {
925  global $lng, $tpl;
926 
927  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php';
929  $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey());
930 
931  if (!$active_lang) {
932  return '';
933  }
934 
935  // if page does not exist, return nothing
936  include_once './Services/COPage/classes/class.ilPageUtil.php';
937  if (!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang))) {
938  return '';
939  }
940 
941  // get page object
942  $page_gui = new ilLoginPageGUI(ilLanguage::lookupId($active_lang));
943 
944  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
945  $page_gui->setStyleId(0, 'auth');
946 
947  $page_gui->setPresentationTitle("");
948  $page_gui->setTemplateOutput(false);
949  $page_gui->setHeader("");
950  $ret = $page_gui->showPage();
951 
952  return $ret;
953  }
Login page GUI class.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
$ret
Definition: parser.php:6
static lookupId($a_lang_key)
Lookup obj_id of language ilDB $ilDB.
static getInstance()
Get singelton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCodeForm()

ilStartUpGUI::initCodeForm (   $a_username)
protected

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

References $ilCtrl, and $lng.

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

285  {
286  global $lng, $ilCtrl;
287 
288  $lng->loadLanguageModule("auth");
289 
290  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
291 
292  $form = new ilPropertyFormGUI();
293  $form->setFormAction($ilCtrl->getFormAction($this, 'showcodeform'));
294  $form->setTitle($lng->txt('auth_account_code_title'));
295 
296  $count = new ilTextInputGUI($lng->txt('auth_account_code'), 'code');
297  $count->setRequired(true);
298  $count->setInfo($lng->txt('auth_account_code_info'));
299  $form->addItem($count);
300 
301  // #11658
302  $uname = new ilHiddenInputGUI("uname");
303  $uname->setValue($a_username);
304  $form->addItem($uname);
305 
306  $form->addCommandButton('processCode', $lng->txt('send'));
307 
308  return $form;
309  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
+ Here is the caller graph for this function:

◆ initStandardLoginForm()

ilStartUpGUI::initStandardLoginForm ( )
protected

Initialize the standard.

Returns

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

References ilAuthModeDetermination\_getInstance(), ilAuthUtils\_getMultipleAuthModeOptions(), ilAuthUtils\_hasMultipleAuthenticationMethods(), ilFormPropertyGUI\setRequired(), and ilPasswordInputGUI\setUseStripSlashes().

Referenced by doStandardAuthentication(), and showLoginForm().

401  {
402  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
403  $form = new ilPropertyFormGUI();
404  $form->setFormAction($this->ctrl->getFormAction($this, ''));
405  $form->setName("formlogin");
406  $form->setShowTopButtons(false);
407  $form->setTitle($this->lng->txt("login_to_ilias"));
408 
409  include_once './Services/Authentication/classes/class.ilAuthModeDetermination.php';
411 
412  if (ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection()) {
413  $visible_auth_methods = array();
414  $radg = new ilRadioGroupInputGUI($this->lng->txt("auth_selection"), "auth_mode");
415  foreach (ilAuthUtils::_getMultipleAuthModeOptions($this->lng) as $key => $option) {
416  if (isset($option['hide_in_ui']) && $option['hide_in_ui']) {
417  continue;
418  }
419 
420  $op1 = new ilRadioOption($option['txt'], $key);
421  $radg->addOption($op1);
422  if (isset($option['checked'])) {
423  $radg->setValue($key);
424  }
425  $visible_auth_methods[] = $op1;
426  }
427 
428  if (count($visible_auth_methods) == 1) {
429  $first_auth_method = current($visible_auth_methods);
430  $hidden_auth_method = new ilHiddenInputGUI("auth_mode");
431  $hidden_auth_method->setValue($first_auth_method->getValue());
432  $form->addItem($hidden_auth_method);
433  } else {
434  $form->addItem($radg);
435  }
436  }
437 
438  $ti = new ilTextInputGUI($this->lng->txt("username"), "username");
439  $ti->setSize(20);
440  $ti->setRequired(true);
441  $form->addItem($ti);
442 
443  $pi = new ilPasswordInputGUI($this->lng->txt("password"), "password");
444  $pi->setUseStripSlashes(false);
445  $pi->setRetype(false);
446  $pi->setSkipSyntaxCheck(true);
447  $pi->setSize(20);
448  $pi->setDisableHtmlAutoComplete(false);
449  $pi->setRequired(true);
450  $form->addItem($pi);
451 
452  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
453  if (ilCaptchaUtil::isActiveForLogin()) {
454  require_once 'Services/Captcha/classes/class.ilCaptchaInputGUI.php';
455  $captcha = new ilCaptchaInputGUI($this->lng->txt('captcha_code'), 'captcha_code');
456  $captcha->setRequired(true);
457  $form->addItem($captcha);
458  }
459 
460  $form->addCommandButton("doStandardAuthentication", $this->lng->txt("log_in"));
461 
462  return $form;
463  }
This class represents an option in a radio group.
static _hasMultipleAuthenticationMethods()
This class represents a property form user interface.
This class represents a captcha input in a property form.
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setUseStripSlashes($a_stat)
En/disable use of stripslashes.
static _getMultipleAuthModeOptions($lng)
This class represents a password property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jumpToPasswordAssistance()

ilStartUpGUI::jumpToPasswordAssistance ( )

jump to password assistance

See also
pwassist.php

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

References $GLOBALS, executeCommand(), ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), showLoginPage(), and user().

140  {
141  $this->ctrl->setCmdClass("ilpasswordassistancegui");
142  $this->ctrl->setCmd("");
143  $this->executeCommand();
144  }
executeCommand()
execute command
+ Here is the call graph for this function:

◆ jumpToRegistration()

ilStartUpGUI::jumpToRegistration ( )

jump to registration gui

See also
register.php

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

References executeCommand().

129  {
130  $this->ctrl->setCmdClass("ilaccountregistrationgui");
131  $this->ctrl->setCmd("");
132  $this->executeCommand();
133  }
executeCommand()
execute command
+ Here is the call graph for this function:

◆ migrateAccount()

ilStartUpGUI::migrateAccount ( )
protected

Migrate Account.

Returns
bool

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

References doMigration(), doMigrationNewAccount(), and showAccountMigration().

1142  : bool
1143  {
1144  if (!isset($this->httpRequest->getParsedBody()['account_migration'])) {
1145  $this->showAccountMigration(
1146  $this->lng->txt('select_one')
1147  );
1148  return false;
1149  }
1150 
1151  if (
1152  ((int) $this->httpRequest->getParsedBody()['account_migration'] === self::ACCOUNT_MIGRATION_MIGRATE) &&
1153  (
1154  !isset($this->httpRequest->getParsedBody()['mig_username']) ||
1155  !is_string($this->httpRequest->getParsedBody()['mig_username']) ||
1156  0 === strlen($this->httpRequest->getParsedBody()['mig_username']) ||
1157  !isset($this->httpRequest->getParsedBody()['mig_password']) ||
1158  !is_string($this->httpRequest->getParsedBody()['mig_password'])
1159  )
1160  ) {
1161  $this->showAccountMigration(
1162  $this->lng->txt('err_wrong_login')
1163  );
1164  return false;
1165  }
1166 
1167  if ((int) $this->httpRequest->getParsedBody()['account_migration'] == self::ACCOUNT_MIGRATION_MIGRATE) {
1168  return $this->doMigration();
1169  } elseif ((int) $this->httpRequest->getParsedBody()['account_migration'] == static::ACCOUNT_MIGRATION_NEW) {
1170  return $this->doMigrationNewAccount();
1171  }
1172  }
showAccountMigration(string $message='')
Show account migration screen.
+ Here is the call graph for this function:

◆ printToGlobalTemplate()

static ilStartUpGUI::printToGlobalTemplate (   $tpl)
static

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

References $DIC, and $tpl.

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

261  {
262  global $DIC;
263  $gtpl = $DIC['tpl'];
264  $gtpl->setContent($tpl->get());
265  $gtpl->printToStdout("DEFAULT", false, true);
266  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ processCode()

ilStartUpGUI::processCode ( )
protected
Todo:
has to be refactored.

ilLanguage $lng type $ilAuth type $ilCtrl

Returns
boolean

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

References $_POST, $GLOBALS, $ilCtrl, $lng, $user, ilObjUser\_lookupId(), ilAccountCode\applyAccessLimits(), ilAccountCode\applyRoleAssignments(), ilAccountCode\getCodeValidUntil(), initCodeForm(), ilAccountCode\isUnusedCode(), language(), showCodeForm(), showLoginPage(), and ilAccountCode\useCode().

319  {
320  global $lng, $ilAuth, $ilCtrl;
321 
322  $uname = $_POST["uname"];
323 
324  $form = $this->initCodeForm($uname);
325  if ($uname && $form->checkInput()) {
326  $code = $form->getInput("code");
327 
328  include_once "Services/User/classes/class.ilAccountCode.php";
329  if (ilAccountCode::isUnusedCode($code)) {
330  $valid_until = ilAccountCode::getCodeValidUntil($code);
331 
332  if (!$user_id = ilObjUser::_lookupId($uname)) {
333  $this->showLoginPage();
334  return false;
335  }
336 
337  $invalid_code = false;
338  $user = new ilObjUser($user_id);
339 
340  if ($valid_until === "0") {
341  $user->setTimeLimitUnlimited(true);
342  } else {
343  if (is_numeric($valid_until)) {
344  $valid_until = strtotime("+" . $valid_until . "days");
345  } else {
346  $valid_until = explode("-", $valid_until);
347  $valid_until = mktime(
348  23,
349  59,
350  59,
351  $valid_until[1],
352  $valid_until[2],
353  $valid_until[0]
354  );
355  if ($valid_until < time()) {
356  $invalid_code = true;
357  }
358  }
359 
360  if (!$invalid_code) {
361  $user->setTimeLimitUnlimited(false);
362  $user->setTimeLimitUntil($valid_until);
363  }
364  }
365 
366  if (!$invalid_code) {
367  $user->setActive(true);
368 
369  ilAccountCode::useCode($code);
370 
371  // apply registration code role assignments
373 
374  // apply registration code time limits
376 
377  $user->update();
378 
379  $ilCtrl->setParameter($this, "cu", 1);
380  $GLOBALS['DIC']->language()->loadLanguageModule('auth');
381  ilUtil::sendSuccess($GLOBALS['DIC']->language()->txt('auth_activation_code_success'), true);
382  $ilCtrl->redirect($this, "showLoginPage");
383  }
384  }
385 
386  $lng->loadLanguageModule("user");
387  $field = $form->getItemByPostVar("code");
388  $field->setAlert($lng->txt("user_account_code_not_valid"));
389  }
390 
391  $form->setValuesByPost();
392  $this->showCodeForm($uname, $form);
393  }
static applyRoleAssignments(ilObjUser $user, $code)
initCodeForm($a_username)
static applyAccessLimits(ilObjUser $user, $code)
showCodeForm($a_username=null, $a_form=null)
static useCode($code)
static _lookupId($a_user_str)
Lookup id by login.
global $ilCtrl
Definition: ilias.php:18
showLoginPage(ilPropertyFormGUI $form=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getCodeValidUntil($code)
static isUnusedCode($code)
language()
Definition: language.php:2
$_POST["username"]
+ Here is the call graph for this function:

◆ processIndexPHP()

ilStartUpGUI::processIndexPHP ( )
protected

process index.php

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

References $_GET, $_SERVER, $GLOBALS, $ilIliasIniFile, $ilSetting, ilPublicSectionSettings\getInstance(), ilInitialisation\goToPublicSection(), showClientList(), and showLoginPage().

Referenced by showClientList().

1551  {
1552  global $ilIliasIniFile, $ilAuth, $ilSetting;
1553 
1554  // In case of an valid session, redirect to starting page
1555  if ($GLOBALS['DIC']['ilAuthSession']->isValid()) {
1556  include_once './Services/Init/classes/class.ilInitialisation.php';
1557  ilInitialisation::redirectToStartingPage();
1558  return;
1559  }
1560 
1561  // no valid session => show client list, if no client info is given
1562  if (
1563  !isset($_GET["client_id"]) &&
1564  ($_GET["cmd"] == "") &&
1565  $ilIliasIniFile->readVariable("clients", "list")) {
1566  return $this->showClientList();
1567  }
1568 
1569  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) {
1571  }
1572 
1573  // otherwise show login page
1574  return $this->showLoginPage();
1575  }
$_GET["client_id"]
static goToPublicSection()
go to public section
showLoginPage(ilPropertyFormGUI $form=null)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
showClientList()
show client list
global $ilSetting
Definition: privfeed.php:17
$ilIliasIniFile
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ purgePlaceholders()

ilStartUpGUI::purgePlaceholders (   $page_editor_html)
protected

Purge page editor html from unused placeholders.

Parameters
string$page_editor_html
Returns
string

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

Referenced by showLoginPage().

1061  {
1062  return str_replace(
1063  array(
1064  '[list-language-selection] ',
1065  '[list-registration-link]',
1066  '[list-user-agreement]',
1067  '[list-login-form]',
1068  '[list-cas-login-form]',
1069  '[list-saml-login]',
1070  '[list-shibboleth-login-form]'
1071  ),
1072  array('','','','','','',''),
1073  $page_editor_html
1074  );
1075  }
+ Here is the caller graph for this function:

◆ showAccountMigration()

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

Show account migration screen.

Parameters
string$message

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

References $message, $pass, $tpl, $user, ilRadioOption\addSubItem(), ilUtil\prepareFormOutput(), ilUtil\sendFailure(), ilRadioGroupInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by doMigration(), and migrateAccount().

1081  : void
1082  {
1083  $tpl = self::initStartUpTemplate('tpl.login_account_migration.html');
1084 
1085  $form = new ilPropertyFormGUI();
1086  $form->setFormAction($this->ctrl->getFormAction($this, 'migrateAccount'));
1087 
1088  $form->setTitle($this->lng->txt('auth_account_migration'));
1089  $form->addCommandButton('migrateAccount', $this->lng->txt('save'));
1090  $form->addCommandButton('showLogin', $this->lng->txt('cancel'));
1091 
1092  $rad = new ilRadioGroupInputGUI($this->lng->txt('auth_account_migration_name'), 'account_migration');
1093  $rad->setValue(1);
1094 
1095  $keep = new ilRadioOption(
1096  $this->lng->txt('auth_account_migration_keep'),
1097  static::ACCOUNT_MIGRATION_MIGRATE,
1098  $this->lng->txt('auth_info_migrate')
1099  );
1100  $user = new ilTextInputGUI($this->lng->txt('login'), 'mig_username');
1101  $user->setRequired(true);
1103  (string) ($this->httpRequest->getParsedBody()['mig_username'] ?? '')
1104  ));
1105  $user->setSize(32);
1106  $user->setMaxLength(128);
1107  $keep->addSubItem($user);
1108 
1109  $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'mig_password');
1110  $pass->setRetype(false);
1111  $pass->setRequired(true);
1112  $pass->setValue(ilUtil::prepareFormOutput(
1113  (string) ($this->httpRequest->getParsedBody()['mig_password'] ?? '')
1114  ));
1115  $pass->setSize(12);
1116  $pass->setMaxLength(128);
1117  $keep->addSubItem($pass);
1118  $rad->addOption($keep);
1119 
1120  $new = new ilRadioOption(
1121  $this->lng->txt('auth_account_migration_new'),
1122  static::ACCOUNT_MIGRATION_NEW,
1123  $this->lng->txt('auth_info_add')
1124  );
1125  $rad->addOption($new);
1126 
1127  $form->addItem($rad);
1128 
1129  $tpl->setVariable('MIG_FORM', $form->getHTML());
1130 
1131  if (strlen($message)) {
1133  }
1134 
1135  self::printToGlobalTemplate($tpl);
1136  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
This class represents a property form user interface.
This class represents a property in a property form.
setValue($a_value)
Set Value.
addSubItem($a_item)
Add Subitem.
This class represents a password property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCASLoginForm()

ilStartUpGUI::showCASLoginForm (   $page_editor_html)
protected

Show cas login ilSetting $ilSetting.

Parameters
string$page_editor_html
Returns
string $page_editor_html

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

References $GLOBALS, $ilSetting, $lng, $tpl, ilUtil\getImagePath(), and substituteLoginPageElements().

Referenced by showLoginPage().

797  {
798  global $ilSetting, $lng;
799 
800 
801  // cas login link
802  if ($ilSetting->get("cas_active")) {
803  $tpl = new ilTemplate('tpl.login_form_cas.html', true, true, 'Services/Init');
804  $tpl->setVariable("TXT_CAS_LOGIN", $lng->txt("login_to_ilias_via_cas"));
805  $tpl->setVariable("TXT_CAS_LOGIN_BUTTON", ilUtil::getImagePath("cas_login_button.png"));
806  $tpl->setVariable("TXT_CAS_LOGIN_INSTRUCTIONS", $ilSetting->get("cas_login_instructions"));
807  $this->ctrl->setParameter($this, "forceCASLogin", "1");
808  $tpl->setVariable("TARGET_CAS_LOGIN", $this->ctrl->getLinkTarget($this, "doCasAuthentication"));
809  $this->ctrl->setParameter($this, "forceCASLogin", "");
810 
811  return $this->substituteLoginPageElements(
812  $GLOBALS['tpl'],
813  $page_editor_html,
814  $tpl->get(),
815  '[list-cas-login-form]',
816  'CAS_LOGIN_FORM'
817  );
818  }
819  return $page_editor_html;
820  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showClientList()

ilStartUpGUI::showClientList ( )

show client list

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

References $_GET, $client, $data, $ilIliasIniFile, $lng, $tpl, exit, and processIndexPHP().

Referenced by processIndexPHP().

1364  {
1365  global $tpl, $ilIliasIniFile, $lng;
1366 
1367  if (!$ilIliasIniFile->readVariable("clients", "list")) {
1368  $this->processIndexPHP();
1369  return;
1370  }
1371 
1372  // fix #21612
1373  $tpl->hideFooter(); // no client yet
1374 
1375  $tpl->setVariable("PAGETITLE", $lng->txt("clientlist_clientlist"));
1376 
1377  // load client list template
1378  $tpl = self::initStartUpTemplate("tpl.client_list.html");
1379 
1380  // load template for table
1381  $tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html");
1382 
1383  // load template for table content data
1384  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
1385 
1386  // load table content data
1387  require_once("setup/classes/class.ilClientList.php");
1388  require_once("setup/classes/class.ilClient.php");
1389  require_once("./Services/Table/classes/class.ilTableGUI.php");
1390  $clientlist = new \ilClientList();
1391  $list = $clientlist->getClients();
1392 
1393  if (count($list) == 0) {
1394  header("Location: ./setup/setup.php");
1395  exit();
1396  }
1397 
1398  $hasPublicSection = false;
1399  foreach ($list as $key => $client) {
1400  $client->setDSN();
1401  if ($client->checkDatabaseExists(true)) {
1402  $client->connect();
1403  if ($client->ini->readVariable("client", "access") and $client->getSetting("setup_ok")) {
1404  $this->ctrl->setParameter($this, "client_id", $key);
1405  $tmp = array();
1406  $tmp[] = $client->getName();
1407  $tmp[] = "<a href=\"" . "login.php?cmd=force_login&client_id=" . urlencode($key) . "\">" . $lng->txt("clientlist_login_page") . "</a>";
1408 
1409  if ($client->getSetting('pub_section')) {
1410  $hasPublicSection = true;
1411  $tmp[] = "<a href=\"" . "ilias.php?baseClass=ilRepositoryGUI&client_id=" . urlencode($key) . "\">" . $lng->txt("clientlist_start_page") . "</a>";
1412  } else {
1413  $tmp[] = '';
1414  }
1415 
1416  $data[] = $tmp;
1417  }
1418  }
1419  }
1420 
1421  // create table
1422  $tbl = new ilTableGUI('', false);
1423 
1424  // title & header columns
1425  if ($hasPublicSection) {
1426  $tbl->setTitle($lng->txt("clientlist_available_clients"));
1427  $tbl->setHeaderNames(array($lng->txt("clientlist_installation_name"), $lng->txt("clientlist_login"), $lng->txt("clientlist_public_access")));
1428  $tbl->setHeaderVars(array("name","index","login"));
1429  $tbl->setColumnWidth(array("50%","25%","25%"));
1430  } else {
1431  $tbl->setTitle($lng->txt("clientlist_available_clients"));
1432  $tbl->setHeaderNames(array($lng->txt("clientlist_installation_name"), $lng->txt("clientlist_login"), ''));
1433  $tbl->setHeaderVars(array("name","login",''));
1434  $tbl->setColumnWidth(array("70%","25%",'1px'));
1435  }
1436 
1437  // control
1438  $tbl->setOrderColumn($_GET["sort_by"], "name");
1439  $tbl->setOrderDirection($_GET["sort_order"]);
1440  $tbl->setLimit($_GET["limit"]);
1441  $tbl->setOffset($_GET["offset"]);
1442 
1443  // content
1444  $tbl->setData($data);
1445 
1446  $tbl->disable("icon");
1447  $tbl->disable("numinfo");
1448  $tbl->disable("sort");
1449  $tbl->disable("footer");
1450 
1451  // render table
1452  $html_for_nothing = $tbl->render();
1453  self::printToGlobalTemplate($tbl->getTemplateObject());
1454  }
exit
Definition: login.php:29
$data
Definition: storeScorm.php:23
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$_GET["client_id"]
if($_SERVER['argc']< 4) $client
Definition: cron.php:12
Class ilTableGUI.
processIndexPHP()
process index.php
$ilIliasIniFile
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCodeForm()

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

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

References $lng, $tpl, initCodeForm(), and ilUtil\sendFailure().

Referenced by processCode().

269  {
270  global $tpl, $lng;
271 
272  self::initStartUpTemplate("tpl.login_reactivate_code.html");
273 
274  ilUtil::sendFailure($lng->txt("time_limit_reached"));
275 
276  if (!$a_form) {
277  $a_form = $this->initCodeForm($a_username);
278  }
279 
280  $tpl->setVariable("FORM", $a_form->getHTML());
281  $tpl->printToStdout("DEFAULT", false);
282  }
initCodeForm($a_username)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginForm()

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

Show login form ilSetting $ilSetting.

Parameters
string$page_editor_html

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

References $ilSetting, $lng, $tpl, AUTH_CAS, AUTH_SHIBBOLETH, initStandardLoginForm(), and substituteLoginPageElements().

Referenced by showLoginPage().

742  {
743  global $ilSetting,$lng,$tpl;
744 
745  // @todo move this to auth utils.
746  // login via ILIAS (this also includes radius and ldap)
747  // If local authentication is enabled for shibboleth users, we
748  // display the login form for ILIAS here.
749  if (($ilSetting->get("auth_mode") != AUTH_SHIBBOLETH ||
750  $ilSetting->get("shib_auth_allow_local")) &&
751  $ilSetting->get("auth_mode") != AUTH_CAS) {
752  if (!$form instanceof ilPropertyFormGUI) {
753  $form = $this->initStandardLoginForm();
754  }
755 
756  return $this->substituteLoginPageElements(
757  $tpl,
758  $page_editor_html,
759  $form->getHTML(),
760  '[list-login-form]',
761  'LOGIN_FORM'
762  );
763  }
764  return $page_editor_html;
765  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
This class represents a property form user interface.
const AUTH_CAS
const AUTH_SHIBBOLETH
initStandardLoginForm()
Initialize the standard.
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginInformation()

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

Show login information.

Parameters
string$page_editor_html
Returns
string $page_editor_html

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

References $lng, and $tpl.

Referenced by showLoginPage().

773  {
774  global $lng;
775 
776  if (strlen($page_editor_html)) {
777  // page editor active return
778  return $page_editor_html;
779  }
780 
781  $loginSettings = new ilSetting("login_settings");
782  $information = $loginSettings->get("login_message_" . $lng->getLangKey());
783 
784  if (strlen(trim($information))) {
785  $tpl->setVariable("TXT_LOGIN_INFORMATION", $information);
786  }
787  return $page_editor_html;
788  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the caller graph for this function:

◆ showLoginPage()

ilStartUpGUI::showLoginPage ( ilPropertyFormGUI  $form = null)
protected
Todo:
check for forced authentication like ecs, ...

Show login page

Parameters
\ilPropertyFormGUI | null$form

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

References $_GET, $GLOBALS, $ilSetting, $tpl, ilObjStyleSheet\getContentStylePath(), getLogger(), getLoginPageEditorHTML(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\FileDelivery\http(), purgePlaceholders(), ilUtil\sendFailure(), showCASLoginForm(), showLoginForm(), showLoginInformation(), showOpenIdConnectLoginForm(), showRegistrationLinks(), showSamlLoginForm(), showShibbolethLoginForm(), showTermsOfServiceLink(), and ilUtil\stripSlashes().

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

203  {
204  global $tpl, $ilSetting;
205 
206 
207  $this->getLogger()->debug('Showing login page');
208 
209  $extUid = '';
210  if (isset($_GET['ext_uid']) && is_string($_GET['ext_uid'])) {
211  $extUid = $_GET['ext_uid'];
212  }
213  $soapPw = '';
214  if (isset($_GET['soap_pw']) && is_string($_GET['soap_pw'])) {
215  $soapPw = $_GET['soap_pw'];
216  }
217 
218  require_once 'Services/Authentication/classes/Frontend/class.ilAuthFrontendCredentialsSoap.php';
219  $credentials = new ilAuthFrontendCredentialsSoap($GLOBALS['DIC']->http()->request(), $this->ctrl, $ilSetting);
220  $credentials->setUsername(ilUtil::stripSlashes($extUid));
221  $credentials->setPassword(ilUtil::stripSlashes($soapPw));
222  $credentials->tryAuthenticationOnLoginPage();
223 
224  // try apache auth
225  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendCredentialsApache.php';
226  $frontend = new ilAuthFrontendCredentialsApache($this->httpRequest, $this->ctrl);
227  $frontend->tryAuthenticationOnLoginPage();
228 
229  // Instantiate login template
230  $tpl = self::initStartUpTemplate("tpl.login.html");
231 
232  $this->mainTemplate->addCss(ilObjStyleSheet::getContentStylePath(0));
233  $this->mainTemplate->addCss(ilObjStyleSheet::getSyntaxStylePath());
234 
235  $page_editor_html = $this->getLoginPageEditorHTML();
236  $page_editor_html = $this->showOpenIdConnectLoginForm($page_editor_html);
237  $page_editor_html = $this->showLoginInformation($page_editor_html, $tpl);
238  $page_editor_html = $this->showLoginForm($page_editor_html, $form);
239  $page_editor_html = $this->showCASLoginForm($page_editor_html);
240  $page_editor_html = $this->showShibbolethLoginForm($page_editor_html);
241  $page_editor_html = $this->showSamlLoginForm($page_editor_html);
242  $page_editor_html = $this->showRegistrationLinks($page_editor_html);
243  $page_editor_html = $this->showTermsOfServiceLink($page_editor_html);
244 
245  $page_editor_html = $this->purgePlaceholders($page_editor_html);
246 
247  // check expired session and send message
248  if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
249  ilUtil::sendFailure($GLOBALS['lng']->txt('auth_err_expired'));
250  }
251 
252  if (strlen($page_editor_html)) {
253  $tpl->setVariable('LPE', $page_editor_html);
254  }
255 
256  self::printToGlobalTemplate($tpl);
257  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
showOpenIdConnectLoginForm($page_editor_html)
showLoginForm($page_editor_html, ilPropertyFormGUI $form=null)
Show login form ilSetting $ilSetting.
getLoginPageEditorHTML()
Get HTML of ILIAS login page editor.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$_GET["client_id"]
showShibbolethLoginForm($page_editor_html)
Show shibboleth login form.
getLogger()
Get logger.
static http()
Fetches the global http state from ILIAS.
purgePlaceholders($page_editor_html)
Purge page editor html from unused placeholders.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
showRegistrationLinks($page_editor_html)
Show registration, password forgotten, client slection links ilLanguage $lng ilSetting $ilSetting ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getSyntaxStylePath()
get syntax style path
showSamlLoginForm($page_editor_html)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
showLoginInformation($page_editor_html, $tpl)
Show login information.
global $ilSetting
Definition: privfeed.php:17
showTermsOfServiceLink(string $page_editor_html)
Show terms of service link.
showCASLoginForm($page_editor_html)
Show cas login ilSetting $ilSetting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLogout()

ilStartUpGUI::showLogout ( )
protected

Show logout screen.

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

References $_GET, $_SERVER, $client_id, $DIC, $ilIliasIniFile, $lng, $tpl, and ilPublicSectionSettings\getInstance().

1271  {
1272  global $DIC;
1273 
1274  $lng = $DIC->language();
1275  $ilIliasIniFile = $DIC['ilIliasIniFile'];
1276 
1277  $tpl = self::initStartUpTemplate("tpl.logout.html");
1278 
1279  $client_id = $_GET['client_id'];
1280 
1281  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) {
1282  $tpl->setCurrentBlock("homelink");
1283  $tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $lng->getLangKey());
1284  $tpl->setVariable("TXT_HOME", $lng->txt("home"));
1285  $tpl->parseCurrentBlock();
1286  }
1287 
1288  if ($ilIliasIniFile->readVariable("clients", "list")) {
1289  $tpl->setCurrentBlock("client_list");
1290  $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
1291  $this->ctrl->setParameter($this, "client_id", $client_id);
1292  $tpl->setVariable(
1293  "CMD_CLIENT_LIST",
1294  $this->ctrl->getLinkTarget($this, "showClientList")
1295  );
1296  $tpl->parseCurrentBlock();
1297  $this->ctrl->setParameter($this, "client_id", "");
1298  }
1299 
1300  $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout"));
1301  $tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text"));
1302  $tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
1303  $tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&cmd=force_login&lang=" . $lng->getLangKey());
1304 
1305  self::printToGlobalTemplate($tpl);
1306  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$_GET["client_id"]
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$DIC
Definition: xapitoken.php:46
$ilIliasIniFile
$client_id
+ Here is the call graph for this function:

◆ showNoCookiesScreen()

ilStartUpGUI::showNoCookiesScreen ( )

show help screen, if cookies are disabled

to do: link to online help here

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

References $tpl.

1462  {
1463  global $tpl;
1464 
1465  $str = "<p style=\"margin:15px;\">
1466  You need to enable Session Cookies in your Browser to use ILIAS.
1467  <br/>
1468  <br/><b>Firefox</b>
1469  <br/>Tools -> Options -> Privacy -> Cookies
1470  <br/>Enable 'Allow sites to set cookies' and activate option 'Keep
1471  <br/>cookies' auf 'until I close Firefox'
1472  <br/>
1473  <br/><b>Mozilla/Netscape</b>
1474  <br/>Edit -> Preferences -> Privacy&Security -> Cookies
1475  <br/>Go to 'Cookie Lifetime Policy' and check option 'Accept for current
1476  <br/>session only'.
1477  <br/>
1478  <br/><b>Internet Explorer</b>
1479  <br/>Tools -> Internet Options -> Privacy -> Advanced
1480  <br/>- Check 'Override automatic cookie handling'
1481  <br/>- Check 'Always allow session cookies'
1482  </p>";
1483  $tpl->setVariable("CONTENT", $str);
1484  $tpl->printToStdout();
1485  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl

◆ showOpenIdConnectLoginForm()

ilStartUpGUI::showOpenIdConnectLoginForm (   $page_editor_html)
protected
Parameters
$page_editor_html
Returns
string

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

References $_GET, $DIC, $GLOBALS, $lang, $tpl, ilOpenIdConnectSettings\getInstance(), ILIAS_HTTP_PATH, ilOpenIdConnectSettings\LOGIN_ELEMENT_TYPE_IMG, ilOpenIdConnectSettings\LOGIN_ELEMENT_TYPE_TXT, and substituteLoginPageElements().

Referenced by showLoginPage().

1925  {
1926  global $DIC;
1927 
1928  $lang = $DIC->language();
1929 
1930  $oidc_settings = ilOpenIdConnectSettings::getInstance();
1931  if ($oidc_settings->getActive()) {
1932  $tpl = new ilTemplate('tpl.login_element.html', true, true, 'Services/OpenIdConnect');
1933 
1934  $lang->loadLanguageModule('auth');
1935  $tpl->setVariable('TXT_OIDCONNECT_HEADER', $lang->txt('auth_oidc_login_element_info'));
1936 
1937  $target = empty($_GET['target']) ? '' : ('?target=' . (string) $_GET['target']);
1938  switch ($oidc_settings->getLoginElementType()) {
1940 
1941 
1942  $tpl->setVariable('SCRIPT_OIDCONNECT_T', ILIAS_HTTP_PATH . '/openidconnect.php' . $target);
1943  $tpl->setVariable('TXT_OIDC', $oidc_settings->getLoginElemenText());
1944  break;
1945 
1947  $tpl->setVariable('SCRIPT_OIDCONNECT_I', ILIAS_HTTP_PATH . '/openidconnect.php' . $target);
1948  $tpl->setVariable('IMG_SOURCE', $oidc_settings->getImageFilePath());
1949  break;
1950  }
1951 
1952  return $this->substituteLoginPageElements(
1953  $GLOBALS['tpl'],
1954  $page_editor_html,
1955  $tpl->get(),
1956  '[list-openid-connect-login]',
1957  'OPEN_ID_CONNECT_LOGIN_FORM'
1958  );
1959  }
1960 
1961  return $page_editor_html;
1962  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$_GET["client_id"]
static getInstance()
Get singleton instance.
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$lang
Definition: xapiexit.php:8
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRegistrationLinks()

ilStartUpGUI::showRegistrationLinks (   $page_editor_html)
protected

Show registration, password forgotten, client slection links ilLanguage $lng ilSetting $ilSetting <type> $ilIliasIniFile.

Parameters
string$page_editor_html
Returns
string

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

References $_COOKIE, $_SERVER, $GLOBALS, $ilIliasIniFile, $ilSetting, $lng, ilRegistrationSettings\_lookupRegistrationType(), ilPublicSectionSettings\getInstance(), IL_REG_DISABLED, and substituteLoginPageElements().

Referenced by showLoginPage().

964  {
965  global $lng, $ilSetting, $ilIliasIniFile, $ilAccess;
966 
967  $rtpl = new ilTemplate('tpl.login_registration_links.html', true, true, 'Services/Init');
968 
969  // allow new registrations?
970  include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
972  $rtpl->setCurrentBlock("new_registration");
973  $rtpl->setVariable("REGISTER", $lng->txt("registration"));
974  $rtpl->setVariable(
975  "CMD_REGISTER",
976  $this->ctrl->getLinkTargetByClass("ilaccountregistrationgui", "")
977  );
978  $rtpl->parseCurrentBlock();
979  }
980  // allow password assistance? Surpress option if Authmode is not local database
981  if ($ilSetting->get("password_assistance")) {
982  $rtpl->setCurrentBlock("password_assistance");
983  $rtpl->setVariable("FORGOT_PASSWORD", $lng->txt("forgot_password"));
984  $rtpl->setVariable("FORGOT_USERNAME", $lng->txt("forgot_username"));
985  $rtpl->setVariable(
986  "CMD_FORGOT_PASSWORD",
987  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "")
988  );
989  $rtpl->setVariable(
990  "CMD_FORGOT_USERNAME",
991  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "showUsernameAssistanceForm")
992  );
993  $rtpl->setVariable("LANG_ID", $lng->getLangKey());
994  $rtpl->parseCurrentBlock();
995  }
996 
997  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
998  $ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, "read", "", ROOT_FOLDER_ID)) {
999  $rtpl->setCurrentBlock("homelink");
1000  $rtpl->setVariable("CLIENT_ID", "?client_id=" . $_COOKIE["ilClientId"] . "&lang=" . $lng->getLangKey());
1001  $rtpl->setVariable("TXT_HOME", $lng->txt("home"));
1002  $rtpl->parseCurrentBlock();
1003  }
1004 
1005  if ($ilIliasIniFile->readVariable("clients", "list")) {
1006  $rtpl->setCurrentBlock("client_list");
1007  $rtpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
1008  $rtpl->setVariable("CMD_CLIENT_LIST", $this->ctrl->getLinkTarget($this, "showClientList"));
1009  $rtpl->parseCurrentBlock();
1010  }
1011 
1012  return $this->substituteLoginPageElements(
1013  $GLOBALS['tpl'],
1014  $page_editor_html,
1015  $rtpl->get(),
1016  '[list-registration-link]',
1017  'REG_PWD_CLIENT_LINKS'
1018  );
1019  }
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
global $ilSetting
Definition: privfeed.php:17
$ilIliasIniFile
$_COOKIE[session_name()]
Definition: xapitoken.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSamlIdpSelection()

ilStartUpGUI::showSamlIdpSelection ( \ilSamlAuth  $auth,
array  $idps 
)
protected
Parameters
\ilSamlAuth$auth

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

References $DIC, and $factory.

Referenced by doSamlAuthentication().

2156  {
2157  global $DIC;
2158 
2159  self::initStartUpTemplate(array('tpl.saml_idp_selection.html', 'Services/Saml'));
2160 
2161  $factory = $DIC->ui()->factory();
2162  $renderer = $DIC->ui()->renderer();
2163 
2164  $DIC->ctrl()->setTargetScript('saml.php');
2165 
2166  $items = [];
2167 
2168  $table = new ilSamlIdpSelectionTableGUI($this, 'doSamlAuthentication');
2169 
2170  foreach ($idps as $idp) {
2171  $DIC->ctrl()->setParameter($this, 'saml_idp_id', $idp->getIdpId());
2172  $DIC->ctrl()->setParameter($this, 'idpentityid', urlencode($idp->getEntityId()));
2173 
2174  $items[] = [
2175  'idp_link' => $renderer->render($factory->link()->standard($idp->getEntityId(), $DIC->ctrl()->getLinkTarget($this, 'doSamlAuthentication')))
2176  ];
2177  }
2178 
2179  $table->setData($items);
2180  $this->mainTemplate->setVariable('CONTENT', $table->getHtml());
2181 
2182  $this->mainTemplate->printToStdout('DEFAULT', false);
2183  }
Class ilSamlIdpSelectionTableGUI.
$DIC
Definition: xapitoken.php:46
$factory
Definition: metadata.php:58
+ Here is the caller graph for this function:

◆ showSamlLoginForm()

ilStartUpGUI::showSamlLoginForm (   $page_editor_html)
protected
Parameters
string$page_editor_html
Returns
string

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

References $_GET, $GLOBALS, $tpl, ilSamlIdp\getActiveIdpList(), ilSamlSettings\getInstance(), language(), ilUtil\stripSlashes(), and substituteLoginPageElements().

Referenced by showLoginPage().

1890  {
1891  require_once 'Services/Saml/classes/class.ilSamlIdp.php';
1892  require_once 'Services/Saml/classes/class.ilSamlSettings.php';
1893 
1894  if (count(ilSamlIdp::getActiveIdpList()) > 0 && ilSamlSettings::getInstance()->isDisplayedOnLoginPage()) {
1895  $tpl = new ilTemplate('tpl.login_form_saml.html', true, true, 'Services/Saml');
1896 
1897  $return = '';
1898  if (isset($_GET['target'])) {
1899  $return = '?returnTo=' . urlencode(ilUtil::stripSlashes($_GET['target']));
1900  }
1901 
1902  $tpl->setVariable('SAML_SCRIPT_URL', './saml.php' . $return);
1903  $tpl->setVariable('TXT_LOGIN', $GLOBALS['DIC']->language()->txt('saml_log_in'));
1904  $tpl->setVariable('LOGIN_TO_ILIAS_VIA_SAML', $GLOBALS['DIC']->language()->txt('login_to_ilias_via_saml'));
1905  $tpl->setVariable('TXT_SAML_LOGIN_TXT', $GLOBALS['DIC']->language()->txt('saml_login_form_txt'));
1906  $tpl->setVariable('TXT_SAML_LOGIN_INFO_TXT', $GLOBALS['DIC']->language()->txt('saml_login_form_info_txt'));
1907 
1908  return $this->substituteLoginPageElements(
1909  $GLOBALS['tpl'],
1910  $page_editor_html,
1911  $tpl->get(),
1912  '[list-saml-login]',
1913  'SAML_LOGIN_FORM'
1914  );
1915  }
1916 
1917  return $page_editor_html;
1918  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$_GET["client_id"]
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
language()
Definition: language.php:2
static getActiveIdpList()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showShibbolethLoginForm()

ilStartUpGUI::showShibbolethLoginForm (   $page_editor_html)
protected

Show shibboleth login form.

Parameters
string$page_editor_html
Returns
string $page_editor_html

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

References $_GET, $GLOBALS, $ilSetting, $lng, $tpl, and substituteLoginPageElements().

Referenced by showLoginPage().

828  {
829  global $ilSetting, $lng;
830 
831  // Refactoring with ilFormPropertyGUI
832  // [...]
833 
834  // shibboleth login link
835  if ($ilSetting->get("shib_active")) {
836  $tpl = new ilTemplate('tpl.login_form_shibboleth.html', true, true, 'Services/Init');
837 
838  $tpl->setVariable('SHIB_FORMACTION', './shib_login.php'); // Bugfix http://ilias.de/mantis/view.php?id=10662 {$tpl->setVariable('SHIB_FORMACTION', $this->ctrl->getFormAction($this));}
839  $federation_name = $ilSetting->get("shib_federation_name");
840  $admin_mail = ' <a href="mailto:' . $ilSetting->get("admin_email") . '">ILIAS ' . $lng->txt(
841  "administrator"
842  ) . '</a>.';
843  if ($ilSetting->get("shib_hos_type") == 'external_wayf') {
844  $tpl->setCurrentBlock("shibboleth_login");
845  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
846  $tpl->setVariable("IL_TARGET", $_GET["target"]);
847  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
848  $tpl->setVariable("TXT_SHIB_LOGIN_BUTTON", $ilSetting->get("shib_login_button"));
849  $tpl->setVariable(
850  "TXT_SHIB_LOGIN_INSTRUCTIONS",
851  sprintf(
852  $lng->txt("shib_general_login_instructions"),
853  $federation_name,
854  $admin_mail
855  )
856  );
857  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
858  $tpl->parseCurrentBlock();
859  } elseif ($ilSetting->get("shib_hos_type") == 'embedded_wayf') {
860  $tpl->setCurrentBlock("shibboleth_custom_login");
861  $customInstructions = stripslashes($ilSetting->get("shib_login_instructions"));
862  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $customInstructions);
863  $tpl->parseCurrentBlock();
864  } else {
865  $tpl->setCurrentBlock("shibboleth_wayf_login");
866  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
867  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
868  $tpl->setVariable("TXT_SELECT_HOME_ORGANIZATION", sprintf($lng->txt("shib_select_home_organization"), $ilSetting->get("shib_federation_name")));
869  $tpl->setVariable("TXT_CONTINUE", $lng->txt("btn_next"));
870  $tpl->setVariable("TXT_SHIB_HOME_ORGANIZATION", $lng->txt("shib_home_organization"));
871  $tpl->setVariable(
872  "TXT_SHIB_LOGIN_INSTRUCTIONS",
873  sprintf(
874  $lng->txt("shib_general_wayf_login_instructions"),
875  $admin_mail
876  )
877  );
878  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
879 
880  require_once "./Services/AuthShibboleth/classes/class.ilShibbolethWAYF.php";
881  $WAYF = new ShibWAYF();
882 
883  $tpl->setVariable("TXT_SHIB_INVALID_SELECTION", $WAYF->showNotice());
884  $tpl->setVariable("SHIB_IDP_LIST", $WAYF->generateSelection());
885  $tpl->setVariable("ILW_TARGET", $_GET["target"]);
886  $tpl->parseCurrentBlock();
887  }
888 
889  return $this->substituteLoginPageElements($GLOBALS['tpl'], $page_editor_html, $tpl->get(), '[list-shibboleth-login-form]', 'SHIB_LOGIN_FORM');
890  }
891 
892  return $page_editor_html;
893  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$_GET["client_id"]
Class ShibbolethWAYF.
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTermsOfService()

ilStartUpGUI::showTermsOfService ( )
protected

Show terms of service.

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

References $_GET, $_POST, $tpl, ilUtil\formCheckbox(), ilSession\get(), ilSystemSupportContacts\getMailsToAddress(), ilTermsOfServiceHelper\isEnabled(), ilUtil\prepareFormOutput(), ilUtil\redirect(), ilSession\set(), and user().

Referenced by getAcceptance().

1499  {
1500  $back_to_login = ('getAcceptance' != $this->ctrl->getCmd());
1501 
1502  if (!$this->user->getId()) {
1503  $this->user->setId(ANONYMOUS_USER_ID);
1504  }
1505 
1506  $tpl = self::initStartUpTemplate('tpl.view_terms_of_service.html', $back_to_login, !$back_to_login);
1507 
1508  $handleDocument = \ilTermsOfServiceHelper::isEnabled() && $this->termsOfServiceEvaluation->hasDocument();
1509  if ($handleDocument) {
1510  $document = $this->termsOfServiceEvaluation->document();
1511  if ('getAcceptance' == $this->ctrl->getCmd()) {
1512  if (isset($_POST['status']) && 'accepted' == $_POST['status']) {
1513  $helper = new \ilTermsOfServiceHelper();
1514 
1515  $helper->trackAcceptance($this->user, $document);
1516 
1517  if (ilSession::get('orig_request_target')) {
1518  $target = ilSession::get('orig_request_target');
1519  ilSession::set('orig_request_target', '');
1520  ilUtil::redirect($target);
1521  } else {
1522  ilUtil::redirect('index.php?target=' . $_GET['target'] . '&client_id=' . CLIENT_ID);
1523  }
1524  }
1525 
1526  $tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, $this->ctrl->getCmd()));
1527  $tpl->setVariable('ACCEPT_CHECKBOX', ilUtil::formCheckbox(0, 'status', 'accepted'));
1528  $tpl->setVariable('ACCEPT_TERMS_OF_SERVICE', $this->lng->txt('accept_usr_agreement'));
1529  $tpl->setVariable('TXT_SUBMIT', $this->lng->txt('submit'));
1530  }
1531 
1532  $tpl->setPermanentLink('usr', null, 'agreement');
1533  $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $document->content());
1534  } else {
1535  $tpl->setVariable(
1536  'TERMS_OF_SERVICE_CONTENT',
1537  sprintf(
1538  $this->lng->txt('no_agreement_description'),
1540  )
1541  );
1542  }
1543 
1544  self::printToGlobalTemplate($tpl);
1545  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$_GET["client_id"]
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
user()
Definition: user.php:4
static getMailsToAddress()
Get mailto: emails.
static redirect($a_script)
$_POST["username"]
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTermsOfServiceLink()

ilStartUpGUI::showTermsOfServiceLink ( string  $page_editor_html)
protected

Show terms of service link.

Parameters
string$page_editor_html
Returns
string

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

References $GLOBALS, ilTermsOfServiceHelper\isEnabled(), substituteLoginPageElements(), and user().

Referenced by showLoginPage().

1026  : string
1027  {
1028  if (!$this->user->getId()) {
1029  $this->user->setId(ANONYMOUS_USER_ID);
1030  }
1031 
1032  if (\ilTermsOfServiceHelper::isEnabled() && $this->termsOfServiceEvaluation->hasDocument()) {
1033  $utpl = new ilTemplate('tpl.login_terms_of_service_link.html', true, true, 'Services/Init');
1034  $utpl->setVariable('TXT_TERMS_OF_SERVICE', $this->lng->txt('usr_agreement'));
1035  $utpl->setVariable('LINK_TERMS_OF_SERVICE', $this->ctrl->getLinkTarget($this, 'showTermsOfService'));
1036 
1037  return $this->substituteLoginPageElements(
1038  $GLOBALS['tpl'],
1039  $page_editor_html,
1040  $utpl->get(),
1041  '[list-user-agreement]',
1042  'USER_AGREEMENT'
1043  );
1044  }
1045 
1046  return $this->substituteLoginPageElements(
1047  $GLOBALS['tpl'],
1048  $page_editor_html,
1049  '',
1050  '[list-user-agreement]',
1051  'USER_AGREEMENT'
1052  );
1053  }
user()
Definition: user.php:4
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ substituteLoginPageElements()

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

Substitute login page elements.

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

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

References $tpl.

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

906  {
907  if (!strlen($page_editor_html)) {
908  $tpl->setVariable($fallback_tplvar, $element_html);
909  return $page_editor_html;
910  }
911  // Try to replace placeholders
912  if (!stristr($page_editor_html, $placeholder)) {
913  $tpl->setVariable($fallback_tplvar, $element_html);
914  return $page_editor_html;
915  }
916  return str_replace($placeholder, $element_html, $page_editor_html);
917  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilStartUpGUI::$ctrl
protected

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

◆ $httpRequest

ilStartUpGUI::$httpRequest
protected

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

Referenced by __construct().

◆ $lng

◆ $logger

ilStartUpGUI::$logger
protected

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

Referenced by getLogger().

◆ $mainTemplate

ilStartUpGUI::$mainTemplate
protected

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

Referenced by __construct().

◆ $termsOfServiceEvaluation

ilStartUpGUI::$termsOfServiceEvaluation
protected

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

Referenced by __construct().

◆ $user

ilStartUpGUI::$user
protected

◆ ACCOUNT_MIGRATION_MIGRATE

const ilStartUpGUI::ACCOUNT_MIGRATION_MIGRATE = 1

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

◆ ACCOUNT_MIGRATION_NEW

const ilStartUpGUI::ACCOUNT_MIGRATION_NEW = 2

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


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