ILIAS  release_4-4 Revision
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...
 
 showLanguageSelection ($page_editor_html)
 Show language selection ilTemplate $tpl. 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...
 

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

1570  {
1571  global $objDefinition, $ilPluginAdmin, $ilUser;
1572 
1573  if (is_object($ilPluginAdmin))
1574  {
1575  // get user interface plugins
1576  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1577 
1578  // search
1579  foreach ($pl_names as $pl)
1580  {
1581  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1582  $gui_class = $ui_plugin->getUIClassInstance();
1583  $resp = $gui_class->checkGotoHook($a_target);
1584  if ($resp["target"] !== false)
1585  {
1586  $a_target = $resp["target"];
1587  break;
1588  }
1589  }
1590  }
1591 
1592  if ($a_target == "")
1593  {
1594  return false;
1595  }
1596 
1597  $t_arr = explode("_", $a_target);
1598  $type = $t_arr[0];
1599 
1600  if ($type == "git")
1601  {
1602  $type = "glo";
1603  }
1604 
1605  if ($type == "pg" | $type == "st")
1606  {
1607  $type = "lm";
1608  }
1609 
1610  $class = $objDefinition->getClassName($type);
1611  if ($class == "")
1612  {
1613  return false;
1614  }
1615 
1616  $location = $objDefinition->getLocation($type);
1617  $full_class = "ilObj".$class."Access";
1618  include_once($location."/class.".$full_class.".php");
1619 
1620  $ret = call_user_func(array($full_class, "_checkGoto"), $a_target);
1621 
1622  // if no access and repository object => check for parent course/group
1623  if(!$ret &&
1624  !stristr($a_target, "_wsp") &&
1625  $ilUser->getId() != ANONYMOUS_USER_ID && // #10637
1626  !$objDefinition->isAdministrationObject($type) &&
1627  $objDefinition->isRBACObject($type) &&
1628  $t_arr[1])
1629  {
1630  global $tree, $rbacsystem, $ilAccess;
1631 
1632  // original type "pg" => pg_<page_id>[_<ref_id>]
1633  if($t_arr[0] == "pg")
1634  {
1635  if(isset($t_arr[2]))
1636  {
1637  $ref_id = $t_arr[2];
1638  }
1639  else
1640  {
1641  $lm_id = ilLMObject::_lookupContObjID($t_arr[1]);
1643  if($ref_id)
1644  {
1645  $ref_id = array_shift($ref_id);
1646  }
1647  }
1648  }
1649  else
1650  {
1651  $ref_id = $t_arr[1];
1652  }
1653 
1654  include_once "Services/Membership/classes/class.ilParticipants.php";
1655  $block_obj = array();
1656 
1657  // walk path to find parent container
1658  $path = $tree->getPathId($ref_id);
1659  array_pop($path);
1660  foreach($path as $path_ref_id)
1661  {
1662  $redirect_infopage = false;
1663  $add_member_role = false;
1664 
1665  $ptype = ilObject::_lookupType($path_ref_id, true);
1666  $pobj_id = ilObject::_lookupObjId($path_ref_id);
1667 
1668  // core checks: timings/object-specific
1669  if(!$ilAccess->doActivationCheck("read", "", $path_ref_id, $ilUser->getId(), $pobj_id, $ptype) ||
1670  !$ilAccess->doStatusCheck("read", "", $path_ref_id, $ilUser->getId(), $pobj_id, $ptype))
1671  {
1672  // object in path is inaccessible - aborting
1673  return false;
1674  }
1675  else if($ptype == "crs")
1676  {
1677  // check if already participant
1678  include_once "Modules/Course/classes/class.ilCourseParticipant.php";
1679  $participants = new ilCourseParticipant($pobj_id, $ilUser->getId());
1680  if(!$participants->isAssigned())
1681  {
1682  // subscription currently possible?
1683  include_once "Modules/Course/classes/class.ilObjCourse.php";
1684  if(ilObjCourse::_isActivated($pobj_id) &&
1686  {
1687  $block_obj[] = $path_ref_id;
1688  $add_member_role = true;
1689  }
1690  else
1691  {
1692  $redirect_infopage = true;
1693  }
1694  }
1695  }
1696  else if($ptype == "grp")
1697  {
1698  // check if already participant
1699  include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1700  if(!ilGroupParticipants::_isParticipant($path_ref_id, $ilUser->getId()))
1701  {
1702  // subscription currently possible?
1703  include_once "Modules/Group/classes/class.ilObjGroup.php";
1704  $group_obj = new ilObjGroup($path_ref_id);
1705  if($group_obj->isRegistrationEnabled())
1706  {
1707  $block_obj[] = $path_ref_id;
1708  $add_member_role = true;
1709  }
1710  else
1711  {
1712  $redirect_infopage = true;
1713  }
1714  }
1715  }
1716 
1717  // add members roles for all "blocking" objects
1718  if($add_member_role)
1719  {
1720  // cannot join? goto will never work, so redirect to current object
1721  $rbacsystem->resetPACache($ilUser->getId(), $path_ref_id);
1722  if(!$rbacsystem->checkAccess("join", $path_ref_id))
1723  {
1724  $redirect_infopage = true;
1725  }
1726  else
1727  {
1728  $rbacsystem->addTemporaryRole($ilUser->getId(),
1729  ilParticipants::getDefaultMemberRole($path_ref_id));
1730  }
1731  }
1732 
1733  // redirect to infopage of 1st blocking object in path
1734  if($redirect_infopage)
1735  {
1736  if($rbacsystem->checkAccess("visible", $path_ref_id))
1737  {
1738  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI".
1739  "&ref_id=".$path_ref_id."&cmd=infoScreen");
1740  }
1741  else
1742  {
1743  return false;
1744  }
1745  }
1746  }
1747 
1748  // check if access will be possible with all (possible) member roles added
1749  $rbacsystem->resetPACache($ilUser->getId(), $ref_id);
1750  if($rbacsystem->checkAccess("read", $ref_id) && sizeof($block_obj)) // #12128
1751  {
1752  // this won't work with lm-pages (see above)
1753  // include_once "Services/Link/classes/class.ilLink.php";
1754  // $_SESSION["pending_goto"] = ilLink::_getStaticLink($ref_id, $type);
1755 
1756  // keep original target
1757  $_SESSION["pending_goto"] = "goto.php?target=".$a_target;
1758 
1759  // redirect to 1st non-member object in path
1760  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI".
1761  "&ref_id=".array_shift($block_obj));
1762  }
1763  }
1764 
1765  return $ret;
1766  }
< 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 1768 of file class.ilStartUpGUI.php.

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

1769  {
1770  global $lng, $ilias, $ilLog;
1771 
1772  ilUtil::setCookie('iltest', 'cookie', false);
1773 
1774  if(!isset($_GET['rh']) || !strlen(trim($_GET['rh'])))
1775  {
1776  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_confirmation_hash_not_passed');
1777  }
1778 
1779  try
1780  {
1781  require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
1782  $oRegSettings = new ilRegistrationSettings();
1783 
1786  $oUser->setActive(true);
1787  if($oRegSettings->passwordGenerationEnabled())
1788  {
1789  $passwd = ilUtil::generatePasswords(1);
1790  $password = $passwd[0];
1791  $oUser->setPasswd($password, IL_PASSWD_PLAIN);
1792  $oUser->setLastPasswordChangeTS( time() );
1793  }
1794  $oUser->update();
1795 
1796  $usr_lang = $oUser->getPref('language');
1797 
1798  if($lng->getLangKey() != $usr_lang)
1799  {
1800  $lng = new ilLanguage($usr_lang);
1801  }
1802 
1803  // send email
1804  // try individual account mail in user administration
1805  include_once("Services/Mail/classes/class.ilAccountMail.php");
1806  include_once './Services/User/classes/class.ilObjUserFolder.php';
1807  $amail = ilObjUserFolder::_lookupNewAccountMail($usr_lang);
1808  if (trim($amail["body"]) != "" && trim($amail["subject"]) != "")
1809  {
1810  $acc_mail = new ilAccountMail();
1811  $acc_mail->setUser($oUser);
1812  if($oRegSettings->passwordGenerationEnabled())
1813  {
1814  $acc_mail->setUserPassword($password);
1815  }
1816  $acc_mail->send();
1817  }
1818  else // do default mail
1819  {
1820  include_once 'Services/Mail/classes/class.ilMail.php';
1821  $mail_obj = new ilMail(ANONYMOUS_USER_ID);
1822 
1823  // mail subject
1824  $subject = $lng->txt("reg_mail_subject");
1825 
1826  // mail body
1827  $body = $lng->txt("reg_mail_body_salutation")." ".$oUser->getFullname().",\n\n".
1828  $lng->txt("reg_mail_body_text1")."\n\n".
1829  $lng->txt("reg_mail_body_text2")."\n".
1830  ILIAS_HTTP_PATH."/login.php?client_id=".CLIENT_ID."\n";
1831  $body .= $lng->txt("login").": ".$oUser->getLogin()."\n";
1832 
1833  if($oRegSettings->passwordGenerationEnabled())
1834  {
1835  $body.= $lng->txt("passwd").": ".$password."\n";
1836  }
1837 
1838  $body.= "\n";
1839  $body.= $lng->txt('reg_mail_body_forgot_password_info')."\n";
1840 
1841  $body.= "\n";
1842 
1843  $body .= ($lng->txt("reg_mail_body_text3")."\n\r");
1844  $body .= $oUser->getProfileAsString($lng);
1845  $mail_obj->enableSoap(false);
1846  $mail_obj->appendInstallationSignature(true);
1847  $mail_obj->sendMail($oUser->getEmail(), '', '',
1848  $subject,
1849  $body,
1850  array(), array('normal'));
1851  }
1852 
1853  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_account_confirmation_successful&lang='.$usr_lang);
1854  }
1855  catch(ilRegConfirmationLinkExpiredException $exception)
1856  {
1857  include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
1858  $soap_client = new ilSoapClient();
1859  $soap_client->setResponseTimeout(1);
1860  $soap_client->enableWSDL(true);
1861  $soap_client->init();
1862 
1863  $ilLog->write(__METHOD__.': Triggered soap call (background process) for deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
1864 
1865  $soap_client->call
1866  (
1867  'deleteExpiredDualOptInUserObjects',
1868  array
1869  (
1870  $_COOKIE['PHPSESSID'].'::'.$_COOKIE['ilClientId'], // session id and client id, not used for checking access -> not possible for anonymous
1871  $exception->getCode() // user id
1872  )
1873  );
1874 
1875  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$exception->getMessage()."&lang=".$usr_lang);
1876  }
1877  catch(ilRegistrationHashNotFoundException $exception)
1878  {
1879  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$exception->getMessage()."&lang=".$usr_lang);
1880  }
1881  }
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 1391 of file class.ilStartUpGUI.php.

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

1392  {
1393  $this->showTermsOfService();
1394  }
+ 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 727 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

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

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

Referenced by processCode(), and showCodeForm().

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

1007  {
1008  global $lng,$ilClientIniFile,$ilLog,$rbacadmin;
1009 
1010  $lng->loadLanguageModule('auth');
1011 
1012  if(!isset($_POST['account_migration']))
1013  {
1014  $this->showAccountMigration($lng->txt('err_choose_migration_type'));
1015  return false;
1016  }
1017 
1018  if($_POST['account_migration'] == 1 and (!strlen($_POST['mig_username']) or !strlen($_POST['mig_password'])))
1019  {
1020  $this->showAccountMigration($lng->txt('err_wrong_login'));
1021  return false;
1022  }
1023 
1024  if($_POST['account_migration'] == 1)
1025  {
1026  if(!$user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST['mig_username'])))
1027  {
1028  $this->showAccountMigration($lng->txt('err_wrong_login'));
1029  return false;
1030  }
1031  $_POST['username'] = $_POST['mig_username'];
1032  $_POST['password'] = $_POST['mig_password'];
1033 
1034  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
1035  include_once './Services/Database/classes/class.ilAuthContainerMDB2.php';
1036 
1038  $ilAuth->start();
1039  if(!$ilAuth->checkAuth())
1040  {
1041  $ilAuth->logout();
1042  $this->showAccountMigration($lng->txt('err_wrong_login'));
1043  return false;
1044  }
1045 
1046  $user = new ilObjUser($user_id);
1047  $user->setAuthMode(ilSession::get('tmp_auth_mode'));
1048  $user->setExternalAccount(ilSession::get('tmp_external_account'));
1049  $user->setActive(true);
1050  $user->update();
1051 
1052  // Assign to default role
1053  if(is_array(ilSession::get('tmp_roles')))
1054  {
1055  foreach(ilSession::get('tmp_roles') as $role)
1056  {
1057  $rbacadmin->assignUser((int) $role,$user->getId());
1058  }
1059  }
1060 
1061  // Log migration
1062  $ilLog->write(__METHOD__.': Migrated '.ilSession::get('tmp_external_account').' to ILIAS account '.$user->getLogin().'.');
1063  }
1064  elseif($_POST['account_migration'] == 2)
1065  {
1066  switch(ilSession::get('tmp_auth_mode'))
1067  {
1068  case 'apache':
1069  $_POST['username'] = ilSession::get('tmp_external_account');
1070  $_POST['password'] = ilSession::get('tmp_pass');
1071 
1072  include_once('Services/AuthApache/classes/class.ilAuthContainerApache.php');
1073  $container = new ilAuthContainerApache();
1074  $container->forceCreation(true);
1075  $ilAuth = ilAuthFactory::factory($container);
1076  $ilAuth->start();
1077  break;
1078 
1079  case 'ldap':
1080  $_POST['username'] = ilSession::get('tmp_external_account');
1081  $_POST['password'] = ilSession::get('tmp_pass');
1082 
1083  include_once('Services/LDAP/classes/class.ilAuthContainerLDAP.php');
1084  $container = new ilAuthContainerLDAP();
1085  $container->forceCreation(true);
1086  $ilAuth = ilAuthFactory::factory($container);
1087  $ilAuth->start();
1088  break;
1089 
1090  case 'radius':
1091  $_POST['username'] = ilSession::get('tmp_external_account');
1092  $_POST['password'] = ilSession::get('tmp_pass');
1093 
1094  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
1095  include_once './Services/Radius/classes/class.ilAuthContainerRadius.php';
1096 
1097  $container = new ilAuthContainerRadius();
1098  $container->forceCreation(true);
1099  $ilAuth = ilAuthFactory::factory($container);
1100  $ilAuth->start();
1101  break;
1102 
1103  case 'openid':
1104  $_POST['username'] = ilSession::get('dummy');
1105  $_POST['password'] = ilSession::get('dummy');
1106  $_POST['oid_username'] = ilSession::get('tmp_oid_username');
1107  $_POST['oid_provider'] = ilSession::get('tmp_oid_provider');
1108  //ilSession::set('force_creation', true);
1109 
1110  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
1111  include_once './Services/OpenId/classes/class.ilAuthContainerOpenId.php';
1112 
1113  $container = new ilAuthContainerOpenId();
1114  $container->forceCreation(true);
1116  include_once './Services/OpenId/classes/class.ilAuthOpenId.php';
1117  $ilAuth = ilAuthFactory::factory($container);
1118 
1119  // logout first to initiate a new login session
1120  $ilAuth->logout();
1121  ilSession::_destroy(session_id());
1122  ilSession::set('force_creation', true);
1123  $ilAuth->start();
1124  }
1125  // Redirect to acceptance
1126  ilUtil::redirect("ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&target=".$_GET["target"]."&cmd=getAcceptance");
1127  }
1128  // show personal desktop
1129  ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
1130  }
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 411 of file class.ilStartUpGUI.php.

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

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

1488  {
1489  global $ilIliasIniFile, $ilAuth, $ilSetting;
1490 
1491  // display client selection list if enabled
1492  if (!isset($_GET["client_id"]) &&
1493  $_GET["cmd"] == "" &&
1494  $ilIliasIniFile->readVariable("clients","list"))
1495  {
1496  return $this->showClientList();
1497  }
1498 
1499  if($ilAuth->getAuth() && $ilAuth->getStatus() == "")
1500  {
1501  $this->processStartingPage();
1502  }
1503 
1504  //
1505  // index.php is called and public section is enabled
1506  //
1507  // && $ilAuth->status == -101 is important for soap auth (public section on + user mapping, alex)
1508  // $ilAuth->status -1 is given, if session ends (if public section -> jump to public section)
1509 
1510  if ($ilSetting->get("pub_section") && $_POST["sendLogin"] != "1"
1511  && ($ilAuth->getStatus() != -101 && $_GET["soap_pw"] == ""))
1512  {
1514  }
1515  else
1516  {
1517  // index.php is called and public section is disabled
1518  $this->showLogin();
1519  }
1520  }
$_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 925 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

926  {
927  return str_replace(
928  array(
929  '[list-language-selection] ',
930  '[list-registration-link]',
931  '[list-user-agreement]',
932  '[list-login-form]',
933  '[list-cas-login-form]',
934  '[list-shibboleth-login-form]',
935  '[list-openid-login-form]'
936  ),
937  array('','','','','','',''),
938  $page_editor_html
939  );
940  }
+ 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 613 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

614  {
615  global $ilSetting, $lng;
616 
617 
618  // cas login link
619  if ($ilSetting->get("cas_active"))
620  {
621  $tpl = new ilTemplate('tpl.login_form_cas.html', true, true, 'Services/Init');
622  $tpl->setVariable("TXT_CAS_LOGIN", $lng->txt("login_to_ilias_via_cas"));
623  $tpl->setVariable("TXT_CAS_LOGIN_BUTTON", ilUtil::getImagePath("cas_login_button.png"));
624  $tpl->setVariable("TXT_CAS_LOGIN_INSTRUCTIONS", $ilSetting->get("cas_login_instructions"));
625  $this->ctrl->setParameter($this, "forceCASLogin", "1");
626  $tpl->setVariable("TARGET_CAS_LOGIN",$this->ctrl->getLinkTarget($this, "showLogin"));
627  $this->ctrl->setParameter($this, "forceCASLogin", "");
628 
629  return $this->substituteLoginPageElements(
630  $GLOBALS['tpl'],
631  $page_editor_html,
632  $tpl->get(),
633  '[list-cas-login-form]',
634  'CAS_LOGIN_FORM'
635  );
636  }
637  return $page_editor_html;
638  }
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
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 1247 of file class.ilStartUpGUI.php.

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

Referenced by processIndexPHP().

1248  {
1249  global $tpl, $ilIliasIniFile, $ilCtrl;
1250 //echo "1";
1251  if (!$ilIliasIniFile->readVariable("clients","list"))
1252  {
1253  $this->processIndexPHP();
1254  return;
1255  }
1256 //echo "2";
1257  $tpl = new ilTemplate("tpl.main.html", true, true);
1258  $tpl->setAddFooter(false); // no client yet
1259 
1260  // to do: get standard style
1261  $tpl->setVariable("PAGETITLE","Client List");
1262  $tpl->setVariable("LOCATION_STYLESHEET","./templates/default/delos.css");
1263 
1264  // load client list template
1265  self::initStartUpTemplate("tpl.client_list.html");
1266 
1267  // load template for table
1268  $tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html");
1269 
1270  // load template for table content data
1271  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
1272 
1273  // load table content data
1274  require_once("setup/classes/class.ilClientList.php");
1275  require_once("setup/classes/class.ilClient.php");
1276  require_once("setup/classes/class.ilDBConnections.php");
1277  require_once("./Services/Table/classes/class.ilTableGUI.php");
1278  $this->db_connections = new ilDBConnections();
1279  $clientlist = new ilClientList($this->db_connections);
1280  $list = $clientlist->getClients();
1281 
1282  if (count($list) == 0)
1283  {
1284  header("Location: ./setup/setup.php");
1285  exit();
1286  }
1287 
1288  $hasPublicSection = false;
1289  foreach ($list as $key => $client)
1290  {
1291  $client->setDSN();
1292 
1293  if ($client->checkDatabaseExists(true) and $client->ini->readVariable("client","access") and $client->getSetting("setup_ok"))
1294  {
1295  $this->ctrl->setParameter($this, "client_id", $key);
1296  $tmp = array();
1297  $tmp[] = $client->getName();
1298  $tmp[] = "<a href=\""."login.php?cmd=force_login&client_id=".urlencode($key)."\">Login page</a>";
1299 
1300  if($client->getSetting('pub_section'))
1301  {
1302  $hasPublicSection = true;
1303  $tmp[] = "<a href=\"" . "ilias.php?baseClass=ilRepositoryGUI&client_id=" . urlencode($key) . "\">Start page</a>";
1304  }
1305  else
1306  {
1307  $tmp[] = '';
1308  }
1309 
1310  $data[] = $tmp;
1311  }
1312  }
1313 
1314  // create table
1315  $tbl = new ilTableGUI();
1316 
1317  // title & header columns
1318  if($hasPublicSection)
1319  {
1320  $tbl->setTitle("Available Clients");
1321  $tbl->setHeaderNames(array("Installation Name","Login","Public Access"));
1322  $tbl->setHeaderVars(array("name","index","login"));
1323  $tbl->setColumnWidth(array("50%","25%","25%"));
1324  }
1325  else
1326  {
1327  $tbl->setTitle("Available Clients");
1328  $tbl->setHeaderNames(array("Installation Name","Login",''));
1329  $tbl->setHeaderVars(array("name","login",''));
1330  $tbl->setColumnWidth(array("70%","25%",'1px'));
1331  }
1332 
1333  // control
1334  $tbl->setOrderColumn($_GET["sort_by"],"name");
1335  $tbl->setOrderDirection($_GET["sort_order"]);
1336  $tbl->setLimit($_GET["limit"]);
1337  $tbl->setOffset($_GET["offset"]);
1338 
1339  // content
1340  $tbl->setData($data);
1341 
1342  // footer
1343  $tbl->setFooter("tblfooter");
1344 
1345  // styles
1346  $tbl->setStyle("table","std");
1347 
1348  $tbl->disable("icon");
1349  $tbl->disable("numinfo");
1350  $tbl->disable("sort");
1351 
1352  // render table
1353  $tbl->render();
1354  $tpl->show("DEFAULT", true, true);
1355  }
exit
Definition: login.php:54
Administrates DB connections in setup.
$_GET["client_id"]
Class ilTableGUI.
processIndexPHP()
process index.php
global $ilCtrl
Definition: ilias.php:18
client management
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilIliasIniFile
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ 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 367 of file class.ilStartUpGUI.php.

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

Referenced by processCode(), and showLogin().

368  {
369  global $tpl, $lng;
370 
371  self::initStartUpTemplate("tpl.login_reactivate_code.html");
372 
373  ilUtil::sendFailure($lng->txt("time_limit_reached"));
374 
375  if(!$a_form)
376  {
377  $a_form = $this->initCodeForm($a_username);
378  }
379 
380  $tpl->setVariable("FORM", $a_form->getHTML());
381  $tpl->show("DEFAULT", false);
382  }
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.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLanguageSelection()

ilStartUpGUI::showLanguageSelection (   $page_editor_html)
protected

Show language selection ilTemplate $tpl.

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

References $GLOBALS, $lng, ilLanguage\_lookupEntry(), and substituteLoginPageElements().

Referenced by showLogin().

775  {
776  global $lng;
777 
778  $languages = $lng->getInstalledLanguages();
779  if(count($languages) <= 1)
780  {
781  return $page_editor_html;
782  }
783 
784  $ltpl = new ilTemplate('tpl.login_form_lang_selection.html',true,true,'Services/Init');
785  foreach ($languages as $lang_key)
786  {
787  $ltpl->setCurrentBlock("languages");
788  $ltpl->setVariable("LANG_KEY", $lang_key);
789  $ltpl->setVariable("LANG_NAME",
790  ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_".$lang_key));
791  $ltpl->setVariable("BORDER", 0);
792  $ltpl->setVariable("VSPACE", 0);
793  $ltpl->parseCurrentBlock();
794  }
795  $ltpl->setCurrentBlock('lang_selection');
796  $ltpl->setVariable("TXT_OK", $lng->txt("ok"));
797  $ltpl->setVariable("LANG_FORM_ACTION",$this->ctrl->getFormAction($this));
798  $ltpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
799  $ltpl->setVariable("LANG_ID", $lng->getLangKey());
800  $ltpl->parseCurrentBlock();
801 
802  return $this->substituteLoginPageElements(
803  $GLOBALS['tpl'],
804  $page_editor_html,
805  $ltpl->get(),
806  '[list-language-selection]',
807  'LANG_SELECTION'
808  );
809 
810  }
_lookupEntry($a_lang_key, $a_mod, $a_id)
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 $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(), showLanguageSelection(), 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->showLanguageSelection($page_editor_html);
335  $page_editor_html = $this->showRegistrationLinks($page_editor_html);
336  $page_editor_html = $this->showTermsOfServiceLink($page_editor_html);
337 
338  $page_editor_html = $this->purgePlaceholders($page_editor_html);
339 
340 
341 
342  // not controlled by login page editor
343 
344  $tpl->setVariable("PAGETITLE", $lng->txt("startpage"));
345  $tpl->setVariable("ILIAS_RELEASE", $ilSetting->get("ilias_version"));
346 
347  $this->ctrl->setTargetScript("ilias.php");
348  $tpl->setVariable("PHP_SELF", $_SERVER['PHP_SELF']);
349 
350  // browser does not accept cookies
351  if (isset($_GET['cookies']) && $_GET['cookies'] == 'nocookies')
352  {
353  ilUtil::sendFailure($lng->txt("err_no_cookies"));
354  }
355 
356  if(strlen($page_editor_html))
357  {
358  $tpl->setVariable('LPE',$page_editor_html);
359  }
360 
361  $tpl->fillCssFiles();
362  $tpl->fillJavaScriptFiles();
363 
364  $tpl->show("DEFAULT", false);
365  }
< 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.
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 ...
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
showLanguageSelection($page_editor_html)
Show language selection ilTemplate $tpl.
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 492 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().

493  {
494  global $ilSetting,$lng,$tpl;
495 
496  // @todo move this to auth utils.
497  // login via ILIAS (this also includes radius and ldap)
498  // If local authentication is enabled for shibboleth users, we
499  // display the login form for ILIAS here.
500  if (($ilSetting->get("auth_mode") != AUTH_SHIBBOLETH ||
501  $ilSetting->get("shib_auth_allow_local")) &&
502  $ilSetting->get("auth_mode") != AUTH_CAS)
503  {
504  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
505  $form = new ilPropertyFormGUI();
506  //$form->setTableWidth('500');
507  $form->setFormAction($this->ctrl->getFormAction($this,''));
508  $form->setName("formlogin");
509  $form->setShowTopButtons(false);
510  $form->setTitle($lng->txt("login_to_ilias"));
511 
512  // auth selection
513  include_once('./Services/Authentication/classes/class.ilAuthModeDetermination.php');
515  if(ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection())
516  {
517  $visible_auth_methods = array();
518  $radg = new ilRadioGroupInputGUI($lng->txt("auth_selection"), "auth_mode");
519  foreach(ilAuthUtils::_getMultipleAuthModeOptions($lng) as $key => $option)
520  {
521  if(isset($option['hide_in_ui']) && $option['hide_in_ui'])
522  {
523  continue;
524  }
525 
526  $op1 = new ilRadioOption($option['txt'], $key);
527  $radg->addOption($op1);
528  if (isset($option['checked']))
529  {
530  $radg->setValue($key);
531  }
532  $visible_auth_methods[] = $op1;
533  }
534 
535  if(count($visible_auth_methods) == 1)
536  {
537  $first_auth_method = current($visible_auth_methods);
538  $hidden_auth_method = new ilHiddenInputGUI("auth_mode");
539  $hidden_auth_method->setValue($first_auth_method->getValue());
540  $form->addItem($hidden_auth_method);
541  }
542  else
543  {
544  $form->addItem($radg);
545  }
546  }
547 
548  $ti = new ilTextInputGUI($lng->txt("username"), "username");
549  $ti->setSize(20);
550  $ti->setRequired(true);
551  $form->addItem($ti);
552 
553  $pi = new ilPasswordInputGUI($lng->txt("password"), "password");
554  $pi->setRetype(false);
555  $pi->setSize(20);
556  $pi->setDisableHtmlAutoComplete(false);
557  $pi->setRequired(true);
558  $form->addItem($pi);
559  $form->addCommandButton("showLogin", $lng->txt("log_in"));
560 
561  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
562  if(ilCaptchaUtil::isActiveForLogin())
563  {
564  require_once 'Services/Captcha/classes/class.ilCaptchaInputGUI.php';
565  $captcha = new ilCaptchaInputGUI($lng->txt('captcha_code'), 'captcha_code');
566  $captcha->setRequired(true);
567  $form->addItem($captcha);
568  }
569 
570  return $this->substituteLoginPageElements(
571  $tpl,
572  $page_editor_html,
573  $form->getHTML(),
574  '[list-login-form]',
575  'LOGIN_FORM'
576  );
577 
578  }
579  return $page_editor_html;
580  }
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.
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.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 587 of file class.ilStartUpGUI.php.

References $lng, and $tpl.

Referenced by showLogin().

588  {
589  global $lng,$tpl;
590 
591  if(strlen($page_editor_html))
592  {
593  // page editor active return
594  return $page_editor_html;
595  }
596 
597  $loginSettings = new ilSetting("login_settings");
598  $information = $loginSettings->get("login_message_".$lng->getLangKey());
599 
600  if(strlen(trim($information)))
601  {
602  $tpl->setVariable("TXT_LOGIN_INFORMATION", $information);
603  }
604  return $page_editor_html;
605  }
ILIAS Setting Class.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ showLogout()

ilStartUpGUI::showLogout ( )

show logout screen

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

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

1136  {
1137  global $tpl, $ilSetting, $ilAuth, $lng, $ilIliasIniFile;
1138 
1140  $ilAuth->logout();
1141  session_destroy();
1142 
1143  // reset cookie
1144  $client_id = $_COOKIE["ilClientId"];
1145  ilUtil::setCookie("ilClientId","");
1146 
1147  //instantiate logout template
1148  self::initStartUpTemplate("tpl.logout.html");
1149 
1150  if ($ilSetting->get("pub_section"))
1151  {
1152  $tpl->setCurrentBlock("homelink");
1153  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$lng->getLangKey());
1154  $tpl->setVariable("TXT_HOME",$lng->txt("home"));
1155  $tpl->parseCurrentBlock();
1156  }
1157 
1158  if ($ilIliasIniFile->readVariable("clients","list"))
1159  {
1160  $tpl->setCurrentBlock("client_list");
1161  $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
1162  $this->ctrl->setParameter($this, "client_id", $client_id);
1163  $tpl->setVariable("CMD_CLIENT_LIST",
1164  $this->ctrl->getLinkTarget($this, "showClientList"));
1165  $tpl->parseCurrentBlock();
1166  $this->ctrl->setParameter($this, "client_id", "");
1167  }
1168 
1169  $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout"));
1170  $tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text"));
1171  $tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
1172  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$lng->getLangKey());
1173 
1174  $tpl->show();
1175  }
$_COOKIE["ilClientId"]
Definition: cron.php:11
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
const SESSION_CLOSE_USER
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 1362 of file class.ilStartUpGUI.php.

References $tpl.

1363  {
1364  global $tpl;
1365 
1366  $str = "<p style=\"margin:15px;\">
1367  You need to enable Session Cookies in your Browser to use ILIAS.
1368  <br/>
1369  <br/><b>Firefox</b>
1370  <br/>Tools -> Options -> Privacy -> Cookies
1371  <br/>Enable 'Allow sites to set cookies' and activate option 'Keep
1372  <br/>cookies' auf 'until I close Firefox'
1373  <br/>
1374  <br/><b>Mozilla/Netscape</b>
1375  <br/>Edit -> Preferences -> Privacy&Security -> Cookies
1376  <br/>Go to 'Cookie Lifetime Policy' and check option 'Accept for current
1377  <br/>session only'.
1378  <br/>
1379  <br/><b>Internet Explorer</b>
1380  <br/>Tools -> Internet Options -> Privacy -> Advanced
1381  <br/>- Check 'Override automatic cookie handling'
1382  <br/>- Check 'Always allow session cookies'
1383  </p>";
1384  $tpl->setVariable("CONTENT", $str);
1385  $tpl->show();
1386  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl

◆ showOpenIdLoginForm()

ilStartUpGUI::showOpenIdLoginForm (   $page_editor_html)
protected

Show openid login if enabled.

Returns

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

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

Referenced by showLogin().

1888  {
1889  global $lng,$tpl;
1890 
1891  include_once './Services/OpenId/classes/class.ilOpenIdSettings.php';
1892  if(!ilOpenIdSettings::getInstance()->isActive())
1893  {
1894  return $page_editor_html;
1895  }
1896 
1897  $lng->loadLanguageModule('auth');
1898 
1899  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1900  $form = new ilPropertyFormGUI();
1901  //$form->setTableWidth('500');
1902  $form->setShowTopButtons(false);
1903  $form->setFormAction($this->ctrl->getFormAction($this));
1904  $form->setTitle($lng->txt('login_to_ilias_via_openid'));
1905 
1906  $openid = new ilTextInputGUI($lng->txt('auth_openid_login'),'oid_username');
1907  $openid->setSize(18);
1908  $openid->setMaxLength(255);
1909  $openid->setRequired(true);
1910  $openid->setCssClass('ilOpenIDBox');
1911  $openid->setInfo($lng->txt('auth_openid_login_info_a'));
1912  $form->addItem($openid);
1913 
1914  include_once './Services/OpenId/classes/class.ilOpenIdProviders.php';
1915  $pro = new ilSelectInputGUI($lng->txt('auth_openid_provider'),'oid_provider');
1916  $pro->setOptions(ilOpenIdProviders::getInstance()->getProviderSelection());
1917  $pro->setValue(ilOpenIdProviders::getInstance()->getSelectedProvider());
1918  $form->addItem($pro);
1919  $form->addCommandButton("showLogin", $lng->txt("log_in"));
1920 
1921  return $this->substituteLoginPageElements(
1922  $tpl,
1923  $page_editor_html,
1924  $form->getHTML(),
1925  '[list-openid-login-form]',
1926  'OID_LOGIN_FORM'
1927  );
1928  }
static getInstance()
Get singleton instance.
This class represents a selection list property in a property form.
This class represents a property form user interface.
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.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 820 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

821  {
822  global $lng, $ilSetting, $ilIliasIniFile, $ilAccess;
823 
824  $rtpl = new ilTemplate('tpl.login_registration_links.html',true,true,'Services/Init');
825 
826  // allow new registrations?
827  include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
829  {
830  $rtpl->setCurrentBlock("new_registration");
831  $rtpl->setVariable("REGISTER", $lng->txt("registration"));
832  $rtpl->setVariable("CMD_REGISTER",
833  $this->ctrl->getLinkTargetByClass("ilaccountregistrationgui", ""));
834  $rtpl->parseCurrentBlock();
835  }
836  // allow password assistance? Surpress option if Authmode is not local database
837  if ($ilSetting->get("password_assistance"))
838  {
839  $rtpl->setCurrentBlock("password_assistance");
840  $rtpl->setVariable("FORGOT_PASSWORD", $lng->txt("forgot_password"));
841  $rtpl->setVariable("FORGOT_USERNAME", $lng->txt("forgot_username"));
842  $rtpl->setVariable("CMD_FORGOT_PASSWORD",
843  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", ""));
844  $rtpl->setVariable("CMD_FORGOT_USERNAME",
845  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "showUsernameAssistanceForm"));
846  $rtpl->setVariable("LANG_ID", $lng->getLangKey());
847  $rtpl->parseCurrentBlock();
848  }
849 
850  if ($ilSetting->get("pub_section") &&
851  $ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, "read", "", ROOT_FOLDER_ID))
852  {
853  $rtpl->setCurrentBlock("homelink");
854  $rtpl->setVariable("CLIENT_ID","?client_id=".$_COOKIE["ilClientId"]."&lang=".$lng->getLangKey());
855  $rtpl->setVariable("TXT_HOME",$lng->txt("home"));
856  $rtpl->parseCurrentBlock();
857  }
858 
859  if ($ilIliasIniFile->readVariable("clients","list"))
860  {
861  $rtpl->setCurrentBlock("client_list");
862  $rtpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
863  $rtpl->setVariable("CMD_CLIENT_LIST",$this->ctrl->getLinkTarget($this, "showClientList"));
864  $rtpl->parseCurrentBlock();
865  }
866 
867  return $this->substituteLoginPageElements(
868  $GLOBALS['tpl'],
869  $page_editor_html,
870  $rtpl->get(),
871  '[list-registration-link]',
872  'REG_PWD_CLIENT_LINKS'
873  );
874  }
$_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 645 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

646  {
647  global $ilSetting, $lng;
648 
649  // Refactoring with ilFormPropertyGUI
650  // [...]
651 
652  // shibboleth login link
653  if ($ilSetting->get("shib_active")) {
654  $tpl = new ilTemplate('tpl.login_form_shibboleth.html', true, true, 'Services/Init');
655 
656  $tpl->setVariable('SHIB_FORMACTION', './shib_login.php'); // Bugfix http://ilias.de/mantis/view.php?id=10662 {$tpl->setVariable('SHIB_FORMACTION', $this->ctrl->getFormAction($this));}
657 
658  if ($ilSetting->get("shib_hos_type") == 'external_wayf') {
659  $tpl->setCurrentBlock("shibboleth_login");
660  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
661  $tpl->setVariable("IL_TARGET", $_GET["target"]);
662  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
663  $tpl->setVariable("TXT_SHIB_LOGIN_BUTTON", $ilSetting->get("shib_login_button"));
664  $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>.');
665  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
666  $tpl->parseCurrentBlock();
667  } elseif ($ilSetting->get("shib_hos_type") == 'embedded_wayf') {
668  $tpl->setCurrentBlock("shibboleth_custom_login");
669  $customInstructions = stripslashes($ilSetting->get("shib_login_instructions"));
670  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $customInstructions);
671  $tpl->parseCurrentBlock();
672  } else {
673  $tpl->setCurrentBlock("shibboleth_wayf_login");
674  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
675  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
676  $tpl->setVariable("TXT_SELECT_HOME_ORGANIZATION", sprintf($lng->txt("shib_select_home_organization"), $ilSetting->get("shib_federation_name")));
677  $tpl->setVariable("TXT_CONTINUE", $lng->txt("btn_next"));
678  $tpl->setVariable("TXT_SHIB_HOME_ORGANIZATION", $lng->txt("shib_home_organization"));
679  $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>.');
680  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
681 
682  require_once "./Services/AuthShibboleth/classes/class.ilShibbolethWAYF.php";
683  $WAYF = new ShibWAYF();
684 
685  $tpl->setVariable("TXT_SHIB_INVALID_SELECTION", $WAYF->showNotice());
686  $tpl->setVariable("SHIB_IDP_LIST", $WAYF->generateSelection());
687  $tpl->setVariable("ILW_TARGET", $_GET["target"]);
688  $tpl->parseCurrentBlock();
689  }
690 
691  return $this->substituteLoginPageElements($GLOBALS['tpl'], $page_editor_html, $tpl->get(), '[list-shibboleth-login-form]', 'SHIB_LOGIN_FORM');
692  }
693 
694  return $page_editor_html;
695  }
$_GET["client_id"]
Class ShibbolethWAYF.
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
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 1181 of file class.ilStartUpGUI.php.

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

Referenced by showLogin().

1182  {
1183  global $ilAuth, $tpl, $lng;
1184 
1185  $valid = $ilAuth->getValidationData();
1186 
1187  self::initStartUpTemplate("tpl.user_mapping_selection.html");
1188  $email_user = ilObjUser::_getLocalAccountsForEmail($valid["email"]);
1189 
1190 
1191  if ($ilAuth->sub_status == AUTH_WRONG_LOGIN)
1192  {
1193  ilUtil::sendFailure($lng->txt("err_wrong_login"));
1194  }
1195 
1196  include_once('./Services/User/classes/class.ilObjUser.php');
1197  if (count($email_user) == 1)
1198  {
1199  //$user = new ilObjUser(key($email_user));
1200  $tpl->setCurrentBlock("one_user");
1201  $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
1202  $tpl->setVariable("VAL_USERNAME", current($email_user));
1203  $tpl->setVariable("USER_ID", key($email_user));
1204  $tpl->parseCurrentBlock();
1205  }
1206  else
1207  {
1208  foreach($email_user as $key => $login)
1209  {
1210  $tpl->setCurrentBlock("user");
1211  $tpl->setVariable("USR_ID", $key);
1212  $tpl->setVariable("VAL_USER", $login);
1213  $tpl->parseCurrentBlock();
1214  }
1215  $tpl->setCurrentBlock("multpiple_user");
1216  $tpl->parseCurrentBlock();
1217  }
1218 
1219  $tpl->setCurrentBlock("content");
1220  $this->ctrl->setParameter($this, "ext_uid", urlencode($_GET["ext_uid"]));
1221  $this->ctrl->setParameter($this, "soap_pw", urlencode($_GET["soap_pw"]));
1222  $this->ctrl->setParameter($this, "auth_stat", $_GET["auth_stat"]);
1223  $tpl->setVariable("FORMACTION",
1224  $this->ctrl->getFormAction($this));
1225  $tpl->setVariable("TXT_ILIAS_LOGIN", $lng->txt("login_to_ilias"));
1226  if (count($email_user) == 1)
1227  {
1228  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation"));
1229  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_2"));
1230  }
1231  else
1232  {
1233  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation_3"));
1234  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_4"));
1235  }
1236  $tpl->setVariable("TXT_CREATE_USER", $lng->txt("ums_create_new_account"));
1237  $tpl->setVariable("TXT_PASSWORD", $lng->txt("password"));
1238  $tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST["password"]));
1239  $tpl->setVariable("TXT_SUBMIT", $lng->txt("login"));
1240 
1241  $tpl->show();
1242  }
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
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 707 of file class.ilStartUpGUI.php.

References $tpl.

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

708  {
709  if(!strlen($page_editor_html))
710  {
711  $tpl->setVariable($fallback_tplvar,$element_html);
712  return $page_editor_html;
713  }
714  // Try to replace placeholders
715  if(!stristr($page_editor_html, $placeholder))
716  {
717  $tpl->setVariable($fallback_tplvar,$element_html);
718  return $page_editor_html;
719  }
720  return str_replace($placeholder, $element_html, $page_editor_html);
721  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the caller graph for this function:

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