ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilStartUpGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5 
16 {
17 
21  function ilStartUpGUI()
22  {
23  global $ilCtrl;
24 
25  $this->ctrl =& $ilCtrl;
26 
27  $ilCtrl->saveParameter($this, array("rep_ref_id", "lang", "target", "client_id"));
28  }
29 
33  function &executeCommand()
34  {
35  global $ilLog;
36 
37  $cmd = $this->ctrl->getCmd("processIndexPHP",array('processIndexPHP','showLogin'));
38  $next_class = $this->ctrl->getNextClass($this);
39 
40  switch($next_class)
41  {
42  case 'ilLoginPageGUI':
43  break;
44 
45  case "ilaccountregistrationgui":
46  require_once("Services/Registration/classes/class.ilAccountRegistrationGUI.php");
47  return $this->ctrl->forwardCommand(new ilAccountRegistrationGUI());
48 
49  case "ilpasswordassistancegui":
50  require_once("Services/Init/classes/class.ilPasswordAssistanceGUI.php");
51  return $this->ctrl->forwardCommand(new ilPasswordAssistanceGUI());
52 
53  default:
54  return $this->$cmd();
55  }
56  }
57 
61  function jumpToRegistration()
62  {
63  $this->ctrl->setCmdClass("ilaccountregistrationgui");
64  $this->ctrl->setCmd("");
65  $this->executeCommand();
66  }
67 
72  {
73  $this->ctrl->setCmdClass("ilpasswordassistancegui");
74  $this->ctrl->setCmd("");
75  $this->executeCommand();
76  }
77 
83  function showLogin()
84  {
85  global $ilSetting, $ilAuth, $tpl, $ilias, $lng;
86 
87  $status = $ilAuth->getStatus();
88  if ($status == "" && isset($_GET["auth_stat"]))
89  {
90  $status = $_GET["auth_stat"];
91  }
92 
93  if($ilAuth->getAuth() && !$status)
94  {
95  // deprecated?
96  if ($_GET["rep_ref_id"] != "")
97  {
98  $_GET["ref_id"] = $_GET["rep_ref_id"];
99  }
100  $this->processStartingPage();
101  }
102 
103  // check for session cookies enabled
104  if (!isset($_COOKIE['iltest']))
105  {
106  if (empty($_GET['cookies']))
107  {
108  $additional_params = '';
109 
110  if(IS_PAYMENT_ENABLED)
111  {
112  if((int)$_GET['forceShoppingCartRedirect'])# && (int)$_SESSION['price_id'] && (int)$_SESSION['pobject_id'])
113  {
114  $additional_params .= '&login_to_purchase_object=1&forceShoppingCartRedirect=1';
115  }
116  }
117 
118  ilUtil::setCookie("iltest","cookie",false);
119  ilUtil::redirect("login.php?target=".$_GET["target"]."&soap_pw=".$_GET["soap_pw"].
120  "&ext_uid=".$_GET["ext_uid"]."&cookies=nocookies&client_id=".
121  rawurlencode(CLIENT_ID)."&lang=".$lng->getLangKey().$additional_params);
122  }
123  else
124  {
125  $_COOKIE['iltest'] = "";
126  }
127  }
128  else
129  {
130  unset($_GET['cookies']);
131  }
132 
133  if ($ilSetting->get("shib_active") && $ilSetting->get("shib_hos_type"))
134  {
135  require_once "./Services/AuthShibboleth/classes/class.ilShibbolethWAYF.php";
136  // Check if we user selects Home Organization
137  $WAYF = new ShibWAYF();
138  }
139 
140  if (isset($WAYF) && $WAYF->is_selection())
141  {
142  if ($WAYF->is_valid_selection())
143  {
144  // Set cookie
145  $WAYF->setSAMLCookie();
146 
147  // Redirect
148  $WAYF->redirect();
149  }
150  }
151 
152  $failure = $success = null;
153 
154  if(IS_PAYMENT_ENABLED)
155  {
156  if(isset($_GET['forceShoppingCartRedirect']) && (int)$_GET['forceShoppingCartRedirect'] == 1)
157  {
158  $this->ctrl->setParameter($this, 'forceShoppingCartRedirect', 1);
159  ilSession::set('forceShoppingCartRedirect', 1);
160  }
161 
162  if (isset($_GET['login_to_purchase_object']) && $_GET['login_to_purchase_object'])
163  {
164  $lng->loadLanguageModule('payment');
165  $failure = $lng->txt("payment_login_to_buy_object");
166  ilSession::set('forceShoppingCartRedirect', 1);
167  }
168  }
169 
170  // :TODO: handle internally?
171  if (isset($_GET['reg_confirmation_msg']) && strlen(trim($_GET['reg_confirmation_msg'])))
172  {
173  $lng->loadLanguageModule('registration');
174  if($_GET['reg_confirmation_msg'] == 'reg_account_confirmation_successful')
175  {
176  $success = $lng->txt(trim($_GET['reg_confirmation_msg']));
177  }
178  else
179  {
180  $failure = $lng->txt(trim($_GET['reg_confirmation_msg']));
181  }
182  }
183  else if(isset($_GET['reached_session_limit']) && $_GET['reached_session_limit'])
184  {
185  $failure = $lng->txt("reached_session_limit");
186  }
187  else if(isset($_GET['accdel']) && $_GET['accdel'])
188  {
189  $lng->loadLanguageModule('user');
190  $failure = $lng->txt("user_account_deleted_confirmation");
191  }
192 
193  if (!empty($status))
194  {
195  switch ($status)
196  {
197  case AUTH_IDLED:
198  // lang variable err_idled not existing
199  // $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_idled"));
200  // fallthrough
201 
202  case AUTH_EXPIRED:
203  $failure = $lng->txt("err_session_expired");
204  break;
205 
207  $failure = $lng->txt("err_auth_cas_no_ilias_user");
208  break;
209 
211  $failure = $lng->txt("err_auth_soap_no_ilias_user");
212  break;
213 
215  $failure = $lng->txt("err_auth_ldap_no_ilias_user");
216  break;
217 
219  $failure = $lng->txt("err_auth_radius_no_ilias_user");
220  break;
221 
222  case AUTH_MODE_INACTIVE:
223  $failure = $lng->txt("err_auth_mode_inactive");
224  break;
225 
226  case AUTH_APACHE_FAILED:
227  $failure = $lng->txt("err_auth_apache_failed");
228  break;
229 
231  $lng->loadLanguageModule('cptch');
233  $ilAuth->logout();
234  session_destroy();
235  $failure = $lng->txt("cptch_wrong_input");
236  break;
237 
238  // special cases: extended user validation failed
239  // ilAuth was successful, so we have to logout here
240 
241  case AUTH_USER_WRONG_IP:
243  $ilAuth->logout();
244  session_destroy();
245 
246  $failure = sprintf($lng->txt('wrong_ip_detected'), $_SERVER['REMOTE_ADDR']);
247  break;
248 
251  $ilAuth->logout();
252  session_destroy();
253 
254  $failure = $lng->txt("simultaneous_login_detected");
255  break;
256 
259  $username = $ilAuth->getExceededUserName(); // #16327
260  $ilAuth->logout();
261 
262  // user could reactivate by code?
263  if($ilSetting->get('user_reactivate_code'))
264  {
265  return $this->showCodeForm($username);
266  }
267 
268  session_destroy();
269 
270  $failure = $lng->txt("time_limit_reached");
271  break;
272 
273  case AUTH_USER_INACTIVE:
275  $ilAuth->logout();
276  session_destroy();
277 
278  $failure = $lng->txt("err_inactive");
279  break;
280 
283  $ilAuth->logout();
284  session_destroy();
285 
286  $failure = $lng->txt("err_inactive_login_attempts");
287  break;
288 
289  // special cases end
290 
291 
292  case AUTH_WRONG_LOGIN:
293  default:
294  $add = "";
295  $auth_error = $ilias->getAuthError();
296  if (is_object($auth_error))
297  {
298  $add = "<br>".$auth_error->getMessage();
299  }
300  $failure = $lng->txt("err_wrong_login").$add;
301  break;
302  }
303  }
304 
305  if (isset($_GET['cu']) && $_GET['cu'])
306  {
307  $lng->loadLanguageModule("auth");
308  $success = $lng->txt("auth_account_code_used");
309  }
310 
311 
312  // --- render
313 
314  // Instantiate login template
315  self::initStartUpTemplate("tpl.login.html");
316 
317  // we need the template for this
318  if($failure)
319  {
321  }
322  else if($success)
323  {
325  }
326 
327  $page_editor_html = $this->getLoginPageEditorHTML();
328  $page_editor_html = $this->showLoginInformation($page_editor_html);
329  $page_editor_html = $this->showLoginForm($page_editor_html);
330  $page_editor_html = $this->showCASLoginForm($page_editor_html);
331  $page_editor_html = $this->showShibbolethLoginForm($page_editor_html);
332  $page_editor_html = $this->showOpenIdLoginForm($page_editor_html);
333  $page_editor_html = $this->showRegistrationLinks($page_editor_html);
334  $page_editor_html = $this->showTermsOfServiceLink($page_editor_html);
335 
336  $page_editor_html = $this->purgePlaceholders($page_editor_html);
337 
338 
339 
340  // not controlled by login page editor
341  $tpl->setVariable("PAGETITLE", "- ".$lng->txt("startpage"));
342  $tpl->setVariable("ILIAS_RELEASE", $ilSetting->get("ilias_version"));
343 
344  $this->ctrl->setTargetScript("ilias.php");
345  $tpl->setVariable("PHP_SELF", $_SERVER['PHP_SELF']);
346 
347  // browser does not accept cookies
348  if (isset($_GET['cookies']) && $_GET['cookies'] == 'nocookies')
349  {
350  ilUtil::sendFailure($lng->txt("err_no_cookies"));
351  }
352 
353  if(strlen($page_editor_html))
354  {
355  $tpl->setVariable('LPE',$page_editor_html);
356  }
357 
358  $tpl->fillWindowTitle();
359  $tpl->fillCssFiles();
360  $tpl->fillJavaScriptFiles();
361 
362  $tpl->show("DEFAULT", false);
363  }
364 
365  protected function showCodeForm($a_username = null, $a_form = null)
366  {
367  global $tpl, $lng;
368 
369  self::initStartUpTemplate("tpl.login_reactivate_code.html");
370 
371  ilUtil::sendFailure($lng->txt("time_limit_reached"));
372 
373  if(!$a_form)
374  {
375  $a_form = $this->initCodeForm($a_username);
376  }
377 
378  $tpl->setVariable("FORM", $a_form->getHTML());
379  $tpl->show("DEFAULT", false);
380  }
381 
382  protected function initCodeForm($a_username)
383  {
384  global $lng, $ilCtrl;
385 
386  $lng->loadLanguageModule("auth");
387 
388  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
389 
390  $form = new ilPropertyFormGUI();
391  $form->setFormAction($ilCtrl->getFormAction($this, 'showcodeform'));
392  $form->setTitle($lng->txt('auth_account_code_title'));
393 
394  $count = new ilTextInputGUI($lng->txt('auth_account_code'), 'code');
395  $count->setRequired(true);
396  $count->setInfo($lng->txt('auth_account_code_info'));
397  $form->addItem($count);
398 
399  // #11658
400  $uname = new ilHiddenInputGUI("uname");
401  $uname->setValue($a_username);
402  $form->addItem($uname);
403 
404  $form->addCommandButton('processCode', $lng->txt('send'));
405 
406  return $form;
407  }
408 
409  protected function processCode()
410  {
411  global $lng, $ilAuth, $ilCtrl;
412 
413  $uname = $_POST["uname"];
414 
415  $form = $this->initCodeForm($uname);
416  if($uname && $form->checkInput())
417  {
418  $code = $form->getInput("code");
419 
420  include_once "Services/User/classes/class.ilAccountCode.php";
422  {
423  $valid_until = ilAccountCode::getCodeValidUntil($code);
424 
425  if(!$user_id = ilObjUser::_lookupId($uname))
426  {
427  $this->showLogin();
428  return false;
429  }
430 
431  $invalid_code = false;
432  $user = new ilObjUser($user_id);
433 
434  if($valid_until === "0")
435  {
436  $user->setTimeLimitUnlimited(true);
437  }
438  else
439  {
440  if(is_numeric($valid_until))
441  {
442  $valid_until = strtotime("+".$valid_until."days");
443  }
444  else
445  {
446  $valid_until = explode("-", $valid_until);
447  $valid_until = mktime(23, 59, 59, $valid_until[1],
448  $valid_until[2], $valid_until[0]);
449  if($valid_until < time())
450  {
451  $invalid_code = true;
452  }
453  }
454 
455  if(!$invalid_code)
456  {
457  $user->setTimeLimitUnlimited(false);
458  $user->setTimeLimitUntil($valid_until);
459  }
460  }
461 
462  if(!$invalid_code)
463  {
464  $user->setActive(true);
465 
467 
468  // apply registration code role assignments
470 
471  // apply registration code time limits
473 
474  $user->update();
475 
476  $ilCtrl->setParameter($this, "cu", 1);
477  $ilCtrl->redirect($this, "showLogin");
478  }
479  }
480 
481  $lng->loadLanguageModule("user");
482  $field = $form->getItemByPostVar("code");
483  $field->setAlert($lng->txt("user_account_code_not_valid"));
484  }
485 
486  $form->setValuesByPost();
487  $this->showCodeForm($uname, $form);
488  }
489 
490 
491 
497  protected function showLoginForm($page_editor_html)
498  {
499  global $ilSetting,$lng,$tpl;
500 
501  // @todo move this to auth utils.
502  // login via ILIAS (this also includes radius and ldap)
503  // If local authentication is enabled for shibboleth users, we
504  // display the login form for ILIAS here.
505  if (($ilSetting->get("auth_mode") != AUTH_SHIBBOLETH ||
506  $ilSetting->get("shib_auth_allow_local")) &&
507  $ilSetting->get("auth_mode") != AUTH_CAS)
508  {
509  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
510  $form = new ilPropertyFormGUI();
511  //$form->setTableWidth('500');
512  $form->setFormAction($this->ctrl->getFormAction($this,''));
513  $form->setName("formlogin");
514  $form->setShowTopButtons(false);
515  $form->setTitle($lng->txt("login_to_ilias"));
516 
517  // auth selection
518  include_once('./Services/Authentication/classes/class.ilAuthModeDetermination.php');
520  if(ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection())
521  {
522  $visible_auth_methods = array();
523  $radg = new ilRadioGroupInputGUI($lng->txt("auth_selection"), "auth_mode");
524  foreach(ilAuthUtils::_getMultipleAuthModeOptions($lng) as $key => $option)
525  {
526  if(isset($option['hide_in_ui']) && $option['hide_in_ui'])
527  {
528  continue;
529  }
530 
531  $op1 = new ilRadioOption($option['txt'], $key);
532  $radg->addOption($op1);
533  if (isset($option['checked']))
534  {
535  $radg->setValue($key);
536  }
537  $visible_auth_methods[] = $op1;
538  }
539 
540  if(count($visible_auth_methods) == 1)
541  {
542  $first_auth_method = current($visible_auth_methods);
543  $hidden_auth_method = new ilHiddenInputGUI("auth_mode");
544  $hidden_auth_method->setValue($first_auth_method->getValue());
545  $form->addItem($hidden_auth_method);
546  }
547  else
548  {
549  $form->addItem($radg);
550  }
551  }
552 
553  $ti = new ilTextInputGUI($lng->txt("username"), "username");
554  $ti->setSize(20);
555  $ti->setRequired(true);
556  $form->addItem($ti);
557 
558  $pi = new ilPasswordInputGUI($lng->txt("password"), "password");
559  $pi->setRetype(false);
560  $pi->setSize(20);
561  $pi->setDisableHtmlAutoComplete(false);
562  $pi->setRequired(true);
563  $form->addItem($pi);
564  $form->addCommandButton("showLogin", $lng->txt("log_in"));
565 
566  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
567  if(ilCaptchaUtil::isActiveForLogin())
568  {
569  require_once 'Services/Captcha/classes/class.ilCaptchaInputGUI.php';
570  $captcha = new ilCaptchaInputGUI($lng->txt('captcha_code'), 'captcha_code');
571  $captcha->setRequired(true);
572  $form->addItem($captcha);
573  }
574 
575  return $this->substituteLoginPageElements(
576  $tpl,
577  $page_editor_html,
578  $form->getHTML(),
579  '[list-login-form]',
580  'LOGIN_FORM'
581  );
582 
583  }
584  return $page_editor_html;
585  }
586 
592  protected function showLoginInformation($page_editor_html)
593  {
594  global $lng,$tpl;
595 
596  if(strlen($page_editor_html))
597  {
598  // page editor active return
599  return $page_editor_html;
600  }
601 
602  $loginSettings = new ilSetting("login_settings");
603  $information = $loginSettings->get("login_message_".$lng->getLangKey());
604 
605  if(strlen(trim($information)))
606  {
607  $tpl->setVariable("TXT_LOGIN_INFORMATION", $information);
608  }
609  return $page_editor_html;
610  }
611 
618  protected function showCASLoginForm($page_editor_html)
619  {
620  global $ilSetting, $lng;
621 
622 
623  // cas login link
624  if ($ilSetting->get("cas_active"))
625  {
626  $tpl = new ilTemplate('tpl.login_form_cas.html', true, true, 'Services/Init');
627  $tpl->setVariable("TXT_CAS_LOGIN", $lng->txt("login_to_ilias_via_cas"));
628  $tpl->setVariable("TXT_CAS_LOGIN_BUTTON", ilUtil::getImagePath("cas_login_button.png"));
629  $tpl->setVariable("TXT_CAS_LOGIN_INSTRUCTIONS", $ilSetting->get("cas_login_instructions"));
630  $this->ctrl->setParameter($this, "forceCASLogin", "1");
631  $tpl->setVariable("TARGET_CAS_LOGIN",$this->ctrl->getLinkTarget($this, "showLogin"));
632  $this->ctrl->setParameter($this, "forceCASLogin", "");
633 
634  return $this->substituteLoginPageElements(
635  $GLOBALS['tpl'],
636  $page_editor_html,
637  $tpl->get(),
638  '[list-cas-login-form]',
639  'CAS_LOGIN_FORM'
640  );
641  }
642  return $page_editor_html;
643  }
644 
650  protected function showShibbolethLoginForm($page_editor_html)
651  {
652  global $ilSetting, $lng;
653 
654  // Refactoring with ilFormPropertyGUI
655  // [...]
656 
657  // shibboleth login link
658  if ($ilSetting->get("shib_active")) {
659  $tpl = new ilTemplate('tpl.login_form_shibboleth.html', true, true, 'Services/Init');
660 
661  $tpl->setVariable('SHIB_FORMACTION', './shib_login.php'); // Bugfix http://ilias.de/mantis/view.php?id=10662 {$tpl->setVariable('SHIB_FORMACTION', $this->ctrl->getFormAction($this));}
662 
663  if ($ilSetting->get("shib_hos_type") == 'external_wayf') {
664  $tpl->setCurrentBlock("shibboleth_login");
665  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
666  $tpl->setVariable("IL_TARGET", $_GET["target"]);
667  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
668  $tpl->setVariable("TXT_SHIB_LOGIN_BUTTON", $ilSetting->get("shib_login_button"));
669  $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>.');
670  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
671  $tpl->parseCurrentBlock();
672  } elseif ($ilSetting->get("shib_hos_type") == 'embedded_wayf') {
673  $tpl->setCurrentBlock("shibboleth_custom_login");
674  $customInstructions = stripslashes($ilSetting->get("shib_login_instructions"));
675  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $customInstructions);
676  $tpl->parseCurrentBlock();
677  } else {
678  $tpl->setCurrentBlock("shibboleth_wayf_login");
679  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
680  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
681  $tpl->setVariable("TXT_SELECT_HOME_ORGANIZATION", sprintf($lng->txt("shib_select_home_organization"), $ilSetting->get("shib_federation_name")));
682  $tpl->setVariable("TXT_CONTINUE", $lng->txt("btn_next"));
683  $tpl->setVariable("TXT_SHIB_HOME_ORGANIZATION", $lng->txt("shib_home_organization"));
684  $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>.');
685  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
686 
687  require_once "./Services/AuthShibboleth/classes/class.ilShibbolethWAYF.php";
688  $WAYF = new ShibWAYF();
689 
690  $tpl->setVariable("TXT_SHIB_INVALID_SELECTION", $WAYF->showNotice());
691  $tpl->setVariable("SHIB_IDP_LIST", $WAYF->generateSelection());
692  $tpl->setVariable("ILW_TARGET", $_GET["target"]);
693  $tpl->parseCurrentBlock();
694  }
695 
696  return $this->substituteLoginPageElements($GLOBALS['tpl'], $page_editor_html, $tpl->get(), '[list-shibboleth-login-form]', 'SHIB_LOGIN_FORM');
697  }
698 
699  return $page_editor_html;
700  }
701 
702 
712  protected function substituteLoginPageElements($tpl, $page_editor_html, $element_html, $placeholder, $fallback_tplvar)
713  {
714  if(!strlen($page_editor_html))
715  {
716  $tpl->setVariable($fallback_tplvar,$element_html);
717  return $page_editor_html;
718  }
719  // Try to replace placeholders
720  if(!stristr($page_editor_html, $placeholder))
721  {
722  $tpl->setVariable($fallback_tplvar,$element_html);
723  return $page_editor_html;
724  }
725  return str_replace($placeholder, $element_html, $page_editor_html);
726  }
727 
732  protected function getLoginPageEditorHTML()
733  {
734  global $lng, $tpl;
735 
736  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php';
738  $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey());
739 
740  if(!$active_lang)
741  {
742  return '';
743  }
744 
745  // if page does not exist, return nothing
746  include_once './Services/COPage/classes/class.ilPageUtil.php';
747  if(!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang)))
748  {
749  return '';
750  }
751 
752  include_once './Services/Authentication/classes/class.ilLoginPage.php';
753  include_once './Services/Authentication/classes/class.ilLoginPageGUI.php';
754 
755  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
756  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",ilObjStyleSheet::getContentStylePath(0));
757  $tpl->setCurrentBlock("SyntaxStyle");
758  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",ilObjStyleSheet::getSyntaxStylePath());
759  $tpl->parseCurrentBlock();
760 
761  // get page object
762  $page_gui = new ilLoginPageGUI(ilLanguage::lookupId($active_lang));
763 
764  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
765  $page_gui->setStyleId(0, 'auth');
766 
767  $page_gui->setPresentationTitle("");
768  $page_gui->setTemplateOutput(false);
769  $page_gui->setHeader("");
770  $ret = $page_gui->showPage();
771 
772  return $ret;
773  }
774 
783  protected function showRegistrationLinks($page_editor_html)
784  {
785  global $lng, $ilSetting, $ilIliasIniFile, $ilAccess;
786 
787  $rtpl = new ilTemplate('tpl.login_registration_links.html',true,true,'Services/Init');
788 
789  // allow new registrations?
790  include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
792  {
793  $rtpl->setCurrentBlock("new_registration");
794  $rtpl->setVariable("REGISTER", $lng->txt("registration"));
795  $rtpl->setVariable("CMD_REGISTER",
796  $this->ctrl->getLinkTargetByClass("ilaccountregistrationgui", ""));
797  $rtpl->parseCurrentBlock();
798  }
799  // allow password assistance? Surpress option if Authmode is not local database
800  if ($ilSetting->get("password_assistance"))
801  {
802  $rtpl->setCurrentBlock("password_assistance");
803  $rtpl->setVariable("FORGOT_PASSWORD", $lng->txt("forgot_password"));
804  $rtpl->setVariable("FORGOT_USERNAME", $lng->txt("forgot_username"));
805  $rtpl->setVariable("CMD_FORGOT_PASSWORD",
806  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", ""));
807  $rtpl->setVariable("CMD_FORGOT_USERNAME",
808  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "showUsernameAssistanceForm"));
809  $rtpl->setVariable("LANG_ID", $lng->getLangKey());
810  $rtpl->parseCurrentBlock();
811  }
812 
813  if ($ilSetting->get("pub_section") &&
814  $ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, "read", "", ROOT_FOLDER_ID))
815  {
816  $rtpl->setCurrentBlock("homelink");
817  $rtpl->setVariable("CLIENT_ID","?client_id=".$_COOKIE["ilClientId"]."&lang=".$lng->getLangKey());
818  $rtpl->setVariable("TXT_HOME",$lng->txt("home"));
819  $rtpl->parseCurrentBlock();
820  }
821 
822  if ($ilIliasIniFile->readVariable("clients","list"))
823  {
824  $rtpl->setCurrentBlock("client_list");
825  $rtpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
826  $rtpl->setVariable("CMD_CLIENT_LIST",$this->ctrl->getLinkTarget($this, "showClientList"));
827  $rtpl->parseCurrentBlock();
828  }
829 
830  return $this->substituteLoginPageElements(
831  $GLOBALS['tpl'],
832  $page_editor_html,
833  $rtpl->get(),
834  '[list-registration-link]',
835  'REG_PWD_CLIENT_LINKS'
836  );
837  }
838 
844  protected function showTermsOfServiceLink($page_editor_html)
845  {
849  global $lng;
850 
851 
852  try
853  {
854  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceSignableDocumentFactory.php';
855  if(ilTermsOfServiceHelper::isEnabled() && ilTermsOfServiceSignableDocumentFactory::getByLanguageObject($lng))
856  {
857  $utpl = new ilTemplate('tpl.login_terms_of_service_link.html', true, true, 'Services/Init');
858  $utpl->setVariable('TXT_TERMS_OF_SERVICE', $lng->txt('usr_agreement'));
859  $utpl->setVariable('LINK_TERMS_OF_SERVICE', $this->ctrl->getLinkTarget($this, 'showTermsOfService'));
860 
861  return $this->substituteLoginPageElements(
862  $GLOBALS['tpl'],
863  $page_editor_html,
864  $utpl->get(),
865  '[list-user-agreement]',
866  'USER_AGREEMENT'
867  );
868  }
869  }
871  {
872  }
873 
874  return $this->substituteLoginPageElements(
875  $GLOBALS['tpl'],
876  $page_editor_html,
877  '',
878  '[list-user-agreement]',
879  'USER_AGREEMENT'
880  );
881  }
882 
888  protected function purgePlaceholders($page_editor_html)
889  {
890  return str_replace(
891  array(
892  '[list-language-selection] ',
893  '[list-registration-link]',
894  '[list-user-agreement]',
895  '[list-login-form]',
896  '[list-cas-login-form]',
897  '[list-shibboleth-login-form]',
898  '[list-openid-login-form]'
899  ),
900  array('','','','','','',''),
901  $page_editor_html
902  );
903  }
904 
909  public function showAccountMigration($a_message = '')
910  {
915  global $tpl, $lng;
916 
917  $lng->loadLanguageModule('auth');
918  self::initStartUpTemplate('tpl.login_account_migration.html');
919 
920  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
921  $form = new ilPropertyFormGUI();
922  $form->setFormAction($this->ctrl->getFormAction($this,'migrateAccount'));
923 
924  $form->setTitle($lng->txt('auth_account_migration'));
925  $form->addCommandButton('migrateAccount', $lng->txt('save'));
926  $form->addCommandButton('showLogin', $lng->txt('cancel'));
927 
928  $rad = new ilRadioGroupInputGUI($lng->txt('auth_account_migration_name'),'account_migration');
929  $rad->setValue(1);
930 
931  $keep = new ilRadioOption($lng->txt('auth_account_migration_keep'),1,$lng->txt('auth_info_migrate'));
932  $user = new ilTextInputGUI($lng->txt('login'),'mig_username');
933  $user->setRequired(true);
934  $user->setValue(ilUtil::prepareFormOutput($_POST['mig_username']));
935  $user->setSize(32);
936  $user->setMaxLength(128);
937  $keep->addSubItem($user);
938 
939  $pass = new ilPasswordInputGUI($lng->txt('password'),'mig_password');
940  $pass->setRetype(false);
941  $pass->setRequired(true);
942  $pass->setValue(ilUtil::prepareFormOutput($_POST['mig_password']));
943  $pass->setSize(12);
944  $pass->setMaxLength(128);
945  $keep->addSubItem($pass);
946  $rad->addOption($keep);
947 
948  $new = new ilRadioOption($lng->txt('auth_account_migration_new'),2,$lng->txt('auth_info_add'));
949  $rad->addOption($new);
950 
951  $form->addItem($rad);
952 
953  $tpl->setVariable('MIG_FORM',$form->getHTML());
954 
955  if(strlen($a_message))
956  {
957  ilUtil::sendFailure($a_message);
958  }
959 
960  $tpl->show('DEFAULT');
961  }
962 
969  public function migrateAccount()
970  {
971  global $lng,$ilClientIniFile,$ilLog,$rbacadmin;
972 
973  $lng->loadLanguageModule('auth');
974 
975  if(!isset($_POST['account_migration']))
976  {
977  $this->showAccountMigration($lng->txt('err_choose_migration_type'));
978  return false;
979  }
980 
981  if($_POST['account_migration'] == 1 and (!strlen($_POST['mig_username']) or !strlen($_POST['mig_password'])))
982  {
983  $this->showAccountMigration($lng->txt('err_wrong_login'));
984  return false;
985  }
986 
987  if($_POST['account_migration'] == 1)
988  {
989  if(!$user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST['mig_username'])))
990  {
991  $this->showAccountMigration($lng->txt('err_wrong_login'));
992  return false;
993  }
994  $_POST['username'] = $_POST['mig_username'];
995  $_POST['password'] = $_POST['mig_password'];
996 
997  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
998  include_once './Services/Database/classes/class.ilAuthContainerMDB2.php';
999 
1001  $ilAuth->start();
1002  if(!$ilAuth->checkAuth())
1003  {
1004  $ilAuth->logout();
1005  $this->showAccountMigration($lng->txt('err_wrong_login'));
1006  return false;
1007  }
1008 
1009  $user = new ilObjUser($user_id);
1010  $user->setAuthMode(ilSession::get('tmp_auth_mode'));
1011 
1012  ilLoggerFactory::getLogger('auth')->debug('Auth mode is: ' . ilSession::get('tmp_auth_mode'));
1013 
1014  $user->setExternalAccount(ilSession::get('tmp_external_account'));
1015  $user->setActive(true);
1016  $user->update();
1017 
1018  // Assign to default role
1019  if(is_array(ilSession::get('tmp_roles')))
1020  {
1021  foreach(ilSession::get('tmp_roles') as $role)
1022  {
1023  $rbacadmin->assignUser((int) $role,$user->getId());
1024  }
1025  }
1026 
1027  // Log migration
1028  ilLoggerFactory::getLogger('auth')->info('Migrated '. ilSession::get('tmp_external_account').' to ILIAS account '. $user->getLogin());
1029  }
1030  elseif($_POST['account_migration'] == 2)
1031  {
1032  switch(ilSession::get('tmp_auth_mode_type'))
1033  {
1034  case 'apache':
1035  $_POST['username'] = ilSession::get('tmp_external_account');
1036  $_POST['password'] = ilSession::get('tmp_pass');
1037 
1038  include_once('Services/AuthApache/classes/class.ilAuthContainerApache.php');
1039  $container = new ilAuthContainerApache();
1040  $container->forceCreation(true);
1041  $ilAuth = ilAuthFactory::factory($container);
1042  $ilAuth->start();
1043  break;
1044 
1045  case 'ldap':
1046  $_POST['username'] = ilSession::get('tmp_external_account');
1047  $_POST['password'] = ilSession::get('tmp_pass');
1048  $server_id = ilSession::get('tmp_auth_mode_id');
1049 
1050  include_once('Services/LDAP/classes/class.ilAuthContainerLDAP.php');
1051  $container = new ilAuthContainerLDAP($server_id);
1052  $container->forceCreation(true);
1053  $ilAuth = ilAuthFactory::factory($container);
1054  $ilAuth->start();
1055  break;
1056 
1057  case 'radius':
1058  $_POST['username'] = ilSession::get('tmp_external_account');
1059  $_POST['password'] = ilSession::get('tmp_pass');
1060 
1061  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
1062  include_once './Services/Radius/classes/class.ilAuthContainerRadius.php';
1063 
1064  $container = new ilAuthContainerRadius();
1065  $container->forceCreation(true);
1066  $ilAuth = ilAuthFactory::factory($container);
1067  $ilAuth->start();
1068  break;
1069 
1070  case 'openid':
1071  $_POST['username'] = ilSession::get('dummy');
1072  $_POST['password'] = ilSession::get('dummy');
1073  $_POST['oid_username'] = ilSession::get('tmp_oid_username');
1074  $_POST['oid_provider'] = ilSession::get('tmp_oid_provider');
1075  //ilSession::set('force_creation', true);
1076 
1077  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
1078  include_once './Services/OpenId/classes/class.ilAuthContainerOpenId.php';
1079 
1080  $container = new ilAuthContainerOpenId();
1081  $container->forceCreation(true);
1083  include_once './Services/OpenId/classes/class.ilAuthOpenId.php';
1084  $ilAuth = ilAuthFactory::factory($container);
1085 
1086  // logout first to initiate a new login session
1087  $ilAuth->logout();
1088  ilSession::_destroy(session_id());
1089  ilSession::set('force_creation', true);
1090  $ilAuth->start();
1091  }
1092  }
1093 
1094  $this->processStartingPage();
1095  }
1096 
1100  function showLogout()
1101  {
1102  global $tpl, $ilSetting, $ilAuth, $lng, $ilIliasIniFile;
1103 
1105  $ilAuth->logout();
1106  session_destroy();
1107 
1108  // reset cookie
1109  $client_id = $_COOKIE["ilClientId"];
1110  ilUtil::setCookie("ilClientId","");
1111 
1112  //instantiate logout template
1113  self::initStartUpTemplate("tpl.logout.html");
1114 
1115  if ($ilSetting->get("pub_section"))
1116  {
1117  $tpl->setCurrentBlock("homelink");
1118  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$lng->getLangKey());
1119  $tpl->setVariable("TXT_HOME",$lng->txt("home"));
1120  $tpl->parseCurrentBlock();
1121  }
1122 
1123  if ($ilIliasIniFile->readVariable("clients","list"))
1124  {
1125  $tpl->setCurrentBlock("client_list");
1126  $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
1127  $this->ctrl->setParameter($this, "client_id", $client_id);
1128  $tpl->setVariable("CMD_CLIENT_LIST",
1129  $this->ctrl->getLinkTarget($this, "showClientList"));
1130  $tpl->parseCurrentBlock();
1131  $this->ctrl->setParameter($this, "client_id", "");
1132  }
1133 
1134  $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout"));
1135  $tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text"));
1136  $tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
1137  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$lng->getLangKey());
1138 
1139  $tpl->show();
1140  }
1141 
1147  {
1148  global $ilAuth, $tpl, $lng;
1149 
1150  $valid = $ilAuth->getValidationData();
1151 
1152  self::initStartUpTemplate("tpl.user_mapping_selection.html");
1153  $email_user = ilObjUser::_getLocalAccountsForEmail($valid["email"]);
1154 
1155 
1156  if ($ilAuth->getSubStatus() == AUTH_WRONG_LOGIN)
1157  {
1158  ilUtil::sendFailure($lng->txt("err_wrong_login"));
1159  }
1160 
1161  include_once('./Services/User/classes/class.ilObjUser.php');
1162  if (count($email_user) == 1)
1163  {
1164  //$user = new ilObjUser(key($email_user));
1165  $tpl->setCurrentBlock("one_user");
1166  $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
1167  $tpl->setVariable("VAL_USERNAME", current($email_user));
1168  $tpl->setVariable("USER_ID", key($email_user));
1169  $tpl->parseCurrentBlock();
1170  }
1171  else
1172  {
1173  foreach($email_user as $key => $login)
1174  {
1175  $tpl->setCurrentBlock("user");
1176  $tpl->setVariable("USR_ID", $key);
1177  $tpl->setVariable("VAL_USER", $login);
1178  $tpl->parseCurrentBlock();
1179  }
1180  $tpl->setCurrentBlock("multpiple_user");
1181  $tpl->parseCurrentBlock();
1182  }
1183 
1184  $tpl->setCurrentBlock("content");
1185  $this->ctrl->setParameter($this, "ext_uid", urlencode($_GET["ext_uid"]));
1186  $this->ctrl->setParameter($this, "soap_pw", urlencode($_GET["soap_pw"]));
1187  $this->ctrl->setParameter($this, "auth_stat", $_GET["auth_stat"]);
1188  $tpl->setVariable("FORMACTION",
1189  $this->ctrl->getFormAction($this));
1190  $tpl->setVariable("TXT_ILIAS_LOGIN", $lng->txt("login_to_ilias"));
1191  if (count($email_user) == 1)
1192  {
1193  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation"));
1194  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_2"));
1195  }
1196  else
1197  {
1198  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation_3"));
1199  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_4"));
1200  }
1201  $tpl->setVariable("TXT_CREATE_USER", $lng->txt("ums_create_new_account"));
1202  $tpl->setVariable("TXT_PASSWORD", $lng->txt("password"));
1203  $tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST["password"]));
1204  $tpl->setVariable("TXT_SUBMIT", $lng->txt("login"));
1205 
1206  $tpl->show();
1207  }
1208 
1212  function showClientList()
1213  {
1214  global $tpl, $ilIliasIniFile, $lng;
1215 //echo "1";
1216  if (!$ilIliasIniFile->readVariable("clients","list"))
1217  {
1218  $this->processIndexPHP();
1219  return;
1220  }
1221 //echo "2";
1222  $tpl = new ilTemplate("tpl.main.html", true, true);
1223  $tpl->setAddFooter(false); // no client yet
1224 
1225  $tpl->setVariable("PAGETITLE", $lng->txt("clientlist_clientlist"));
1226  $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
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)."\">".$lng->txt("clientlist_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) . "\">".$lng->txt("clientlist_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($lng->txt("clientlist_available_clients"));
1285  $tbl->setHeaderNames(array($lng->txt("clientlist_installation_name"), $lng->txt("clientlist_login"), $lng->txt("clientlist_public_access")));
1286  $tbl->setHeaderVars(array("name","index","login"));
1287  $tbl->setColumnWidth(array("50%","25%","25%"));
1288  }
1289  else
1290  {
1291  $tbl->setTitle($lng->txt("clientlist_available_clients"));
1292  $tbl->setHeaderNames(array($lng->txt("clientlist_installation_name"), $lng->txt("clientlist_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  }
1315 
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  }
1346 
1350  protected function getAcceptance()
1351  {
1352  $this->showTermsOfService();
1353  }
1354 
1358  protected function showTermsOfService()
1359  {
1366  global $lng, $tpl, $ilUser, $ilSetting;
1367 
1368  $back_to_login = ('getAcceptance' != $this->ctrl->getCmd());
1369 
1370  self::initStartUpTemplate('tpl.view_terms_of_service.html', $back_to_login, !$back_to_login);
1371  $tpl->setVariable('TXT_PAGEHEADLINE', $lng->txt('usr_agreement'));
1372 
1373  try
1374  {
1375  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceSignableDocumentFactory.php';
1377 
1378  if('getAcceptance' == $this->ctrl->getCmd())
1379  {
1380  if(isset($_POST['status']) && 'accepted' == $_POST['status'])
1381  {
1382  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
1383  ilTermsOfServiceHelper::trackAcceptance($ilUser, $document);
1384 
1385  if(ilSession::get('orig_request_target'))
1386  {
1387  $target = ilSession::get('orig_request_target');
1388  ilSession::set('orig_request_target', '');
1389  ilUtil::redirect($target);
1390  }
1391  else
1392  {
1393  ilUtil::redirect('index.php?target=' . $_GET['target'] . '&client_id=' . CLIENT_ID);
1394  }
1395  }
1396 
1397  $tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, $this->ctrl->getCmd()));
1398  $tpl->setVariable('ACCEPT_CHECKBOX', ilUtil::formCheckbox(0, 'status', 'accepted'));
1399  $tpl->setVariable('ACCEPT_TERMS_OF_SERVICE', $lng->txt('accept_usr_agreement'));
1400  $tpl->setVariable('TXT_SUBMIT', $lng->txt('submit'));
1401  }
1402 
1403  $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $document->getContent());
1404  }
1406  {
1407  include_once("./Modules/SystemFolder/classes/class.ilSystemSupportContacts.php");
1408  $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', sprintf($lng->txt('no_agreement_description'), 'mailto:' . ilUtil::prepareFormOutput(ilSystemSupportContacts::getMailToAddress())));
1409  }
1410 
1411  $tpl->show();
1412  }
1413 
1417  function processIndexPHP()
1418  {
1419  global $ilIliasIniFile, $ilAuth, $ilSetting;
1420 
1421  // display client selection list if enabled
1422  if (!isset($_GET["client_id"]) &&
1423  $_GET["cmd"] == "" &&
1424  $ilIliasIniFile->readVariable("clients","list"))
1425  {
1426  return $this->showClientList();
1427  }
1428 
1429  if($ilAuth->getAuth() && $ilAuth->getStatus() == "")
1430  {
1431  $this->processStartingPage();
1432  }
1433 
1434  //
1435  // index.php is called and public section is enabled
1436  //
1437  // && $ilAuth->status == -101 is important for soap auth (public section on + user mapping, alex)
1438  // $ilAuth->status -1 is given, if session ends (if public section -> jump to public section)
1439 
1440  if ($ilSetting->get("pub_section") && $_POST["sendLogin"] != "1"
1441  && ($ilAuth->getStatus() != -101 && $_GET["soap_pw"] == ""))
1442  {
1444  }
1445  else
1446  {
1447  // index.php is called and public section is disabled
1448  $this->showLogin();
1449  }
1450  }
1451 
1457  function processStartingPage()
1458  {
1462  global $ilUser;
1463 
1464  // fallback, should never happen
1465  if ($ilUser->getId() == ANONYMOUS_USER_ID)
1466  {
1468  }
1469  else
1470  {
1471  // for password change and incomplete profile
1472  // see ilPersonalDesktopGUI
1473 
1474  if(IS_PAYMENT_ENABLED)
1475  {
1476  include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
1478 
1479  if((int)$_GET['forceShoppingCartRedirect'])
1480  {
1481  ilUtil::redirect('ilias.php?baseClass=ilShopController&cmd=redirect&redirect_class=ilshopshoppingcartgui');
1482  }
1483  }
1484 
1485  if(!$_GET["target"])
1486  {
1487  // Redirect here to switch back to http if desired
1488  include_once './Services/User/classes/class.ilUserUtil.php';
1490  }
1491  else
1492  {
1493  // will handle shop redirects, too
1494  ilUtil::redirect("goto.php?target=".$_GET["target"]);
1495  }
1496  }
1497  }
1498 
1499  function _checkGoto($a_target)
1500  {
1501  global $objDefinition, $ilPluginAdmin, $ilUser;
1502 
1503  if (is_object($ilPluginAdmin))
1504  {
1505  // get user interface plugins
1506  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1507 
1508  // search
1509  foreach ($pl_names as $pl)
1510  {
1511  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1512  $gui_class = $ui_plugin->getUIClassInstance();
1513  $resp = $gui_class->checkGotoHook($a_target);
1514  if ($resp["target"] !== false)
1515  {
1516  $a_target = $resp["target"];
1517  break;
1518  }
1519  }
1520  }
1521 
1522  if ($a_target == "")
1523  {
1524  return false;
1525  }
1526 
1527  $t_arr = explode("_", $a_target);
1528  $type = $t_arr[0];
1529 
1530  if ($type == "git")
1531  {
1532  $type = "glo";
1533  }
1534 
1535  if ($type == "pg" | $type == "st")
1536  {
1537  $type = "lm";
1538  }
1539 
1540  $class = $objDefinition->getClassName($type);
1541  if ($class == "")
1542  {
1543  return false;
1544  }
1545 
1546  $location = $objDefinition->getLocation($type);
1547  $full_class = "ilObj".$class."Access";
1548  include_once($location."/class.".$full_class.".php");
1549 
1550  $ret = call_user_func(array($full_class, "_checkGoto"), $a_target);
1551 
1552  // if no access and repository object => check for parent course/group
1553  if(!$ret &&
1554  !stristr($a_target, "_wsp") &&
1555  $ilUser->getId() != ANONYMOUS_USER_ID && // #10637
1556  !$objDefinition->isAdministrationObject($type) &&
1557  $objDefinition->isRBACObject($type) &&
1558  $t_arr[1])
1559  {
1560  global $tree, $rbacsystem, $ilAccess;
1561 
1562  // original type "pg" => pg_<page_id>[_<ref_id>]
1563  if($t_arr[0] == "pg")
1564  {
1565  if(isset($t_arr[2]))
1566  {
1567  $ref_id = $t_arr[2];
1568  }
1569  else
1570  {
1571  $lm_id = ilLMObject::_lookupContObjID($t_arr[1]);
1573  if($ref_id)
1574  {
1575  $ref_id = array_shift($ref_id);
1576  }
1577  }
1578  }
1579  else
1580  {
1581  $ref_id = $t_arr[1];
1582  }
1583 
1584  include_once "Services/Membership/classes/class.ilParticipants.php";
1585  $block_obj = array();
1586 
1587  // walk path to find parent container
1588  $path = $tree->getPathId($ref_id);
1589  array_pop($path);
1590  foreach($path as $path_ref_id)
1591  {
1592  $redirect_infopage = false;
1593  $add_member_role = false;
1594 
1595  $ptype = ilObject::_lookupType($path_ref_id, true);
1596  $pobj_id = ilObject::_lookupObjId($path_ref_id);
1597 
1598  // core checks: timings/object-specific
1599  if(!$ilAccess->doActivationCheck("read", "", $path_ref_id, $ilUser->getId(), $pobj_id, $ptype) ||
1600  !$ilAccess->doStatusCheck("read", "", $path_ref_id, $ilUser->getId(), $pobj_id, $ptype))
1601  {
1602  // object in path is inaccessible - aborting
1603  return false;
1604  }
1605  else if($ptype == "crs")
1606  {
1607  // check if already participant
1608  include_once "Modules/Course/classes/class.ilCourseParticipant.php";
1609  $participants = new ilCourseParticipant($pobj_id, $ilUser->getId());
1610  if(!$participants->isAssigned())
1611  {
1612  // subscription currently possible?
1613  include_once "Modules/Course/classes/class.ilObjCourse.php";
1614  if(ilObjCourse::_isActivated($pobj_id) &&
1616  {
1617  $block_obj[] = $path_ref_id;
1618  $add_member_role = true;
1619  }
1620  else
1621  {
1622  $redirect_infopage = true;
1623  }
1624  }
1625  }
1626  else if($ptype == "grp")
1627  {
1628  // check if already participant
1629  include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1630  if(!ilGroupParticipants::_isParticipant($path_ref_id, $ilUser->getId()))
1631  {
1632  // subscription currently possible?
1633  include_once "Modules/Group/classes/class.ilObjGroup.php";
1634  $group_obj = new ilObjGroup($path_ref_id);
1635  if($group_obj->isRegistrationEnabled())
1636  {
1637  $block_obj[] = $path_ref_id;
1638  $add_member_role = true;
1639  }
1640  else
1641  {
1642  $redirect_infopage = true;
1643  }
1644  }
1645  }
1646 
1647  // add members roles for all "blocking" objects
1648  if($add_member_role)
1649  {
1650  // cannot join? goto will never work, so redirect to current object
1651  $rbacsystem->resetPACache($ilUser->getId(), $path_ref_id);
1652  if(!$rbacsystem->checkAccess("join", $path_ref_id))
1653  {
1654  $redirect_infopage = true;
1655  }
1656  else
1657  {
1658  $rbacsystem->addTemporaryRole($ilUser->getId(),
1659  ilParticipants::getDefaultMemberRole($path_ref_id));
1660  }
1661  }
1662 
1663  // redirect to infopage of 1st blocking object in path
1664  if($redirect_infopage)
1665  {
1666  if($rbacsystem->checkAccess("visible", $path_ref_id))
1667  {
1668  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI".
1669  "&ref_id=".$path_ref_id."&cmd=infoScreen");
1670  }
1671  else
1672  {
1673  return false;
1674  }
1675  }
1676  }
1677 
1678  // check if access will be possible with all (possible) member roles added
1679  $rbacsystem->resetPACache($ilUser->getId(), $ref_id);
1680  if($rbacsystem->checkAccess("read", $ref_id) && sizeof($block_obj)) // #12128
1681  {
1682  // this won't work with lm-pages (see above)
1683  // include_once "Services/Link/classes/class.ilLink.php";
1684  // $_SESSION["pending_goto"] = ilLink::_getStaticLink($ref_id, $type);
1685 
1686  // keep original target
1687  $_SESSION["pending_goto"] = "goto.php?target=".$a_target;
1688 
1689  // redirect to 1st non-member object in path
1690  ilUtil::redirect("ilias.php?baseClass=ilRepositoryGUI".
1691  "&ref_id=".array_shift($block_obj));
1692  }
1693  }
1694 
1695  return $ret;
1696  }
1697 
1698  public function confirmRegistration()
1699  {
1700  global $lng, $ilias, $ilLog;
1701 
1702  ilUtil::setCookie('iltest', 'cookie', false);
1703 
1704  if(!isset($_GET['rh']) || !strlen(trim($_GET['rh'])))
1705  {
1706  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_confirmation_hash_not_passed');
1707  }
1708 
1709  try
1710  {
1711  require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
1712  $oRegSettings = new ilRegistrationSettings();
1713 
1714  $usr_id = ilObjUser::_verifyRegistrationHash(trim($_GET['rh']));
1715  $oUser = ilObjectFactory::getInstanceByObjId($usr_id);
1716  $oUser->setActive(true);
1717  if($oRegSettings->passwordGenerationEnabled())
1718  {
1719  $passwd = ilUtil::generatePasswords(1);
1720  $password = $passwd[0];
1721  $oUser->setPasswd($password, IL_PASSWD_PLAIN);
1722  $oUser->setLastPasswordChangeTS( time() );
1723  }
1724  $oUser->update();
1725 
1726  $usr_lang = $oUser->getPref('language');
1727 
1728  if($lng->getLangKey() != $usr_lang)
1729  {
1730  $lng = new ilLanguage($usr_lang);
1731  }
1732 
1733  $target = $oUser->getPref('reg_target');
1734  if(strlen($target) > 0)
1735  {
1736  $_GET['target'] = $target;
1737  }
1738 
1739  // send email
1740  // try individual account mail in user administration
1741  include_once("Services/Mail/classes/class.ilAccountMail.php");
1742  include_once './Services/User/classes/class.ilObjUserFolder.php';
1743  $amail = ilObjUserFolder::_lookupNewAccountMail($usr_lang);
1744  if (trim($amail["body"]) != "" && trim($amail["subject"]) != "")
1745  {
1746  $acc_mail = new ilAccountMail();
1747  $acc_mail->setUser($oUser);
1748  if($oRegSettings->passwordGenerationEnabled())
1749  {
1750  $acc_mail->setUserPassword($password);
1751  }
1752  $acc_mail->send();
1753  }
1754  else // do default mail
1755  {
1756  include_once 'Services/Mail/classes/class.ilMail.php';
1757  $mail_obj = new ilMail(ANONYMOUS_USER_ID);
1758 
1759  // mail subject
1760  $subject = $lng->txt("reg_mail_subject");
1761 
1762  // mail body
1763  $body = $lng->txt("reg_mail_body_salutation")." ".$oUser->getFullname().",\n\n".
1764  $lng->txt("reg_mail_body_text1")."\n\n".
1765  $lng->txt("reg_mail_body_text2")."\n".
1766  ILIAS_HTTP_PATH."/login.php?client_id=".CLIENT_ID."\n";
1767  $body .= $lng->txt("login").": ".$oUser->getLogin()."\n";
1768 
1769  if($oRegSettings->passwordGenerationEnabled())
1770  {
1771  $body.= $lng->txt("passwd").": ".$password."\n";
1772  }
1773 
1774  $body.= "\n";
1775  $body.= $lng->txt('reg_mail_body_forgot_password_info')."\n";
1776 
1777  $body.= "\n";
1778 
1779  $body .= ($lng->txt("reg_mail_body_text3")."\n\r");
1780  $body .= $oUser->getProfileAsString($lng);
1781  $mail_obj->enableSoap(false);
1782  $mail_obj->appendInstallationSignature(true);
1783  $mail_obj->sendMail($oUser->getEmail(), '', '',
1784  $subject,
1785  $body,
1786  array(), array('normal'));
1787  }
1788 
1789  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_account_confirmation_successful&lang='.$usr_lang);
1790  }
1791  catch(ilRegConfirmationLinkExpiredException $exception)
1792  {
1793  include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
1794  $soap_client = new ilSoapClient();
1795  $soap_client->setResponseTimeout(1);
1796  $soap_client->enableWSDL(true);
1797  $soap_client->init();
1798 
1799  $ilLog->write(__METHOD__.': Triggered soap call (background process) for deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
1800 
1801  $soap_client->call
1802  (
1803  'deleteExpiredDualOptInUserObjects',
1804  array
1805  (
1806  $_COOKIE['PHPSESSID'].'::'.$_COOKIE['ilClientId'], // session id and client id, not used for checking access -> not possible for anonymous
1807  $exception->getCode() // user id
1808  )
1809  );
1810 
1811  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$exception->getMessage()."&lang=".$usr_lang);
1812  }
1813  catch(ilRegistrationHashNotFoundException $exception)
1814  {
1815  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$exception->getMessage()."&lang=".$usr_lang);
1816  }
1817  }
1818 
1823  protected function showOpenIdLoginForm($page_editor_html)
1824  {
1825  global $lng,$tpl;
1826 
1827  include_once './Services/OpenId/classes/class.ilOpenIdSettings.php';
1828  if(!ilOpenIdSettings::getInstance()->isActive())
1829  {
1830  return $page_editor_html;
1831  }
1832 
1833  $lng->loadLanguageModule('auth');
1834 
1835  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1836  $form = new ilPropertyFormGUI();
1837  //$form->setTableWidth('500');
1838  $form->setShowTopButtons(false);
1839  $form->setFormAction($this->ctrl->getFormAction($this));
1840  $form->setTitle($lng->txt('login_to_ilias_via_openid'));
1841 
1842  $openid = new ilTextInputGUI($lng->txt('auth_openid_login'),'oid_username');
1843  $openid->setSize(18);
1844  $openid->setMaxLength(255);
1845  $openid->setRequired(true);
1846  $openid->setCssClass('ilOpenIDBox');
1847  $openid->setInfo($lng->txt('auth_openid_login_info_a'));
1848  $form->addItem($openid);
1849 
1850  include_once './Services/OpenId/classes/class.ilOpenIdProviders.php';
1851  $pro = new ilSelectInputGUI($lng->txt('auth_openid_provider'),'oid_provider');
1852  $pro->setOptions(ilOpenIdProviders::getInstance()->getProviderSelection());
1853  $pro->setValue(ilOpenIdProviders::getInstance()->getSelectedProvider());
1854  $form->addItem($pro);
1855  $form->addCommandButton("showLogin", $lng->txt("log_in"));
1856 
1857  return $this->substituteLoginPageElements(
1858  $tpl,
1859  $page_editor_html,
1860  $form->getHTML(),
1861  '[list-openid-login-form]',
1862  'OID_LOGIN_FORM'
1863  );
1864  }
1865 
1872  public static function initStartUpTemplate($a_tmpl, $a_show_back = false, $a_show_logout = false)
1873  {
1881  global $tpl, $lng, $ilCtrl, $ilSetting, $ilAccess;
1882 
1883  // #13574 - basic.js is included with ilTemplate, so jQuery is needed, too
1884  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1886 
1887  // framework is needed for language selection
1888  include_once("./Services/UICore/classes/class.ilUIFramework.php");
1890 
1891  $tpl->addBlockfile('CONTENT', 'content', 'tpl.startup_screen.html', 'Services/Init');
1892  $tpl->setVariable('HEADER_ICON', ilUtil::getImagePath('HeaderIcon.svg'));
1893 
1894  if($a_show_back)
1895  {
1896  // #13400
1897  $param = 'client_id=' . $_COOKIE['ilClientId'] . '&lang=' . $lng->getLangKey();
1898 
1899  $tpl->setCurrentBlock('link_item_bl');
1900  $tpl->setVariable('LINK_TXT', $lng->txt('login_to_ilias'));
1901  $tpl->setVariable('LINK_URL', 'login.php?cmd=force_login&'.$param);
1902  $tpl->parseCurrentBlock();
1903 
1904  if($ilSetting->get('pub_section') &&
1905  $ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID))
1906  {
1907  $tpl->setVariable('LINK_URL', 'index.php?'.$param);
1908  $tpl->setVariable('LINK_TXT', $lng->txt('home'));
1909  $tpl->parseCurrentBlock();
1910  }
1911  }
1912  else if($a_show_logout)
1913  {
1914  $tpl->setCurrentBlock('link_item_bl');
1915  $tpl->setVariable('LINK_TXT', $lng->txt('logout'));
1916  $tpl->setVariable('LINK_URL', ILIAS_HTTP_PATH . '/logout.php');
1917  $tpl->parseCurrentBlock();
1918  }
1919 
1920  if(is_array($a_tmpl))
1921  {
1922  $template_file = $a_tmpl[0];
1923  $template_dir = $a_tmpl[1];
1924  }
1925  else
1926  {
1927  $template_file = $a_tmpl;
1928  $template_dir = 'Services/Init';
1929  }
1930 
1931  //Header Title
1932 
1933  include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
1934  $header_top_title = ilObjSystemFolder::_getHeaderTitle();
1935  if (trim($header_top_title) != "" && $tpl->blockExists("header_top_title"))
1936  {
1937  $tpl->setCurrentBlock("header_top_title");
1938  $tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
1939  $tpl->parseCurrentBlock();
1940  }
1941 
1942  // language selection
1943  $selection = self::getLanguageSelection();
1944  if($selection)
1945  {
1946  $tpl->setCurrentBlock("lang_select");
1947  $tpl->setVariable("TXT_LANGSELECT", $lng->txt("language"));
1948  $tpl->setVariable("LANG_SELECT", $selection);
1949  $tpl->parseCurrentBlock();
1950  }
1951 
1952  $tpl->addBlockFile('STARTUP_CONTENT', 'startup_content', $template_file, $template_dir);
1953  }
1954 
1959  protected static function getLanguageSelection()
1960  {
1961  include_once("./Services/MainMenu/classes/class.ilMainMenuGUI.php");
1963  }
1964 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
showLogout()
show logout screen
static _destroy($a_session_id, $a_closing_context=null, $a_expired_at=null)
Destroy session.
static applyRoleAssignments(ilObjUser $user, $code)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
ILIAS Setting Class.
const AUTH_MODE_INACTIVE
const AUTH_USER_INACTIVE
$failure
& executeCommand()
execute command
const IL_PASSWD_PLAIN
Login page GUI class.
initCodeForm($a_username)
const SESSION_CLOSE_CAPTCHA
exit
Definition: login.php:54
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static applyAccessLimits(ilObjUser $user, $code)
$_POST['username']
Definition: cron.php:12
showCodeForm($a_username=null, $a_form=null)
const AUTH_USER_WRONG_IP
getLoginPageEditorHTML()
Get HTML of ILIAS login page editor.
Administrates DB connections in setup.
showOpenIdLoginForm($page_editor_html)
Show openid login if enabled.
static goToPublicSection($a_auth_stat="")
go to public section
static getInstance()
Get singleton instance.
$_SESSION["AccountId"]
This class represents a selection list property in a property form.
_getLocalAccountsForEmail($a_email)
check whether external account and authentication method matches with a user
static _hasMultipleAuthenticationMethods()
This class represents a property form user interface.
Class ilAccountRegistrationGUI.
This class represents a captcha input in a property form.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
$tbl
Definition: example_048.php:81
const SESSION_CLOSE_INACTIVE
$location
Definition: buildRTE.php:44
Overwritten Pear class AuthContainerLDAP This class is overwritten to support nested groups...
Class for user related exception handling in ILIAS.
_registrationEnabled($a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
$code
Definition: example_050.php:99
showShibbolethLoginForm($page_editor_html)
Show shibboleth login form.
$valid
const AUTH_CAPTCHA_INVALID
$_COOKIE["ilClientId"]
Definition: cron.php:11
const AUTH_CAS
$cmd
Definition: sahs_server.php:35
const AUTH_SHIBBOLETH
static get($a_var)
Get a value.
const AUTH_RADIUS_NO_ILIAS_USER
static useCode($code)
const SESSION_CLOSE_TIME
static set($a_var, $a_val)
Set a value.
static _lookupId($a_user_str)
Lookup id by login.
migrateAccount()
migrate account
const AUTH_CAS_NO_ILIAS_USER
static generatePasswords($a_number)
Generate a number of passwords.
static getDefaultMemberRole($a_ref_id)
Class ilTableGUI.
processIndexPHP()
process index.php
Authentication against ILIAS database.
getAcceptance()
Get terms of service.
const AUTH_USER_TIME_LIMIT_EXCEEDED
ilStartUpGUI()
constructor
setRetype($a_val)
Set retype on/off.
static getStartingPointAsUrl()
Get current starting point setting as URL.
Class ShibbolethWAYF.
getSyntaxStylePath()
get syntax style path
static _getAllReferences($a_id)
get all reference ids of object
static _verifyRegistrationHash($a_hash)
Verifies a registration hash.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
client management
showLogin()
show login
_existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
const AUTH_APACHE_FAILED
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.
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
This class represents a property in a property form.
$data
setValue($a_value)
Set Value.
$success
Definition: Utf8Test.php:87
static getMailToAddress()
Get mailto: email.
addSubItem($a_item)
Add Subitem.
_isActivated($a_obj_id)
Is activated.
const AUTH_SOAP_NO_ILIAS_USER
static _getMultipleAuthModeOptions($lng)
const SESSION_CLOSE_USER
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class Mail this class handles base functions for mail handling.
static _lookupObjId($a_id)
StartUp GUI class.
special template class to simplify handling of ITX/PEAR
purgePlaceholders($page_editor_html)
Purge page editor html from unused placeholders.
setSize($a_size)
Set Size.
_lookupContObjID($a_id)
get learning module / digibook id for lm object
static setContext($a_context)
set context
static getLanguageSelection($a_in_topbar=false)
This class represents a text property in a property form.
showLoginForm($page_editor_html)
Show login form ilSetting $ilSetting.
showRegistrationLinks($page_editor_html)
Show registration, password forgotten, client slection links ilLanguage $lng ilSetting $ilSetting ...
global $ilIliasIniFile
This class represents a password property in a property form.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
showClientList()
show client list
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setOptions($a_options)
Set Options.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance()
Get singleton instance.
static _assignObjectsToUserId($a_user_id)
Password assistance facility for users who have forgotten their password or for users for whom no pas...
static trackAcceptance(ilObjUser $user, ilTermsOfServiceSignableDocument $document)
static getCodeValidUntil($code)
const AUTH_USER_SIMULTANEOUS_LOGIN
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const AUTH_LDAP_NO_ILIAS_USER
showNoCookiesScreen()
show help screen, if cookies are disabled
const SESSION_CLOSE_SIMUL
Class ilObjAuthSettingsGUI.
static getLanguageSelection()
language selection list
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 $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
getContentStylePath($a_style_id)
get content style path
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
showLoginInformation($page_editor_html)
Show login information.
Overwritten Pear class AuthContainerRadius This class is overwritten to support to perform Radius aut...
Authentication against ILIAS database.
static lookupId($a_lang_key)
Lookup obj_id of language ilDB $ilDB.
Class ilAccountMail.
static factory(ilAuthContainerBase $deco)
The factory.
static initjQuery($a_tpl=null)
Init jQuery.
Class ilObjGroup.
static isUnusedCode($code)
language handling
static getLogger($a_component_id)
Get component logger.
const AUTH_WRONG_LOGIN
Returned if container is unable to authenticate user/password pair.
Definition: Auth.php:38
static getInstance()
Get singelton instance.
$client_id
const AUTH_USER_INACTIVE_LOGIN_ATTEMPTS
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
Class for user related exception handling in ILIAS.
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.
setRequired($a_required)
Set Required.
const SESSION_CLOSE_IP
const IL_COMP_SERVICE
Pear auth container for openid
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
jumpToPasswordAssistance()
jump to password assistance
jumpToRegistration()
jump to registration gui
init($a_tpl=null)
Init.