ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStartUpGUI Class Reference

StartUp GUI class. More...

+ Collaboration diagram for ilStartUpGUI:

Public Member Functions

 ilStartUpGUI ()
 constructor More...
 
executeCommand ()
 execute command More...
 
 jumpToRegistration ()
 jump to registration gui More...
 
 jumpToPasswordAssistance ()
 jump to password assistance More...
 
 showLogin ()
 show login More...
 
 migrateAccount ()
 migrate account More...
 
 showLogout ()
 show logout screen More...
 
 showUserMappingSelection ()
 Show user selection screen, if external account could not be mapped to an ILIAS account, but the provided e-mail address is known. More...
 
 showClientList ()
 show client list More...
 
 showNoCookiesScreen ()
 show help screen, if cookies are disabled More...
 
 processIndexPHP ()
 process index.php More...
 
 _checkGoto ($a_target)
 
 confirmRegistration ()
 

Protected Member Functions

 showCodeForm ($a_username=null, $a_form=null)
 
 initCodeForm ($a_username)
 
 processCode ()
 
 showLoginForm ($page_editor_html)
 Show login form ilSetting $ilSetting. More...
 
 showLoginInformation ($page_editor_html)
 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...
 
 purgePlaceholders ($page_editor_html)
 Purge page editor html from unused placeholders. More...
 
 getAcceptance ()
 Get terms of service. More...
 
 showOpenIdLoginForm ($page_editor_html)
 Show openid login if enabled. More...
 

Static Protected Member Functions

static getLanguageSelection ()
 language selection list More...
 

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

Member Function Documentation

◆ _checkGoto()

ilStartUpGUI::_checkGoto (   $a_target)

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

References $_SESSION, $ilUser, $location, $path, $ref_id, $ret, ilObject\_getAllReferences(), ilObjCourse\_isActivated(), ilGroupParticipants\_isParticipant(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjCourse\_registrationEnabled(), ilParticipants\getDefaultMemberRole(), ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, and ilUtil\redirect().

1499  {
1500  global $objDefinition, $ilPluginAdmin, $ilUser;
1501 
1502  if (is_object($ilPluginAdmin))
1503  {
1504  // get user interface plugins
1505  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1506 
1507  // search
1508  foreach ($pl_names as $pl)
1509  {
1510  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1511  $gui_class = $ui_plugin->getUIClassInstance();
1512  $resp = $gui_class->checkGotoHook($a_target);
1513  if ($resp["target"] !== false)
1514  {
1515  $a_target = $resp["target"];
1516  break;
1517  }
1518  }
1519  }
1520 
1521  if ($a_target == "")
1522  {
1523  return false;
1524  }
1525 
1526  $t_arr = explode("_", $a_target);
1527  $type = $t_arr[0];
1528 
1529  if ($type == "git")
1530  {
1531  $type = "glo";
1532  }
1533 
1534  if ($type == "pg" | $type == "st")
1535  {
1536  $type = "lm";
1537  }
1538 
1539  $class = $objDefinition->getClassName($type);
1540  if ($class == "")
1541  {
1542  return false;
1543  }
1544 
1545  $location = $objDefinition->getLocation($type);
1546  $full_class = "ilObj".$class."Access";
1547  include_once($location."/class.".$full_class.".php");
1548 
1549  $ret = call_user_func(array($full_class, "_checkGoto"), $a_target);
1550 
1551  // if no access and repository object => check for parent course/group
1552  if(!$ret &&
1553  !stristr($a_target, "_wsp") &&
1554  $ilUser->getId() != ANONYMOUS_USER_ID && // #10637
1555  !$objDefinition->isAdministrationObject($type) &&
1556  $objDefinition->isRBACObject($type) &&
1557  $t_arr[1])
1558  {
1559  global $tree, $rbacsystem, $ilAccess;
1560 
1561  // original type "pg" => pg_<page_id>[_<ref_id>]
1562  if($t_arr[0] == "pg")
1563  {
1564  if(isset($t_arr[2]))
1565  {
1566  $ref_id = $t_arr[2];
1567  }
1568  else
1569  {
1570  $lm_id = ilLMObject::_lookupContObjID($t_arr[1]);
1572  if($ref_id)
1573  {
1574  $ref_id = array_shift($ref_id);
1575  }
1576  }
1577  }
1578  else
1579  {
1580  $ref_id = $t_arr[1];
1581  }
1582 
1583  include_once "Services/Membership/classes/class.ilParticipants.php";
1584  $block_obj = array();
1585 
1586  // walk path to find parent container
1587  $path = $tree->getPathId($ref_id);
1588  array_pop($path);
1589  foreach($path as $path_ref_id)
1590  {
1591  $redirect_infopage = false;
1592  $add_member_role = false;
1593 
1594  $ptype = ilObject::_lookupType($path_ref_id, true);
1595  $pobj_id = ilObject::_lookupObjId($path_ref_id);
1596 
1597  // core checks: timings/object-specific
1598  if(!$ilAccess->doActivationCheck("read", "", $path_ref_id, $ilUser->getId(), $pobj_id, $ptype) ||
1599  !$ilAccess->doStatusCheck("read", "", $path_ref_id, $ilUser->getId(), $pobj_id, $ptype))
1600  {
1601  // object in path is inaccessible - aborting
1602  return false;
1603  }
1604  else if($ptype == "crs")
1605  {
1606  // check if already participant
1607  include_once "Modules/Course/classes/class.ilCourseParticipant.php";
1608  $participants = new ilCourseParticipant($pobj_id, $ilUser->getId());
1609  if(!$participants->isAssigned())
1610  {
1611  // subscription currently possible?
1612  include_once "Modules/Course/classes/class.ilObjCourse.php";
1613  if(ilObjCourse::_isActivated($pobj_id) &&
1615  {
1616  $block_obj[] = $path_ref_id;
1617  $add_member_role = true;
1618  }
1619  else
1620  {
1621  $redirect_infopage = true;
1622  }
1623  }
1624  }
1625  else if($ptype == "grp")
1626  {
1627  // check if already participant
1628  include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1629  if(!ilGroupParticipants::_isParticipant($path_ref_id, $ilUser->getId()))
1630  {
1631  // subscription currently possible?
1632  include_once "Modules/Group/classes/class.ilObjGroup.php";
1633  $group_obj = new ilObjGroup($path_ref_id);
1634  if($group_obj->isRegistrationEnabled())
1635  {
1636  $block_obj[] = $path_ref_id;
1637  $add_member_role = true;
1638  }
1639  else
1640  {
1641  $redirect_infopage = true;
1642  }
1643  }
1644  }
1645 
1646  // add members roles for all "blocking" objects
1647  if($add_member_role)
1648  {
1649  // cannot join? goto will never work, so redirect to current object
1650  $rbacsystem->resetPACache($ilUser->getId(), $path_ref_id);
1651  if(!$rbacsystem->checkAccess("join", $path_ref_id))
1652  {
1653  $redirect_infopage = true;
1654  }
1655  else
1656  {
1657  $rbacsystem->addTemporaryRole($ilUser->getId(),
1658  ilParticipants::getDefaultMemberRole($path_ref_id));
1659  }
1660  }
1661 
1662  // redirect to infopage of 1st blocking object in path
1663  if($redirect_infopage)
1664  {
1665  if($rbacsystem->checkAccess("visible", $path_ref_id))
1666  {
1667  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI".
1668  "&ref_id=".$path_ref_id."&cmd=infoScreen");
1669  }
1670  else
1671  {
1672  return false;
1673  }
1674  }
1675  }
1676 
1677  // check if access will be possible with all (possible) member roles added
1678  $rbacsystem->resetPACache($ilUser->getId(), $ref_id);
1679  if($rbacsystem->checkAccess("read", $ref_id) && sizeof($block_obj)) // #12128
1680  {
1681  // this won't work with lm-pages (see above)
1682  // include_once "Services/Link/classes/class.ilLink.php";
1683  // $_SESSION["pending_goto"] = ilLink::_getStaticLink($ref_id, $type);
1684 
1685  // keep original target
1686  $_SESSION["pending_goto"] = "goto.php?target=".$a_target;
1687 
1688  // redirect to 1st non-member object in path
1689  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI".
1690  "&ref_id=".array_shift($block_obj));
1691  }
1692  }
1693 
1694  return $ret;
1695  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
$location
Definition: buildRTE.php:44
_registrationEnabled($a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
static getDefaultMemberRole($a_ref_id)
static _getAllReferences($a_id)
get all reference ids of object
_isActivated($a_obj_id)
Is activated.
static _lookupObjId($a_id)
_lookupContObjID($a_id)
get learning module / digibook id for lm object
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
$path
Definition: index.php:22
Class ilObjGroup.
static redirect($a_script)
http redirect to other script
const IL_COMP_SERVICE
+ Here is the call graph for this function:

◆ confirmRegistration()

ilStartUpGUI::confirmRegistration ( )

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

References $_COOKIE, $_GET, $ilLog, $lng, ilObjUserFolder\_lookupNewAccountMail(), ilObjUser\_verifyRegistrationHash(), ilUtil\generatePasswords(), ilObjectFactory\getInstanceByObjId(), IL_PASSWD_PLAIN, ilUtil\redirect(), and ilUtil\setCookie().

1698  {
1699  global $lng, $ilias, $ilLog;
1700 
1701  ilUtil::setCookie('iltest', 'cookie', false);
1702 
1703  if(!isset($_GET['rh']) || !strlen(trim($_GET['rh'])))
1704  {
1705  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_confirmation_hash_not_passed');
1706  }
1707 
1708  try
1709  {
1710  require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
1711  $oRegSettings = new ilRegistrationSettings();
1712 
1713  $usr_id = ilObjUser::_verifyRegistrationHash(trim($_GET['rh']));
1714  $oUser = ilObjectFactory::getInstanceByObjId($usr_id);
1715  $oUser->setActive(true);
1716  if($oRegSettings->passwordGenerationEnabled())
1717  {
1718  $passwd = ilUtil::generatePasswords(1);
1719  $password = $passwd[0];
1720  $oUser->setPasswd($password, IL_PASSWD_PLAIN);
1721  $oUser->setLastPasswordChangeTS( time() );
1722  }
1723  $oUser->update();
1724 
1725  $usr_lang = $oUser->getPref('language');
1726 
1727  if($lng->getLangKey() != $usr_lang)
1728  {
1729  $lng = new ilLanguage($usr_lang);
1730  }
1731 
1732  // send email
1733  // try individual account mail in user administration
1734  include_once("Services/Mail/classes/class.ilAccountMail.php");
1735  include_once './Services/User/classes/class.ilObjUserFolder.php';
1736  $amail = ilObjUserFolder::_lookupNewAccountMail($usr_lang);
1737  if (trim($amail["body"]) != "" && trim($amail["subject"]) != "")
1738  {
1739  $acc_mail = new ilAccountMail();
1740  $acc_mail->setUser($oUser);
1741  if($oRegSettings->passwordGenerationEnabled())
1742  {
1743  $acc_mail->setUserPassword($password);
1744  }
1745  $acc_mail->send();
1746  }
1747  else // do default mail
1748  {
1749  include_once 'Services/Mail/classes/class.ilMail.php';
1750  $mail_obj = new ilMail(ANONYMOUS_USER_ID);
1751 
1752  // mail subject
1753  $subject = $lng->txt("reg_mail_subject");
1754 
1755  // mail body
1756  $body = $lng->txt("reg_mail_body_salutation")." ".$oUser->getFullname().",\n\n".
1757  $lng->txt("reg_mail_body_text1")."\n\n".
1758  $lng->txt("reg_mail_body_text2")."\n".
1759  ILIAS_HTTP_PATH."/login.php?client_id=".CLIENT_ID."\n";
1760  $body .= $lng->txt("login").": ".$oUser->getLogin()."\n";
1761 
1762  if($oRegSettings->passwordGenerationEnabled())
1763  {
1764  $body.= $lng->txt("passwd").": ".$password."\n";
1765  }
1766 
1767  $body.= "\n";
1768  $body.= $lng->txt('reg_mail_body_forgot_password_info')."\n";
1769 
1770  $body.= "\n";
1771 
1772  $body .= ($lng->txt("reg_mail_body_text3")."\n\r");
1773  $body .= $oUser->getProfileAsString($lng);
1774  $mail_obj->enableSoap(false);
1775  $mail_obj->appendInstallationSignature(true);
1776  $mail_obj->sendMail($oUser->getEmail(), '', '',
1777  $subject,
1778  $body,
1779  array(), array('normal'));
1780  }
1781 
1782  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_account_confirmation_successful&lang='.$usr_lang);
1783  }
1784  catch(ilRegConfirmationLinkExpiredException $exception)
1785  {
1786  include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
1787  $soap_client = new ilSoapClient();
1788  $soap_client->setResponseTimeout(1);
1789  $soap_client->enableWSDL(true);
1790  $soap_client->init();
1791 
1792  $ilLog->write(__METHOD__.': Triggered soap call (background process) for deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
1793 
1794  $soap_client->call
1795  (
1796  'deleteExpiredDualOptInUserObjects',
1797  array
1798  (
1799  $_COOKIE['PHPSESSID'].'::'.$_COOKIE['ilClientId'], // session id and client id, not used for checking access -> not possible for anonymous
1800  $exception->getCode() // user id
1801  )
1802  );
1803 
1804  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$exception->getMessage()."&lang=".$usr_lang);
1805  }
1806  catch(ilRegistrationHashNotFoundException $exception)
1807  {
1808  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$exception->getMessage()."&lang=".$usr_lang);
1809  }
1810  }
const IL_PASSWD_PLAIN
$_GET["client_id"]
Class for user related exception handling in ILIAS.
$_COOKIE["ilClientId"]
Definition: cron.php:11
static generatePasswords($a_number)
Generate a number of passwords.
static _verifyRegistrationHash($a_hash)
Verifies a registration hash.
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
Class Mail this class handles base functions for mail handling.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjAuthSettingsGUI.
global $lng
Definition: privfeed.php:40
Class ilAccountMail.
language handling
Class for user related exception handling in ILIAS.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ executeCommand()

& ilStartUpGUI::executeCommand ( )

execute command

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

References $cmd, and $ilLog.

Referenced by jumpToPasswordAssistance(), and jumpToRegistration().

34  {
35  global $ilLog;
36 
37  $cmd = $this->ctrl->getCmd("processIndexPHP",array('processIndexPHP','showLogin'));
38  $ilLog->write(__METHOD__.' cmd = '.$cmd);
39  $next_class = $this->ctrl->getNextClass($this);
40 
41  switch($next_class)
42  {
43  case 'ilLoginPageGUI':
44  break;
45 
46  case "ilaccountregistrationgui":
47  require_once("Services/Registration/classes/class.ilAccountRegistrationGUI.php");
48  return $this->ctrl->forwardCommand(new ilAccountRegistrationGUI());
49 
50  case "ilpasswordassistancegui":
51  require_once("Services/Init/classes/class.ilPasswordAssistanceGUI.php");
52  return $this->ctrl->forwardCommand(new ilPasswordAssistanceGUI());
53 
54  default:
55  return $this->$cmd();
56  }
57  }
Class ilAccountRegistrationGUI.
$cmd
Definition: sahs_server.php:35
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 1350 of file class.ilStartUpGUI.php.

References $_GET, $_POST, $ilSetting, $ilUser, $lng, $tpl, ilUtil\formCheckbox(), ilSession\get(), ilTermsOfServiceSignableDocumentFactory\getByLanguageObject(), ilUtil\prepareFormOutput(), ilUtil\redirect(), ilSession\set(), and ilTermsOfServiceHelper\trackAcceptance().

1351  {
1352  $this->showTermsOfService();
1353  }
+ Here is the call graph for this function:

◆ getLanguageSelection()

static ilStartUpGUI::getLanguageSelection ( )
staticprotected

language selection list

Returns
string ilGroupedList

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

References ilMainMenuGUI\getLanguageSelection().

1953  {
1954  include_once("./Services/MainMenu/classes/class.ilMainMenuGUI.php");
1956  }
static getLanguageSelection($a_in_topbar=false)
+ Here is the call graph for this function:

◆ getLoginPageEditorHTML()

ilStartUpGUI::getLoginPageEditorHTML ( )
protected

Get HTML of ILIAS login page editor.

Returns
string html

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

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

Referenced by showLogin().

734  {
735  global $lng, $tpl;
736 
737  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php';
739  $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey());
740 
741  if(!$active_lang)
742  {
743  return '';
744  }
745 
746  // if page does not exist, return nothing
747  include_once './Services/COPage/classes/class.ilPageUtil.php';
748  if(!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang)))
749  {
750  return '';
751  }
752 
753  include_once './Services/Authentication/classes/class.ilLoginPage.php';
754  include_once './Services/Authentication/classes/class.ilLoginPageGUI.php';
755 
756  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
757  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",ilObjStyleSheet::getContentStylePath(0));
758  $tpl->setCurrentBlock("SyntaxStyle");
759  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",ilObjStyleSheet::getSyntaxStylePath());
760  $tpl->parseCurrentBlock();
761 
762  // get page object
763  $page_gui = new ilLoginPageGUI(ilLanguage::lookupId($active_lang));
764 
765  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
766  $page_gui->setStyleId(0, 'auth');
767 
768  $page_gui->setPresentationTitle("");
769  $page_gui->setTemplateOutput(false);
770  $page_gui->setHeader("");
771  $ret = $page_gui->showPage();
772 
773  return $ret;
774  }
Login page GUI class.
getSyntaxStylePath()
get syntax style path
global $tpl
Definition: ilias.php:8
_existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
getContentStylePath($a_style_id)
get content style path
global $lng
Definition: privfeed.php:40
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:

◆ ilStartUpGUI()

ilStartUpGUI::ilStartUpGUI ( )

constructor

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

References $ilCtrl.

22  {
23  global $ilCtrl;
24 
25  $this->ctrl =& $ilCtrl;
26 
27  $ilCtrl->saveParameter($this, array("rep_ref_id", "lang", "target", "client_id"));
28  }
global $ilCtrl
Definition: ilias.php:18

◆ initCodeForm()

ilStartUpGUI::initCodeForm (   $a_username)
protected

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

References $ilCtrl, $lng, and ilFormPropertyGUI\setRequired().

Referenced by processCode(), and showCodeForm().

384  {
385  global $lng, $ilCtrl;
386 
387  $lng->loadLanguageModule("auth");
388 
389  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
390 
391  $form = new ilPropertyFormGUI();
392  $form->setFormAction($ilCtrl->getFormAction($this, 'showcodeform'));
393  $form->setTitle($lng->txt('auth_account_code_title'));
394 
395  $count = new ilTextInputGUI($lng->txt('auth_account_code'), 'code');
396  $count->setRequired(true);
397  $count->setInfo($lng->txt('auth_account_code_info'));
398  $form->addItem($count);
399 
400  // #11658
401  $uname = new ilHiddenInputGUI("uname");
402  $uname->setValue($a_username);
403  $form->addItem($uname);
404 
405  $form->addCommandButton('processCode', $lng->txt('send'));
406 
407  return $form;
408  }
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.
This class represents a text property in a property form.
global $lng
Definition: privfeed.php:40
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

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

References executeCommand().

73  {
74  $this->ctrl->setCmdClass("ilpasswordassistancegui");
75  $this->ctrl->setCmd("");
76  $this->executeCommand();
77  }
& executeCommand()
execute command
+ Here is the call graph for this function:

◆ jumpToRegistration()

ilStartUpGUI::jumpToRegistration ( )

jump to registration gui

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

References executeCommand().

63  {
64  $this->ctrl->setCmdClass("ilaccountregistrationgui");
65  $this->ctrl->setCmd("");
66  $this->executeCommand();
67  }
& executeCommand()
execute command
+ Here is the call graph for this function:

◆ migrateAccount()

ilStartUpGUI::migrateAccount ( )

migrate account

public

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

References $_GET, $_POST, $ilLog, $lng, ilSession\_destroy(), ilObjUser\_lookupId(), ilAuthFactory\CONTEXT_OPENID, ilAuthFactory\factory(), ilSession\get(), ilUtil\redirect(), ilSession\set(), ilAuthFactory\setContext(), and ilUtil\stripSlashes().

971  {
972  global $lng,$ilClientIniFile,$ilLog,$rbacadmin;
973 
974  $lng->loadLanguageModule('auth');
975 
976  if(!isset($_POST['account_migration']))
977  {
978  $this->showAccountMigration($lng->txt('err_choose_migration_type'));
979  return false;
980  }
981 
982  if($_POST['account_migration'] == 1 and (!strlen($_POST['mig_username']) or !strlen($_POST['mig_password'])))
983  {
984  $this->showAccountMigration($lng->txt('err_wrong_login'));
985  return false;
986  }
987 
988  if($_POST['account_migration'] == 1)
989  {
990  if(!$user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST['mig_username'])))
991  {
992  $this->showAccountMigration($lng->txt('err_wrong_login'));
993  return false;
994  }
995  $_POST['username'] = $_POST['mig_username'];
996  $_POST['password'] = $_POST['mig_password'];
997 
998  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
999  include_once './Services/Database/classes/class.ilAuthContainerMDB2.php';
1000 
1002  $ilAuth->start();
1003  if(!$ilAuth->checkAuth())
1004  {
1005  $ilAuth->logout();
1006  $this->showAccountMigration($lng->txt('err_wrong_login'));
1007  return false;
1008  }
1009 
1010  $user = new ilObjUser($user_id);
1011  $user->setAuthMode(ilSession::get('tmp_auth_mode'));
1012  $user->setExternalAccount(ilSession::get('tmp_external_account'));
1013  $user->setActive(true);
1014  $user->update();
1015 
1016  // Assign to default role
1017  if(is_array(ilSession::get('tmp_roles')))
1018  {
1019  foreach(ilSession::get('tmp_roles') as $role)
1020  {
1021  $rbacadmin->assignUser((int) $role,$user->getId());
1022  }
1023  }
1024 
1025  // Log migration
1026  $ilLog->write(__METHOD__.': Migrated '.ilSession::get('tmp_external_account').' to ILIAS account '.$user->getLogin().'.');
1027  }
1028  elseif($_POST['account_migration'] == 2)
1029  {
1030  switch(ilSession::get('tmp_auth_mode'))
1031  {
1032  case 'apache':
1033  $_POST['username'] = ilSession::get('tmp_external_account');
1034  $_POST['password'] = ilSession::get('tmp_pass');
1035 
1036  include_once('Services/AuthApache/classes/class.ilAuthContainerApache.php');
1037  $container = new ilAuthContainerApache();
1038  $container->forceCreation(true);
1039  $ilAuth = ilAuthFactory::factory($container);
1040  $ilAuth->start();
1041  break;
1042 
1043  case 'ldap':
1044  $_POST['username'] = ilSession::get('tmp_external_account');
1045  $_POST['password'] = ilSession::get('tmp_pass');
1046 
1047  include_once('Services/LDAP/classes/class.ilAuthContainerLDAP.php');
1048  $container = new ilAuthContainerLDAP();
1049  $container->forceCreation(true);
1050  $ilAuth = ilAuthFactory::factory($container);
1051  $ilAuth->start();
1052  break;
1053 
1054  case 'radius':
1055  $_POST['username'] = ilSession::get('tmp_external_account');
1056  $_POST['password'] = ilSession::get('tmp_pass');
1057 
1058  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
1059  include_once './Services/Radius/classes/class.ilAuthContainerRadius.php';
1060 
1061  $container = new ilAuthContainerRadius();
1062  $container->forceCreation(true);
1063  $ilAuth = ilAuthFactory::factory($container);
1064  $ilAuth->start();
1065  break;
1066 
1067  case 'openid':
1068  $_POST['username'] = ilSession::get('dummy');
1069  $_POST['password'] = ilSession::get('dummy');
1070  $_POST['oid_username'] = ilSession::get('tmp_oid_username');
1071  $_POST['oid_provider'] = ilSession::get('tmp_oid_provider');
1072  //ilSession::set('force_creation', true);
1073 
1074  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
1075  include_once './Services/OpenId/classes/class.ilAuthContainerOpenId.php';
1076 
1077  $container = new ilAuthContainerOpenId();
1078  $container->forceCreation(true);
1080  include_once './Services/OpenId/classes/class.ilAuthOpenId.php';
1081  $ilAuth = ilAuthFactory::factory($container);
1082 
1083  // logout first to initiate a new login session
1084  $ilAuth->logout();
1085  ilSession::_destroy(session_id());
1086  ilSession::set('force_creation', true);
1087  $ilAuth->start();
1088  }
1089  // Redirect to acceptance
1090  ilUtil::redirect("ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&target=".$_GET["target"]."&cmd=getAcceptance");
1091  }
1092  // show personal desktop
1093  ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
1094  }
static _destroy($a_session_id, $a_closing_context=null, $a_expired_at=null)
Destroy session.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
Overwritten Pear class AuthContainerLDAP This class is overwritten to support nested groups...
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
static _lookupId($a_user_str)
lookup id by login
Authentication against ILIAS database.
static setContext($a_context)
set context
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $lng
Definition: privfeed.php:40
Overwritten Pear class AuthContainerRadius This class is overwritten to support to perform Radius aut...
Authentication against ILIAS database.
static factory(ilAuthContainerBase $deco)
The factory.
static redirect($a_script)
http redirect to other script
Pear auth container for openid
+ Here is the call graph for this function:

◆ processCode()

ilStartUpGUI::processCode ( )
protected

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

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

411  {
412  global $lng, $ilAuth, $ilCtrl;
413 
414  $uname = $_POST["uname"];
415 
416  $form = $this->initCodeForm($uname);
417  if($uname && $form->checkInput())
418  {
419  $code = $form->getInput("code");
420 
421  include_once "Services/User/classes/class.ilAccountCode.php";
422  if(ilAccountCode::isUnusedCode($code))
423  {
424  $valid_until = ilAccountCode::getCodeValidUntil($code);
425 
426  if(!$user_id = ilObjUser::_lookupId($uname))
427  {
428  $this->showLogin();
429  return false;
430  }
431 
432  $invalid_code = false;
433  $user = new ilObjUser($user_id);
434 
435  if($valid_until === "0")
436  {
437  $user->setTimeLimitUnlimited(true);
438  }
439  else
440  {
441  if(is_numeric($valid_until))
442  {
443  $valid_until = strtotime("+".$valid_until."days");
444  }
445  else
446  {
447  $valid_until = explode("-", $valid_until);
448  $valid_until = mktime(23, 59, 59, $valid_until[1],
449  $valid_until[2], $valid_until[0]);
450  if($valid_until < time())
451  {
452  $invalid_code = true;
453  }
454  }
455 
456  if(!$invalid_code)
457  {
458  $user->setTimeLimitUnlimited(false);
459  $user->setTimeLimitUntil($valid_until);
460  }
461  }
462 
463  if(!$invalid_code)
464  {
465  $user->setActive(true);
466 
467  ilAccountCode::useCode($code);
468 
469  // apply registration code role assignments
471 
472  // apply registration code time limits
473  ilAccountCode::applyAccessLimits($user, $code);
474 
475  $user->update();
476 
477  $ilCtrl->setParameter($this, "cu", 1);
478  $ilCtrl->redirect($this, "showLogin");
479  }
480  }
481 
482  $lng->loadLanguageModule("user");
483  $field = $form->getItemByPostVar("code");
484  $field->setAlert($lng->txt("user_account_code_not_valid"));
485  }
486 
487  $form->setValuesByPost();
488  $this->showCodeForm($uname, $form);
489  }
static applyRoleAssignments(ilObjUser $user, $code)
initCodeForm($a_username)
static applyAccessLimits(ilObjUser $user, $code)
$_POST['username']
Definition: cron.php:12
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
showLogin()
show login
static getCodeValidUntil($code)
global $lng
Definition: privfeed.php:40
static isUnusedCode($code)
+ Here is the call graph for this function:

◆ processIndexPHP()

ilStartUpGUI::processIndexPHP ( )

process index.php

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

References $_GET, $_POST, $ilIliasIniFile, $ilSetting, $ilUser, ilPaymentShoppingCart\_assignObjectsToUserId(), ilUserUtil\getStartingPointAsUrl(), ilInitialisation\goToPublicSection(), ilUtil\redirect(), showClientList(), and showLogin().

Referenced by showClientList().

1417  {
1418  global $ilIliasIniFile, $ilAuth, $ilSetting;
1419 
1420  // display client selection list if enabled
1421  if (!isset($_GET["client_id"]) &&
1422  $_GET["cmd"] == "" &&
1423  $ilIliasIniFile->readVariable("clients","list"))
1424  {
1425  return $this->showClientList();
1426  }
1427 
1428  if($ilAuth->getAuth() && $ilAuth->getStatus() == "")
1429  {
1430  $this->processStartingPage();
1431  }
1432 
1433  //
1434  // index.php is called and public section is enabled
1435  //
1436  // && $ilAuth->status == -101 is important for soap auth (public section on + user mapping, alex)
1437  // $ilAuth->status -1 is given, if session ends (if public section -> jump to public section)
1438 
1439  if ($ilSetting->get("pub_section") && $_POST["sendLogin"] != "1"
1440  && ($ilAuth->getStatus() != -101 && $_GET["soap_pw"] == ""))
1441  {
1443  }
1444  else
1445  {
1446  // index.php is called and public section is disabled
1447  $this->showLogin();
1448  }
1449  }
$_POST['username']
Definition: cron.php:12
static goToPublicSection($a_auth_stat="")
go to public section
$_GET["client_id"]
showLogin()
show login
global $ilIliasIniFile
showClientList()
show client list
global $ilSetting
Definition: privfeed.php:40
+ 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 889 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

890  {
891  return str_replace(
892  array(
893  '[list-language-selection] ',
894  '[list-registration-link]',
895  '[list-user-agreement]',
896  '[list-login-form]',
897  '[list-cas-login-form]',
898  '[list-shibboleth-login-form]',
899  '[list-openid-login-form]'
900  ),
901  array('','','','','','',''),
902  $page_editor_html
903  );
904  }
+ 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 619 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

620  {
621  global $ilSetting, $lng;
622 
623 
624  // cas login link
625  if ($ilSetting->get("cas_active"))
626  {
627  $tpl = new ilTemplate('tpl.login_form_cas.html', true, true, 'Services/Init');
628  $tpl->setVariable("TXT_CAS_LOGIN", $lng->txt("login_to_ilias_via_cas"));
629  $tpl->setVariable("TXT_CAS_LOGIN_BUTTON", ilUtil::getImagePath("cas_login_button.png"));
630  $tpl->setVariable("TXT_CAS_LOGIN_INSTRUCTIONS", $ilSetting->get("cas_login_instructions"));
631  $this->ctrl->setParameter($this, "forceCASLogin", "1");
632  $tpl->setVariable("TARGET_CAS_LOGIN",$this->ctrl->getLinkTarget($this, "showLogin"));
633  $this->ctrl->setParameter($this, "forceCASLogin", "");
634 
635  return $this->substituteLoginPageElements(
636  $GLOBALS['tpl'],
637  $page_editor_html,
638  $tpl->get(),
639  '[list-cas-login-form]',
640  'CAS_LOGIN_FORM'
641  );
642  }
643  return $page_editor_html;
644  }
global $tpl
Definition: ilias.php:8
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
$GLOBALS['ct_recipient']
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
+ 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 1211 of file class.ilStartUpGUI.php.

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

Referenced by processIndexPHP().

1212  {
1213  global $tpl, $ilIliasIniFile, $ilCtrl;
1214 //echo "1";
1215  if (!$ilIliasIniFile->readVariable("clients","list"))
1216  {
1217  $this->processIndexPHP();
1218  return;
1219  }
1220 //echo "2";
1221  $tpl = new ilTemplate("tpl.main.html", true, true);
1222  $tpl->setAddFooter(false); // no client yet
1223 
1224  // to do: get standard style
1225  $tpl->setVariable("PAGETITLE","Client List");
1226  $tpl->setVariable("LOCATION_STYLESHEET","./templates/default/delos.css");
1227 
1228  // load client list template
1229  self::initStartUpTemplate("tpl.client_list.html");
1230 
1231  // load template for table
1232  $tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html");
1233 
1234  // load template for table content data
1235  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
1236 
1237  // load table content data
1238  require_once("setup/classes/class.ilClientList.php");
1239  require_once("setup/classes/class.ilClient.php");
1240  require_once("setup/classes/class.ilDBConnections.php");
1241  require_once("./Services/Table/classes/class.ilTableGUI.php");
1242  $this->db_connections = new ilDBConnections();
1243  $clientlist = new ilClientList($this->db_connections);
1244  $list = $clientlist->getClients();
1245 
1246  if (count($list) == 0)
1247  {
1248  header("Location: ./setup/setup.php");
1249  exit();
1250  }
1251 
1252  $hasPublicSection = false;
1253  foreach ($list as $key => $client)
1254  {
1255  $client->setDSN();
1256 
1257  if ($client->checkDatabaseExists(true) and $client->ini->readVariable("client","access") and $client->getSetting("setup_ok"))
1258  {
1259  $this->ctrl->setParameter($this, "client_id", $key);
1260  $tmp = array();
1261  $tmp[] = $client->getName();
1262  $tmp[] = "<a href=\""."login.php?cmd=force_login&client_id=".urlencode($key)."\">Login page</a>";
1263 
1264  if($client->getSetting('pub_section'))
1265  {
1266  $hasPublicSection = true;
1267  $tmp[] = "<a href=\"" . "ilias.php?baseClass=ilRepositoryGUI&client_id=" . urlencode($key) . "\">Start page</a>";
1268  }
1269  else
1270  {
1271  $tmp[] = '';
1272  }
1273 
1274  $data[] = $tmp;
1275  }
1276  }
1277 
1278  // create table
1279  $tbl = new ilTableGUI();
1280 
1281  // title & header columns
1282  if($hasPublicSection)
1283  {
1284  $tbl->setTitle("Available Clients");
1285  $tbl->setHeaderNames(array("Installation Name","Login","Public Access"));
1286  $tbl->setHeaderVars(array("name","index","login"));
1287  $tbl->setColumnWidth(array("50%","25%","25%"));
1288  }
1289  else
1290  {
1291  $tbl->setTitle("Available Clients");
1292  $tbl->setHeaderNames(array("Installation Name","Login",''));
1293  $tbl->setHeaderVars(array("name","login",''));
1294  $tbl->setColumnWidth(array("70%","25%",'1px'));
1295  }
1296 
1297  // control
1298  $tbl->setOrderColumn($_GET["sort_by"],"name");
1299  $tbl->setOrderDirection($_GET["sort_order"]);
1300  $tbl->setLimit($_GET["limit"]);
1301  $tbl->setOffset($_GET["offset"]);
1302 
1303  // content
1304  $tbl->setData($data);
1305 
1306  $tbl->disable("icon");
1307  $tbl->disable("numinfo");
1308  $tbl->disable("sort");
1309  $tbl->disable("footer");
1310 
1311  // render table
1312  $tbl->render();
1313  $tpl->show("DEFAULT", true, true);
1314  }
exit
Definition: login.php:54
Administrates DB connections in setup.
$_GET["client_id"]
Class ilTableGUI.
processIndexPHP()
process index.php
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
client management
special template class to simplify handling of ITX/PEAR
global $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 366 of file class.ilStartUpGUI.php.

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

Referenced by processCode(), and showLogin().

367  {
368  global $tpl, $lng;
369 
370  self::initStartUpTemplate("tpl.login_reactivate_code.html");
371 
372  ilUtil::sendFailure($lng->txt("time_limit_reached"));
373 
374  if(!$a_form)
375  {
376  $a_form = $this->initCodeForm($a_username);
377  }
378 
379  $tpl->setVariable("FORM", $a_form->getHTML());
380  $tpl->show("DEFAULT", false);
381  }
initCodeForm($a_username)
global $tpl
Definition: ilias.php:8
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLogin()

ilStartUpGUI::showLogin ( )

show login

ilLanguage $lng

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

References $_COOKIE, $_GET, $_SESSION, $failure, $ilSetting, $lng, $success, $tpl, AUTH_APACHE_FAILED, AUTH_CAPTCHA_INVALID, AUTH_CAS_NO_ILIAS_USER, AUTH_EXPIRED, AUTH_IDLED, AUTH_LDAP_NO_ILIAS_USER, AUTH_MODE_INACTIVE, AUTH_RADIUS_NO_ILIAS_USER, AUTH_SOAP_NO_ILIAS_USER, AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL, AUTH_USER_INACTIVE, AUTH_USER_SIMULTANEOUS_LOGIN, AUTH_USER_TIME_LIMIT_EXCEEDED, AUTH_USER_WRONG_IP, AUTH_WRONG_LOGIN, getLoginPageEditorHTML(), purgePlaceholders(), ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilSession\SESSION_CLOSE_CAPTCHA, ilSession\SESSION_CLOSE_INACTIVE, ilSession\SESSION_CLOSE_IP, ilSession\SESSION_CLOSE_SIMUL, ilSession\SESSION_CLOSE_TIME, ilSession\set(), ilSession\setClosingContext(), ilUtil\setCookie(), showCASLoginForm(), showCodeForm(), showLoginForm(), showLoginInformation(), showOpenIdLoginForm(), showRegistrationLinks(), showShibbolethLoginForm(), and showUserMappingSelection().

Referenced by processCode(), and processIndexPHP().

85  {
86  global $ilSetting, $ilAuth, $tpl, $ilias, $lng;
87 
88  $status = $ilAuth->getStatus();
89  if ($status == "" && isset($_GET["auth_stat"]))
90  {
91  $status = $_GET["auth_stat"];
92  }
93 
94  if($ilAuth->getAuth() && !$status)
95  {
96  // deprecated?
97  if ($_GET["rep_ref_id"] != "")
98  {
99  $_GET["ref_id"] = $_GET["rep_ref_id"];
100  }
101  $this->processStartingPage();
102  }
103 
104  // if authentication of soap user failed, but email address is
105  // known, show users and ask for password
106  if ($status == AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL)
107  {
108  $this->showUserMappingSelection();
109  return;
110  }
111 
112  // check for session cookies enabled
113  if (!isset($_COOKIE['iltest']))
114  {
115  if (empty($_GET['cookies']))
116  {
117  $additional_params = '';
118 
119  if(IS_PAYMENT_ENABLED)
120  {
121  if((int)$_GET['forceShoppingCartRedirect'])# && (int)$_SESSION['price_id'] && (int)$_SESSION['pobject_id'])
122  {
123  $additional_params .= '&login_to_purchase_object=1&forceShoppingCartRedirect=1';
124  }
125  }
126 
127  ilUtil::setCookie("iltest","cookie",false);
128  ilUtil::redirect("login.php?target=".$_GET["target"]."&soap_pw=".$_GET["soap_pw"].
129  "&ext_uid=".$_GET["ext_uid"]."&cookies=nocookies&client_id=".
130  rawurlencode(CLIENT_ID)."&lang=".$lng->getLangKey().$additional_params);
131  }
132  else
133  {
134  $_COOKIE['iltest'] = "";
135  }
136  }
137  else
138  {
139  unset($_GET['cookies']);
140  }
141 
142  if ($ilSetting->get("shib_active") && $ilSetting->get("shib_hos_type"))
143  {
144  require_once "./Services/AuthShibboleth/classes/class.ilShibbolethWAYF.php";
145  // Check if we user selects Home Organization
146  $WAYF = new ShibWAYF();
147  }
148 
149  if (isset($WAYF) && $WAYF->is_selection())
150  {
151  if ($WAYF->is_valid_selection())
152  {
153  // Set cookie
154  $WAYF->setSAMLCookie();
155 
156  // Redirect
157  $WAYF->redirect();
158  }
159  }
160 
161  $failure = $success = null;
162 
163  if(IS_PAYMENT_ENABLED)
164  {
165  if(isset($_GET['forceShoppingCartRedirect']) && (int)$_GET['forceShoppingCartRedirect'] == 1)
166  {
167  $this->ctrl->setParameter($this, 'forceShoppingCartRedirect', 1);
168  ilSession::set('forceShoppingCartRedirect', 1);
169  }
170 
171  if (isset($_GET['login_to_purchase_object']) && $_GET['login_to_purchase_object'])
172  {
173  $lng->loadLanguageModule('payment');
174  $failure = $lng->txt("payment_login_to_buy_object");
175  ilSession::set('forceShoppingCartRedirect', 1);
176  }
177  }
178 
179  // :TODO: handle internally?
180  if (isset($_GET['reg_confirmation_msg']) && strlen(trim($_GET['reg_confirmation_msg'])))
181  {
182  $lng->loadLanguageModule('registration');
183  if($_GET['reg_confirmation_msg'] == 'reg_account_confirmation_successful')
184  {
185  $success = $lng->txt(trim($_GET['reg_confirmation_msg']));
186  }
187  else
188  {
189  $failure = $lng->txt(trim($_GET['reg_confirmation_msg']));
190  }
191  }
192  else if(isset($_GET['reached_session_limit']) && $_GET['reached_session_limit'])
193  {
194  $failure = $lng->txt("reached_session_limit");
195  }
196  else if(isset($_GET['accdel']) && $_GET['accdel'])
197  {
198  $lng->loadLanguageModule('user');
199  $failure = $lng->txt("user_account_deleted_confirmation");
200  }
201 
202  if (!empty($status))
203  {
204  switch ($status)
205  {
206  case AUTH_IDLED:
207  // lang variable err_idled not existing
208  // $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_idled"));
209  // fallthrough
210 
211  case AUTH_EXPIRED:
212  $failure = $lng->txt("err_session_expired");
213  break;
214 
216  $failure = $lng->txt("err_auth_cas_no_ilias_user");
217  break;
218 
220  $failure = $lng->txt("err_auth_soap_no_ilias_user");
221  break;
222 
224  $failure = $lng->txt("err_auth_ldap_no_ilias_user");
225  break;
226 
228  $failure = $lng->txt("err_auth_radius_no_ilias_user");
229  break;
230 
231  case AUTH_MODE_INACTIVE:
232  $failure = $lng->txt("err_auth_mode_inactive");
233  break;
234 
235  case AUTH_APACHE_FAILED:
236  $failure = $lng->txt("err_auth_apache_failed");
237  break;
238 
240  $lng->loadLanguageModule('cptch');
242  $ilAuth->logout();
243  session_destroy();
244  $failure = $lng->txt("cptch_wrong_input");
245  break;
246 
247  // special cases: extended user validation failed
248  // ilAuth was successful, so we have to logout here
249 
250  case AUTH_USER_WRONG_IP:
252  $ilAuth->logout();
253  session_destroy();
254 
255  $failure = $lng->txt("wrong_ip_detected")." (".$_SERVER["REMOTE_ADDR"].")";
256  break;
257 
260  $ilAuth->logout();
261  session_destroy();
262 
263  $failure = $lng->txt("simultaneous_login_detected");
264  break;
265 
268  $username = $ilAuth->getExceededUserName(); // #16327
269  $ilAuth->logout();
270 
271  // user could reactivate by code?
272  if($ilSetting->get('user_reactivate_code'))
273  {
274  return $this->showCodeForm($username);
275  }
276 
277  session_destroy();
278 
279  $failure = $lng->txt("time_limit_reached");
280  break;
281 
282  case AUTH_USER_INACTIVE:
284  $ilAuth->logout();
285  session_destroy();
286 
287  $failure = $lng->txt("err_inactive");
288  break;
289 
290  // special cases end
291 
292 
293  case AUTH_WRONG_LOGIN:
294  default:
295  $add = "";
296  $auth_error = $ilias->getAuthError();
297  if (is_object($auth_error))
298  {
299  $add = "<br>".$auth_error->getMessage();
300  }
301  $failure = $lng->txt("err_wrong_login").$add;
302  break;
303  }
304  }
305 
306  if (isset($_GET['cu']) && $_GET['cu'])
307  {
308  $lng->loadLanguageModule("auth");
309  $success = $lng->txt("auth_account_code_used");
310  }
311 
312 
313  // --- render
314 
315  // Instantiate login template
316  self::initStartUpTemplate("tpl.login.html");
317 
318  // we need the template for this
319  if($failure)
320  {
322  }
323  else if($success)
324  {
326  }
327 
328  $page_editor_html = $this->getLoginPageEditorHTML();
329  $page_editor_html = $this->showLoginInformation($page_editor_html);
330  $page_editor_html = $this->showLoginForm($page_editor_html);
331  $page_editor_html = $this->showCASLoginForm($page_editor_html);
332  $page_editor_html = $this->showShibbolethLoginForm($page_editor_html);
333  $page_editor_html = $this->showOpenIdLoginForm($page_editor_html);
334  $page_editor_html = $this->showRegistrationLinks($page_editor_html);
335  $page_editor_html = $this->showTermsOfServiceLink($page_editor_html);
336 
337  $page_editor_html = $this->purgePlaceholders($page_editor_html);
338 
339 
340 
341  // not controlled by login page editor
342 
343  $tpl->setVariable("PAGETITLE", $lng->txt("startpage"));
344  $tpl->setVariable("ILIAS_RELEASE", $ilSetting->get("ilias_version"));
345 
346  $this->ctrl->setTargetScript("ilias.php");
347  $tpl->setVariable("PHP_SELF", $_SERVER['PHP_SELF']);
348 
349  // browser does not accept cookies
350  if (isset($_GET['cookies']) && $_GET['cookies'] == 'nocookies')
351  {
352  ilUtil::sendFailure($lng->txt("err_no_cookies"));
353  }
354 
355  if(strlen($page_editor_html))
356  {
357  $tpl->setVariable('LPE',$page_editor_html);
358  }
359 
360  $tpl->fillCssFiles();
361  $tpl->fillJavaScriptFiles();
362 
363  $tpl->show("DEFAULT", false);
364  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
const AUTH_MODE_INACTIVE
const AUTH_USER_INACTIVE
$failure
const SESSION_CLOSE_CAPTCHA
showCodeForm($a_username=null, $a_form=null)
const AUTH_USER_WRONG_IP
getLoginPageEditorHTML()
Get HTML of ILIAS login page editor.
showOpenIdLoginForm($page_editor_html)
Show openid login if enabled.
$_GET["client_id"]
const SESSION_CLOSE_INACTIVE
showShibbolethLoginForm($page_editor_html)
Show shibboleth login form.
const AUTH_CAPTCHA_INVALID
$_COOKIE["ilClientId"]
Definition: cron.php:11
const AUTH_RADIUS_NO_ILIAS_USER
const SESSION_CLOSE_TIME
static set($a_var, $a_val)
Set a value.
const AUTH_CAS_NO_ILIAS_USER
const AUTH_USER_TIME_LIMIT_EXCEEDED
Class ShibbolethWAYF.
global $tpl
Definition: ilias.php:8
const AUTH_APACHE_FAILED
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
$success
Definition: Utf8Test.php:87
const AUTH_SOAP_NO_ILIAS_USER
purgePlaceholders($page_editor_html)
Purge page editor html from unused placeholders.
showLoginForm($page_editor_html)
Show login form ilSetting $ilSetting.
showRegistrationLinks($page_editor_html)
Show registration, password forgotten, client slection links ilLanguage $lng ilSetting $ilSetting ...
const AUTH_USER_SIMULTANEOUS_LOGIN
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const AUTH_LDAP_NO_ILIAS_USER
const AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL
const SESSION_CLOSE_SIMUL
const AUTH_IDLED
Returned if session exceeds idle time.
Definition: Auth.php:30
showUserMappingSelection()
Show user selection screen, if external account could not be mapped to an ILIAS account, but the provided e-mail address is known.
static setClosingContext($a_context)
set closing context (for statistics)
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
showLoginInformation($page_editor_html)
Show login information.
const AUTH_WRONG_LOGIN
Returned if container is unable to authenticate user/password pair.
Definition: Auth.php:38
const AUTH_EXPIRED
Returned if session has expired.
Definition: Auth.php:34
static redirect($a_script)
http redirect to other script
showCASLoginForm($page_editor_html)
Show cas login ilSetting $ilSetting.
const SESSION_CLOSE_IP
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginForm()

ilStartUpGUI::showLoginForm (   $page_editor_html)
protected

Show login form ilSetting $ilSetting.

Parameters
string$page_editor_html

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

References $ilSetting, $lng, $tpl, ilAuthModeDetermination\_getInstance(), ilAuthUtils\_getMultipleAuthModeOptions(), ilAuthUtils\_hasMultipleAuthenticationMethods(), AUTH_CAS, AUTH_SHIBBOLETH, ilFormPropertyGUI\setRequired(), ilPasswordInputGUI\setRetype(), ilTextInputGUI\setSize(), and substituteLoginPageElements().

Referenced by showLogin().

499  {
500  global $ilSetting,$lng,$tpl;
501 
502  // @todo move this to auth utils.
503  // login via ILIAS (this also includes radius and ldap)
504  // If local authentication is enabled for shibboleth users, we
505  // display the login form for ILIAS here.
506  if (($ilSetting->get("auth_mode") != AUTH_SHIBBOLETH ||
507  $ilSetting->get("shib_auth_allow_local")) &&
508  $ilSetting->get("auth_mode") != AUTH_CAS)
509  {
510  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
511  $form = new ilPropertyFormGUI();
512  //$form->setTableWidth('500');
513  $form->setFormAction($this->ctrl->getFormAction($this,''));
514  $form->setName("formlogin");
515  $form->setShowTopButtons(false);
516  $form->setTitle($lng->txt("login_to_ilias"));
517 
518  // auth selection
519  include_once('./Services/Authentication/classes/class.ilAuthModeDetermination.php');
521  if(ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection())
522  {
523  $visible_auth_methods = array();
524  $radg = new ilRadioGroupInputGUI($lng->txt("auth_selection"), "auth_mode");
525  foreach(ilAuthUtils::_getMultipleAuthModeOptions($lng) as $key => $option)
526  {
527  if(isset($option['hide_in_ui']) && $option['hide_in_ui'])
528  {
529  continue;
530  }
531 
532  $op1 = new ilRadioOption($option['txt'], $key);
533  $radg->addOption($op1);
534  if (isset($option['checked']))
535  {
536  $radg->setValue($key);
537  }
538  $visible_auth_methods[] = $op1;
539  }
540 
541  if(count($visible_auth_methods) == 1)
542  {
543  $first_auth_method = current($visible_auth_methods);
544  $hidden_auth_method = new ilHiddenInputGUI("auth_mode");
545  $hidden_auth_method->setValue($first_auth_method->getValue());
546  $form->addItem($hidden_auth_method);
547  }
548  else
549  {
550  $form->addItem($radg);
551  }
552  }
553 
554  $ti = new ilTextInputGUI($lng->txt("username"), "username");
555  $ti->setSize(20);
556  $ti->setRequired(true);
557  $form->addItem($ti);
558 
559  $pi = new ilPasswordInputGUI($lng->txt("password"), "password");
560  $pi->setRetype(false);
561  $pi->setSize(20);
562  $pi->setDisableHtmlAutoComplete(false);
563  $pi->setRequired(true);
564  $form->addItem($pi);
565  $form->addCommandButton("showLogin", $lng->txt("log_in"));
566 
567  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
568  if(ilCaptchaUtil::isActiveForLogin())
569  {
570  require_once 'Services/Captcha/classes/class.ilCaptchaInputGUI.php';
571  $captcha = new ilCaptchaInputGUI($lng->txt('captcha_code'), 'captcha_code');
572  $captcha->setRequired(true);
573  $form->addItem($captcha);
574  }
575 
576  return $this->substituteLoginPageElements(
577  $tpl,
578  $page_editor_html,
579  $form->getHTML(),
580  '[list-login-form]',
581  'LOGIN_FORM'
582  );
583 
584  }
585  return $page_editor_html;
586  }
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.
const AUTH_CAS
const AUTH_SHIBBOLETH
setRetype($a_val)
Set retype on/off.
global $tpl
Definition: ilias.php:8
This class represents a hidden form property in a property form.
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
This class represents a property in a property form.
static _getMultipleAuthModeOptions($lng)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
This class represents a password property in a property form.
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLoginInformation()

ilStartUpGUI::showLoginInformation (   $page_editor_html)
protected

Show login information.

Parameters
string$page_editor_html
Returns
string $page_editor_html

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

References $lng, and $tpl.

Referenced by showLogin().

594  {
595  global $lng,$tpl;
596 
597  if(strlen($page_editor_html))
598  {
599  // page editor active return
600  return $page_editor_html;
601  }
602 
603  $loginSettings = new ilSetting("login_settings");
604  $information = $loginSettings->get("login_message_".$lng->getLangKey());
605 
606  if(strlen(trim($information)))
607  {
608  $tpl->setVariable("TXT_LOGIN_INFORMATION", $information);
609  }
610  return $page_editor_html;
611  }
ILIAS Setting Class.
global $tpl
Definition: ilias.php:8
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ showLogout()

ilStartUpGUI::showLogout ( )

show logout screen

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

References $_COOKIE, $client_id, $ilIliasIniFile, $ilSetting, $lng, $tpl, ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), and ilUtil\setCookie().

1100  {
1101  global $tpl, $ilSetting, $ilAuth, $lng, $ilIliasIniFile;
1102 
1104  $ilAuth->logout();
1105  session_destroy();
1106 
1107  // reset cookie
1108  $client_id = $_COOKIE["ilClientId"];
1109  ilUtil::setCookie("ilClientId","");
1110 
1111  //instantiate logout template
1112  self::initStartUpTemplate("tpl.logout.html");
1113 
1114  if ($ilSetting->get("pub_section"))
1115  {
1116  $tpl->setCurrentBlock("homelink");
1117  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$lng->getLangKey());
1118  $tpl->setVariable("TXT_HOME",$lng->txt("home"));
1119  $tpl->parseCurrentBlock();
1120  }
1121 
1122  if ($ilIliasIniFile->readVariable("clients","list"))
1123  {
1124  $tpl->setCurrentBlock("client_list");
1125  $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
1126  $this->ctrl->setParameter($this, "client_id", $client_id);
1127  $tpl->setVariable("CMD_CLIENT_LIST",
1128  $this->ctrl->getLinkTarget($this, "showClientList"));
1129  $tpl->parseCurrentBlock();
1130  $this->ctrl->setParameter($this, "client_id", "");
1131  }
1132 
1133  $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout"));
1134  $tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text"));
1135  $tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
1136  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$lng->getLangKey());
1137 
1138  $tpl->show();
1139  }
$_COOKIE["ilClientId"]
Definition: cron.php:11
global $tpl
Definition: ilias.php:8
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
const SESSION_CLOSE_USER
global $ilIliasIniFile
static setClosingContext($a_context)
set closing context (for statistics)
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
$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 1321 of file class.ilStartUpGUI.php.

References $tpl.

1322  {
1323  global $tpl;
1324 
1325  $str = "<p style=\"margin:15px;\">
1326  You need to enable Session Cookies in your Browser to use ILIAS.
1327  <br/>
1328  <br/><b>Firefox</b>
1329  <br/>Tools -> Options -> Privacy -> Cookies
1330  <br/>Enable 'Allow sites to set cookies' and activate option 'Keep
1331  <br/>cookies' auf 'until I close Firefox'
1332  <br/>
1333  <br/><b>Mozilla/Netscape</b>
1334  <br/>Edit -> Preferences -> Privacy&Security -> Cookies
1335  <br/>Go to 'Cookie Lifetime Policy' and check option 'Accept for current
1336  <br/>session only'.
1337  <br/>
1338  <br/><b>Internet Explorer</b>
1339  <br/>Tools -> Internet Options -> Privacy -> Advanced
1340  <br/>- Check 'Override automatic cookie handling'
1341  <br/>- Check 'Always allow session cookies'
1342  </p>";
1343  $tpl->setVariable("CONTENT", $str);
1344  $tpl->show();
1345  }
global $tpl
Definition: ilias.php:8

◆ showOpenIdLoginForm()

ilStartUpGUI::showOpenIdLoginForm (   $page_editor_html)
protected

Show openid login if enabled.

Returns

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

References $_COOKIE, $ilCtrl, $ilSetting, $lng, $tpl, ilUtil\getImagePath(), ilOpenIdProviders\getInstance(), ilOpenIdSettings\getInstance(), ilUIFramework\init(), iljQueryUtil\initjQuery(), ilSelectInputGUI\setOptions(), ilTextInputGUI\setSize(), and substituteLoginPageElements().

Referenced by showLogin().

1817  {
1818  global $lng,$tpl;
1819 
1820  include_once './Services/OpenId/classes/class.ilOpenIdSettings.php';
1821  if(!ilOpenIdSettings::getInstance()->isActive())
1822  {
1823  return $page_editor_html;
1824  }
1825 
1826  $lng->loadLanguageModule('auth');
1827 
1828  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1829  $form = new ilPropertyFormGUI();
1830  //$form->setTableWidth('500');
1831  $form->setShowTopButtons(false);
1832  $form->setFormAction($this->ctrl->getFormAction($this));
1833  $form->setTitle($lng->txt('login_to_ilias_via_openid'));
1834 
1835  $openid = new ilTextInputGUI($lng->txt('auth_openid_login'),'oid_username');
1836  $openid->setSize(18);
1837  $openid->setMaxLength(255);
1838  $openid->setRequired(true);
1839  $openid->setCssClass('ilOpenIDBox');
1840  $openid->setInfo($lng->txt('auth_openid_login_info_a'));
1841  $form->addItem($openid);
1842 
1843  include_once './Services/OpenId/classes/class.ilOpenIdProviders.php';
1844  $pro = new ilSelectInputGUI($lng->txt('auth_openid_provider'),'oid_provider');
1845  $pro->setOptions(ilOpenIdProviders::getInstance()->getProviderSelection());
1846  $pro->setValue(ilOpenIdProviders::getInstance()->getSelectedProvider());
1847  $form->addItem($pro);
1848  $form->addCommandButton("showLogin", $lng->txt("log_in"));
1849 
1850  return $this->substituteLoginPageElements(
1851  $tpl,
1852  $page_editor_html,
1853  $form->getHTML(),
1854  '[list-openid-login-form]',
1855  'OID_LOGIN_FORM'
1856  );
1857  }
static getInstance()
Get singleton instance.
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $tpl
Definition: ilias.php:8
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
static getInstance()
Get singleton instance.
global $lng
Definition: privfeed.php:40
+ 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 784 of file class.ilStartUpGUI.php.

References $_COOKIE, $GLOBALS, $ilIliasIniFile, $ilSetting, $lng, ilRegistrationSettings\_lookupRegistrationType(), ilTermsOfServiceSignableDocumentFactory\getByLanguageObject(), IL_REG_DISABLED, and substituteLoginPageElements().

Referenced by showLogin().

785  {
786  global $lng, $ilSetting, $ilIliasIniFile, $ilAccess;
787 
788  $rtpl = new ilTemplate('tpl.login_registration_links.html',true,true,'Services/Init');
789 
790  // allow new registrations?
791  include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
793  {
794  $rtpl->setCurrentBlock("new_registration");
795  $rtpl->setVariable("REGISTER", $lng->txt("registration"));
796  $rtpl->setVariable("CMD_REGISTER",
797  $this->ctrl->getLinkTargetByClass("ilaccountregistrationgui", ""));
798  $rtpl->parseCurrentBlock();
799  }
800  // allow password assistance? Surpress option if Authmode is not local database
801  if ($ilSetting->get("password_assistance"))
802  {
803  $rtpl->setCurrentBlock("password_assistance");
804  $rtpl->setVariable("FORGOT_PASSWORD", $lng->txt("forgot_password"));
805  $rtpl->setVariable("FORGOT_USERNAME", $lng->txt("forgot_username"));
806  $rtpl->setVariable("CMD_FORGOT_PASSWORD",
807  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", ""));
808  $rtpl->setVariable("CMD_FORGOT_USERNAME",
809  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "showUsernameAssistanceForm"));
810  $rtpl->setVariable("LANG_ID", $lng->getLangKey());
811  $rtpl->parseCurrentBlock();
812  }
813 
814  if ($ilSetting->get("pub_section") &&
815  $ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, "read", "", ROOT_FOLDER_ID))
816  {
817  $rtpl->setCurrentBlock("homelink");
818  $rtpl->setVariable("CLIENT_ID","?client_id=".$_COOKIE["ilClientId"]."&lang=".$lng->getLangKey());
819  $rtpl->setVariable("TXT_HOME",$lng->txt("home"));
820  $rtpl->parseCurrentBlock();
821  }
822 
823  if ($ilIliasIniFile->readVariable("clients","list"))
824  {
825  $rtpl->setCurrentBlock("client_list");
826  $rtpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
827  $rtpl->setVariable("CMD_CLIENT_LIST",$this->ctrl->getLinkTarget($this, "showClientList"));
828  $rtpl->parseCurrentBlock();
829  }
830 
831  return $this->substituteLoginPageElements(
832  $GLOBALS['tpl'],
833  $page_editor_html,
834  $rtpl->get(),
835  '[list-registration-link]',
836  'REG_PWD_CLIENT_LINKS'
837  );
838  }
$_COOKIE["ilClientId"]
Definition: cron.php:11
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
$GLOBALS['ct_recipient']
special template class to simplify handling of ITX/PEAR
global $ilIliasIniFile
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
+ 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 651 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

652  {
653  global $ilSetting, $lng;
654 
655  // Refactoring with ilFormPropertyGUI
656  // [...]
657 
658  // shibboleth login link
659  if ($ilSetting->get("shib_active")) {
660  $tpl = new ilTemplate('tpl.login_form_shibboleth.html', true, true, 'Services/Init');
661 
662  $tpl->setVariable('SHIB_FORMACTION', './shib_login.php'); // Bugfix http://ilias.de/mantis/view.php?id=10662 {$tpl->setVariable('SHIB_FORMACTION', $this->ctrl->getFormAction($this));}
663 
664  if ($ilSetting->get("shib_hos_type") == 'external_wayf') {
665  $tpl->setCurrentBlock("shibboleth_login");
666  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
667  $tpl->setVariable("IL_TARGET", $_GET["target"]);
668  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
669  $tpl->setVariable("TXT_SHIB_LOGIN_BUTTON", $ilSetting->get("shib_login_button"));
670  $tpl->setVariable("TXT_SHIB_LOGIN_INSTRUCTIONS", sprintf($lng->txt("shib_general_login_instructions"), $ilSetting->get("shib_federation_name")) . ' <a href="mailto:' . $ilSetting->get("admin_email") . '">ILIAS ' . $lng->txt("administrator") . '</a>.');
671  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
672  $tpl->parseCurrentBlock();
673  } elseif ($ilSetting->get("shib_hos_type") == 'embedded_wayf') {
674  $tpl->setCurrentBlock("shibboleth_custom_login");
675  $customInstructions = stripslashes($ilSetting->get("shib_login_instructions"));
676  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $customInstructions);
677  $tpl->parseCurrentBlock();
678  } else {
679  $tpl->setCurrentBlock("shibboleth_wayf_login");
680  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
681  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
682  $tpl->setVariable("TXT_SELECT_HOME_ORGANIZATION", sprintf($lng->txt("shib_select_home_organization"), $ilSetting->get("shib_federation_name")));
683  $tpl->setVariable("TXT_CONTINUE", $lng->txt("btn_next"));
684  $tpl->setVariable("TXT_SHIB_HOME_ORGANIZATION", $lng->txt("shib_home_organization"));
685  $tpl->setVariable("TXT_SHIB_LOGIN_INSTRUCTIONS", $lng->txt("shib_general_wayf_login_instructions") . ' <a href="mailto:' . $ilSetting->get("admin_email") . '">ILIAS ' . $lng->txt("administrator") . '</a>.');
686  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
687 
688  require_once "./Services/AuthShibboleth/classes/class.ilShibbolethWAYF.php";
689  $WAYF = new ShibWAYF();
690 
691  $tpl->setVariable("TXT_SHIB_INVALID_SELECTION", $WAYF->showNotice());
692  $tpl->setVariable("SHIB_IDP_LIST", $WAYF->generateSelection());
693  $tpl->setVariable("ILW_TARGET", $_GET["target"]);
694  $tpl->parseCurrentBlock();
695  }
696 
697  return $this->substituteLoginPageElements($GLOBALS['tpl'], $page_editor_html, $tpl->get(), '[list-shibboleth-login-form]', 'SHIB_LOGIN_FORM');
698  }
699 
700  return $page_editor_html;
701  }
$_GET["client_id"]
Class ShibbolethWAYF.
global $tpl
Definition: ilias.php:8
substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
Substitute login page elements.
$GLOBALS['ct_recipient']
special template class to simplify handling of ITX/PEAR
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUserMappingSelection()

ilStartUpGUI::showUserMappingSelection ( )

Show user selection screen, if external account could not be mapped to an ILIAS account, but the provided e-mail address is known.

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

References $_GET, $_POST, $lng, $tpl, $valid, ilObjUser\_getLocalAccountsForEmail(), AUTH_WRONG_LOGIN, ilUtil\prepareFormOutput(), and ilUtil\sendFailure().

Referenced by showLogin().

1146  {
1147  global $ilAuth, $tpl, $lng;
1148 
1149  $valid = $ilAuth->getValidationData();
1150 
1151  self::initStartUpTemplate("tpl.user_mapping_selection.html");
1152  $email_user = ilObjUser::_getLocalAccountsForEmail($valid["email"]);
1153 
1154 
1155  if ($ilAuth->getSubStatus() == AUTH_WRONG_LOGIN)
1156  {
1157  ilUtil::sendFailure($lng->txt("err_wrong_login"));
1158  }
1159 
1160  include_once('./Services/User/classes/class.ilObjUser.php');
1161  if (count($email_user) == 1)
1162  {
1163  //$user = new ilObjUser(key($email_user));
1164  $tpl->setCurrentBlock("one_user");
1165  $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
1166  $tpl->setVariable("VAL_USERNAME", current($email_user));
1167  $tpl->setVariable("USER_ID", key($email_user));
1168  $tpl->parseCurrentBlock();
1169  }
1170  else
1171  {
1172  foreach($email_user as $key => $login)
1173  {
1174  $tpl->setCurrentBlock("user");
1175  $tpl->setVariable("USR_ID", $key);
1176  $tpl->setVariable("VAL_USER", $login);
1177  $tpl->parseCurrentBlock();
1178  }
1179  $tpl->setCurrentBlock("multpiple_user");
1180  $tpl->parseCurrentBlock();
1181  }
1182 
1183  $tpl->setCurrentBlock("content");
1184  $this->ctrl->setParameter($this, "ext_uid", urlencode($_GET["ext_uid"]));
1185  $this->ctrl->setParameter($this, "soap_pw", urlencode($_GET["soap_pw"]));
1186  $this->ctrl->setParameter($this, "auth_stat", $_GET["auth_stat"]);
1187  $tpl->setVariable("FORMACTION",
1188  $this->ctrl->getFormAction($this));
1189  $tpl->setVariable("TXT_ILIAS_LOGIN", $lng->txt("login_to_ilias"));
1190  if (count($email_user) == 1)
1191  {
1192  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation"));
1193  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_2"));
1194  }
1195  else
1196  {
1197  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation_3"));
1198  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_4"));
1199  }
1200  $tpl->setVariable("TXT_CREATE_USER", $lng->txt("ums_create_new_account"));
1201  $tpl->setVariable("TXT_PASSWORD", $lng->txt("password"));
1202  $tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST["password"]));
1203  $tpl->setVariable("TXT_SUBMIT", $lng->txt("login"));
1204 
1205  $tpl->show();
1206  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
_getLocalAccountsForEmail($a_email)
check whether external account and authentication method matches with a user
$_GET["client_id"]
$valid
global $tpl
Definition: ilias.php:8
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:40
const AUTH_WRONG_LOGIN
Returned if container is unable to authenticate user/password pair.
Definition: Auth.php:38
+ 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 713 of file class.ilStartUpGUI.php.

References $tpl.

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

714  {
715  if(!strlen($page_editor_html))
716  {
717  $tpl->setVariable($fallback_tplvar,$element_html);
718  return $page_editor_html;
719  }
720  // Try to replace placeholders
721  if(!stristr($page_editor_html, $placeholder))
722  {
723  $tpl->setVariable($fallback_tplvar,$element_html);
724  return $page_editor_html;
725  }
726  return str_replace($placeholder, $element_html, $page_editor_html);
727  }
global $tpl
Definition: ilias.php:8
+ Here is the caller graph for this function:

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