ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
14 {
15 
19  function ilStartUpGUI()
20  {
21  global $ilCtrl;
22 
23  $this->ctrl =& $ilCtrl;
24 
25  $ilCtrl->saveParameter($this, array("rep_ref_id", "lang", "target", "client_id"));
26  }
27 
31  function &executeCommand()
32  {
33  $cmd = $this->ctrl->getCmd("processIndexPHP");
34  $next_class = $this->ctrl->getNextClass($this);
35 
36  switch($next_class)
37  {
38  case "ilaccountregistrationgui":
39  require_once("Services/Registration/classes/class.ilAccountRegistrationGUI.php");
40  return $this->ctrl->forwardCommand(new ilAccountRegistrationGUI());
41  break;
42 
43  case "ilpasswordassistancegui":
44  require_once("Services/Init/classes/class.ilPasswordAssistanceGUI.php");
45  return $this->ctrl->forwardCommand(new ilPasswordAssistanceGUI());
46  break;
47 
48  default:
49  return $this->$cmd();
50  break;
51  }
52  }
53 
57  function jumpToRegistration()
58  {
59  $this->ctrl->setCmdClass("ilaccountregistrationgui");
60  $this->ctrl->setCmd("");
61  $this->executeCommand();
62  }
63 
68  {
69  $this->ctrl->setCmdClass("ilpasswordassistancegui");
70  $this->ctrl->setCmd("");
71  $this->executeCommand();
72  }
73 
77  function showLogin()
78  {
79  global $ilSetting, $ilAuth, $ilUser, $tpl, $ilIliasIniFile, $ilias, $lng;
80 
81  // if authentication of soap user failed, but email address is
82  // known, show users and ask for password
83  $status = $ilAuth->getStatus();
84  if ($status == "")
85  {
86  $status = $_GET["auth_stat"];
87  }
88  if ($status == AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL)
89  {
90  $this->showUserMappingSelection();
91  return;
92  }
93 
94  // login language selection is post type
95  if ($_POST["lang"] != "")
96  {
97  $_GET["lang"] = ilUtil::stripSlashes($_POST["lang"]);
98  }
99 
100  // check for session cookies enabled
101  if (!isset($_COOKIE['iltest']))
102  {
103  if (empty($_GET['cookies']))
104  {
105  $additional_params = '';
106  if((int)$_GET['forceShoppingCartRedirect'] && (int)$_SESSION['price_id'] && (int)$_SESSION['pobject_id'])
107  {
108  $additional_params .= '&login_to_purchase_object=1&forceShoppingCartRedirect=1';
109  }
110 
111  ilUtil::setCookie("iltest","cookie",false);
112  //header('Location: '.$_SERVER['PHP_SELF']."?target=".$_GET["target"]."&soap_pw=".$_GET["soap_pw"]."&ext_uid=".$_GET["ext_uid"]."&cookies=nocookies&client_id=".$_GET['client_id']."&lang=".$_GET['lang']);
113  header("Location: login.php?target=".$_GET["target"]."&soap_pw=".$_GET["soap_pw"]."&ext_uid=".$_GET["ext_uid"]."&cookies=nocookies&client_id=".rawurlencode(CLIENT_ID)."&lang=".$_GET['lang'].$additional_params);
114  }
115  else
116  {
117  $_COOKIE['iltest'] = "";
118  }
119  }
120  else
121  {
122  unset($_GET['cookies']);
123  }
124 
125  // check correct setup
126  if (!$ilSetting->get("setup_ok"))
127  {
128  die("Setup is not completed. Please run setup routine again. (Login)");
129  }
130 
131  if ($ilSetting->get("shib_active") && $ilSetting->get("shib_hos_type"))
132  {
133  require_once "./Services/AuthShibboleth/classes/class.ilShibbolethWAYF.php";
134  // Check if we user selects Home Organization
135  $WAYF = new ShibWAYF();
136  }
137 
138  if (isset($WAYF) && $WAYF->isSelection())
139  {
140  if ($WAYF->isValidSelection())
141  {
142  // Set cookie
143  $WAYF->setSAMLCookie();
144 
145  // Redirect
146  $WAYF->redirect();
147  }
148  }
149  elseif ($ilAuth->getAuth())
150  {
151  // Or we do authentication here
152  // To do: check whether some $ilInit method could be used here.
153 
154  if(!$ilUser->checkTimeLimit())
155  {
156  $ilAuth->logout();
157  session_destroy();
158 
159  // to do: get rid of this
160  ilUtil::redirect('login.php?time_limit=true');
161  }
162 
163  include_once './Services/Tracking/classes/class.ilOnlineTracking.php';
164  ilOnlineTracking::_addUser($ilUser->getId());
165 
166  // handle chat kicking
167  if ($ilSetting->get("chat_active"))
168  {
169  include_once "./Modules/Chat/classes/class.ilChatServerCommunicator.php";
170  include_once "./Modules/Chat/classes/class.ilChatRoom.php";
171 
173  ilChatRoom::_unkick($ilUser->getId());
174  }
175 
176  // update last forum visit
177  include_once './Modules/Forum/classes/class.ilObjForum.php';
178  ilObjForum::_updateOldAccess($ilUser->getId());
179 
180  if ($_GET["rep_ref_id"] != "")
181  {
182  $_GET["ref_id"] = $_GET["rep_ref_id"];
183  }
184  $this->processStartingPage();
185  exit;
186  }
187 
188  // Instantiate login template
189  // Use Shibboleth-only authentication if auth_mode is set to Shibboleth
190  $tpl->addBlockFile("CONTENT", "content", "tpl.login.html",
191  "Services/Init");
192 
193  //language handling
194  if ($_GET["lang"] == "")
195  {
196  $_GET["lang"] = $ilIliasIniFile->readVariable("language","default");
197  }
198 
199  //instantiate language
200  $lng = new ilLanguage($_GET["lang"]);
201 
202  $tpl->setVariable("PAGETITLE", $lng->txt("startpage"));
203  $tpl->setVariable("TXT_OK", $lng->txt("ok"));
204 
205  $languages = $lng->getInstalledLanguages();
206 
207  foreach ($languages as $lang_key)
208  {
209  $tpl->setCurrentBlock("languages");
210  $tpl->setVariable("LANG_KEY", $lang_key);
211  $tpl->setVariable("LANG_NAME",
212  ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_".$lang_key));
213  $tpl->setVariable("BORDER", 0);
214  $tpl->setVariable("VSPACE", 0);
215  $tpl->parseCurrentBlock();
216  }
217 
218  // allow new registrations?
219  include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
221  {
222  $tpl->setCurrentBlock("new_registration");
223  $tpl->setVariable("REGISTER", $lng->txt("registration"));
224  $tpl->setVariable("CMD_REGISTER",
225  $this->ctrl->getLinkTargetByClass("ilaccountregistrationgui", ""));
226  $tpl->parseCurrentBlock();
227  }
228  // allow password assistance? Surpress option if Authmode is not local database
229  if ($ilSetting->get("password_assistance"))
230  {
231  $tpl->setCurrentBlock("password_assistance");
232  $tpl->setVariable("FORGOT_PASSWORD", $lng->txt("forgot_password"));
233  $tpl->setVariable("FORGOT_USERNAME", $lng->txt("forgot_username"));
234  $tpl->setVariable("CMD_FORGOT_PASSWORD",
235  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", ""));
236  $tpl->setVariable("CMD_FORGOT_USERNAME",
237  $this->ctrl->getLinkTargetByClass("ilpasswordassistancegui", "showUsernameAssistanceForm"));
238  $tpl->setVariable("LANG_ID", $_GET["lang"]);
239  $tpl->parseCurrentBlock();
240  }
241 
242  if ($ilSetting->get("pub_section"))
243  {
244  $tpl->setCurrentBlock("homelink");
245  $tpl->setVariable("CLIENT_ID","?client_id=".$_COOKIE["ilClientId"]."&lang=".$_GET["lang"]);
246  $tpl->setVariable("TXT_HOME",$lng->txt("home"));
247  $tpl->parseCurrentBlock();
248  }
249 
250  if ($ilIliasIniFile->readVariable("clients","list"))
251  {
252  $tpl->setCurrentBlock("client_list");
253  $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
254  $tpl->setVariable("CMD_CLIENT_LIST",
255  $this->ctrl->getLinkTarget($this, "showClientList"));
256  $tpl->parseCurrentBlock();
257  }
258 
259  // shibboleth login link
260  if ($ilSetting->get("shib_active"))
261  {
262  if($ilSetting->get("shib_hos_type") != 'external_wayf'){
263  $tpl->setCurrentBlock("shibboleth_wayf_login");
264  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
265  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
266  $tpl->setVariable("TXT_SELECT_HOME_ORGANIZATION", sprintf($lng->txt("shib_select_home_organization"), $ilSetting->get("shib_federation_name")));
267  $tpl->setVariable("TXT_CONTINUE", $lng->txt("btn_next"));
268  $tpl->setVariable("TXT_SHIB_HOME_ORGANIZATION", $lng->txt("shib_home_organization"));
269  $tpl->setVariable("TXT_SHIB_LOGIN_INSTRUCTIONS", $lng->txt("shib_general_wayf_login_instructions").' <a href="mailto:'.$ilias->getSetting("admin_email").'">ILIAS '. $lng->txt("administrator").'</a>.');
270  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
271  $tpl->setVariable("TXT_SHIB_INVALID_SELECTION", $WAYF->showNotice());
272  $tpl->setVariable("SHIB_IDP_LIST", $WAYF->generateSelection());
273  $tpl->setVariable("ILW_TARGET", $_GET["target"]);
274 
275  $tpl->parseCurrentBlock();
276  } else {
277  $tpl->setCurrentBlock("shibboleth_login");
278  $tpl->setVariable("TXT_SHIB_LOGIN", $lng->txt("login_to_ilias_via_shibboleth"));
279  $tpl->setVariable("IL_TARGET", $_GET["target"]);
280  $tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $ilSetting->get("shib_federation_name"));
281  $tpl->setVariable("TXT_SHIB_LOGIN_BUTTON", $ilSetting->get("shib_login_button"));
282  $tpl->setVariable("TXT_SHIB_LOGIN_INSTRUCTIONS", sprintf($lng->txt("shib_general_login_instructions"),$ilSetting->get("shib_federation_name")).' <a href="mailto:'.$ilias->getSetting("admin_email").'">ILIAS '. $lng->txt("administrator").'</a>.');
283  $tpl->setVariable("TXT_SHIB_CUSTOM_LOGIN_INSTRUCTIONS", $ilSetting->get("shib_login_instructions"));
284  $tpl->parseCurrentBlock();
285  }
286  }
287 
288  // cas login link
289  if ($ilSetting->get("cas_active"))
290  {
291  $tpl->setCurrentBlock("cas_login");
292  $tpl->setVariable("TXT_CAS_LOGIN", $lng->txt("login_to_ilias_via_cas"));
293  $tpl->setVariable("TXT_CAS_LOGIN_BUTTON", ilUtil::getImagePath("cas_login_button.gif"));
294  $tpl->setVariable("TXT_CAS_LOGIN_INSTRUCTIONS", $ilSetting->get("cas_login_instructions"));
295  $this->ctrl->setParameter($this, "forceCASLogin", "1");
296  $tpl->setVariable("TARGET_CAS_LOGIN",
297  $this->ctrl->getLinkTarget($this, "showLogin"));
298  $this->ctrl->setParameter($this, "forceCASLogin", "");
299  $tpl->parseCurrentBlock();
300  }
301 
302  // Show selection of auth modes
303  include_once('./Services/Authentication/classes/class.ilAuthModeDetermination.php');
305  if(ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection())
306  {
307  foreach(ilAuthUtils::_getMultipleAuthModeOptions($lng) as $key => $option)
308  {
309  $tpl->setCurrentBlock('auth_mode_row');
310  $tpl->setVariable('VAL_AUTH_MODE',$key);
311  $tpl->setVariable('AUTH_CHECKED',isset($option['checked']) ? 'checked=checked' : '');
312  $tpl->setVariable('TXT_AUTH_MODE',$option['txt']);
313  $tpl->parseCurrentBlock();
314  }
315 
316  $tpl->setCurrentBlock('auth_selection');
317  $tpl->setVariable('TXT_AUTH_MODE',$lng->txt('auth_selection'));
318  $tpl->parseCurrentBlock();
319  }
320  // login via ILIAS (this also includes radius and ldap)
321  // If local authentication is enabled for shibboleth users, we
322  // display the login form for ILIAS here.
323  if (($ilSetting->get("auth_mode") != AUTH_SHIBBOLETH ||
324  $ilSetting->get("shib_auth_allow_local")) &&
325  $ilSetting->get("auth_mode") != AUTH_CAS)
326  {
327  $loginSettings = new ilSetting("login_settings");
328  if ($_GET["lang"] == false)
329  {
330  $information = $loginSettings->get("login_message_".$lng->getDefaultLanguage());
331  }
332  else
333  {
334  $information = $loginSettings->get("login_message_".$_GET["lang"]);
335  }
336 
337  if(strlen(trim($information)))
338  {
339  $tpl->setVariable("TXT_LOGIN_INFORMATION", $information);
340  }
341 
342  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
343  $form = new ilPropertyFormGUI();
344  $form->setOpenTag(false);
345  $form->setCloseTag(false);
346  $form->setTitle($lng->txt("login_to_ilias"));
347 
348  // auth selection
349  include_once('./Services/Authentication/classes/class.ilAuthModeDetermination.php');
351  if(ilAuthUtils::_hasMultipleAuthenticationMethods() and $det->isManualSelection())
352  {
353  /*foreach(ilAuthUtils::_getMultipleAuthModeOptions($lng) as $key => $option)
354  {
355  $tpl->setCurrentBlock('auth_mode_row');
356  $tpl->setVariable('VAL_AUTH_MODE',$key);
357  $tpl->setVariable('AUTH_CHECKED',isset($option['checked']) ? 'checked=checked' : '');
358  $tpl->setVariable('TXT_AUTH_MODE',$option['txt']);
359  $tpl->parseCurrentBlock();
360  }
361 
362  $tpl->setCurrentBlock('auth_selection');
363  $tpl->setVariable('TXT_AUTH_MODE',$lng->txt('auth_selection'));
364  $tpl->parseCurrentBlock();*/
365 
366  //
367  $radg = new ilRadioGroupInputGUI($lng->txt("auth_selection"), "auth_mode");
368  foreach(ilAuthUtils::_getMultipleAuthModeOptions($lng) as $key => $option)
369  {
370  $op1 = new ilRadioOption($option['txt'], $key);
371  $radg->addOption($op1);
372  if (isset($option['checked']))
373  {
374  $radg->setValue($key);
375  }
376  }
377 
378  $form->addItem($radg);
379  }
380 
381  // username
382  $ti = new ilTextInputGUI($lng->txt("username"), "username");
383  $ti->setSize(20);
384  $form->addItem($ti);
385 
386  // password
387  $pi = new ilPasswordInputGUI($lng->txt("password"), "password");
388  $pi->setRetype(false);
389  $pi->setSize(20);
390  $form->addItem($pi);
391  $form->addCommandButton("butSubmit", $lng->txt("log_in"));
392  $tpl->setVariable("LOGIN_FORM", $form->getHTML());
393 
394  $tpl->setVariable("TXT_ILIAS_LOGIN", $lng->txt("login_to_ilias"));
395  $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
396  $tpl->setVariable("TXT_PASSWORD", $lng->txt("password"));
397  $tpl->setVariable("USERNAME", ilUtil::prepareFormOutput($_POST["username"], true));
398  $tpl->setVariable("TXT_SUBMIT", $lng->txt("submit"));
399  $tpl->parseCurrentBlock();
400  }
401 
402  $tpl->setVariable("ILIAS_RELEASE", $ilSetting->get("ilias_version"));
403 
404  if((int)$_GET['forceShoppingCartRedirect'])
405  $this->ctrl->setParameter($this, 'forceShoppingCartRedirect', 1);
406 
407  $this->ctrl->setTargetScript("login.php");
408  $tpl->setVariable("FORMACTION",
409  $this->ctrl->getFormAction($this));
410 //echo "-".htmlentities($this->ctrl->getFormAction($this, "showLogin"))."-";
411  $tpl->setVariable("LANG_FORM_ACTION",
412  $this->ctrl->getFormAction($this));
413  $tpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
414  $tpl->setVariable("LANG_ID", $_GET["lang"]);
415 
416  if($_GET['inactive'])
417  {
418  $this->showFailure($lng->txt("err_inactive"));
419  }
420  else if($_GET['expired'])
421  {
422  $this->showFailure($lng->txt("err_session_expired"));
423  }
424  else if($_GET['login_to_purchase_object'])
425  {
426  $lng->loadLanguageModule('payment');
427  $this->showFailure($lng->txt("payment_login_to_buy_object"));
428  }
429  else if(isset($_GET['reg_confirmation_msg']) && strlen(trim($_GET['reg_confirmation_msg'])))
430  {
431  $lng->loadLanguageModule('registration');
432  if($_GET['reg_confirmation_msg'] == 'reg_account_confirmation_successful')
433  $this->showSuccess($lng->txt(trim($_GET['reg_confirmation_msg'])));
434  else
435  $this->showFailure($lng->txt(trim($_GET['reg_confirmation_msg'])));
436  }
437 
438  // TODO: Move this to header.inc since an expired session could not detected in login script
439  $status = $ilAuth->getStatus();
440 
441 
442  if ($status == "")
443  {
444  $status = $_GET["auth_stat"];
445  }
446  $auth_error = $ilias->getAuthError();
447 
448  if (!empty($status))
449  {
450  switch ($status)
451  {
452  case AUTH_EXPIRED:
453  $this->showFailure($lng->txt("err_session_expired"));
454  break;
455  case AUTH_IDLED:
456  // lang variable err_idled not existing
457  //$tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_idled"));
458  break;
459 
461  $this->showFailure($lng->txt("err_auth_cas_no_ilias_user"));
462  break;
463 
465  $this->showFailure($lng->txt("err_auth_soap_no_ilias_user"));
466  break;
467 
469  $this->showFailure($lng->txt("err_auth_ldap_no_ilias_user"));
470  break;
471 
473  $this->showFailure($lng->txt("err_auth_radius_no_ilias_user"));
474  break;
475 
476  case AUTH_MODE_INACTIVE:
477  $this->showFailure($lng->txt("err_auth_mode_inactive"));
478  break;
479 
480 
481  case AUTH_WRONG_LOGIN:
482  default:
483  $add = "";
484  if (is_object($auth_error))
485  {
486  $add = "<br>".$auth_error->getMessage();
487  }
488  $this->showFailure($lng->txt("err_wrong_login").$add);
489  break;
490  }
491  }
492 
493 
494  if ($_GET['time_limit'])
495  {
496  $this->showFailure($lng->txt("time_limit_reached"));
497  }
498 
499  // output wrong IP message
500  if($_GET['wrong_ip'])
501  {
502  $this->showFailure($lng->txt("wrong_ip_detected")." (".$_SERVER["REMOTE_ADDR"].")");
503  }
504 
505  // outout simultaneous login message
506  if($_GET['simultaneous_login'])
507  {
508  $this->showFailure($lng->txt("simultaneous_login_detected"));
509  }
510 
511  $this->ctrl->setTargetScript("ilias.php");
512  $tpl->setVariable("PHP_SELF", $_SERVER['PHP_SELF']);
513  $tpl->setVariable("USER_AGREEMENT", $lng->txt("usr_agreement"));
514  $tpl->setVariable("LINK_USER_AGREEMENT",
515  $this->ctrl->getLinkTarget($this, "showUserAgreement"));
516 
517  // browser does not accept cookies
518  if ($_GET['cookies'] == 'nocookies')
519  {
520  $this->showFailure($lng->txt("err_no_cookies"));
521  $tpl->setVariable("COOKIES_HOWTO", $lng->txt("cookies_howto"));
522  $tpl->setVariable("LINK_NO_COOKIES",
523  $this->ctrl->getLinkTarget($this, "showNoCookiesScreen"));
524  }
525 
526  $tpl->show("DEFAULT", false);
527  }
528 
529  function showFailure($a_mess)
530  {
531  global $tpl, $lng;
532 
533  $tpl->setCurrentBlock("warning");
534  $tpl->setVariable('TXT_MSG_LOGIN_FAILED', $a_mess);
535  $tpl->setVariable("MESSAGE_HEADING", $lng->txt("failure_message"));
536  $tpl->setVariable("ALT_IMAGE", $lng->txt("icon")." ".$lng->txt("failure_message"));
537  $tpl->setVariable("SRC_IMAGE", ilUtil::getImagePath("mess_failure.gif"));
538  $tpl->parseCurrentBlock();
539  }
540 
541  public function showSuccess($a_mess)
542  {
543  global $tpl, $lng;
544 
545  $tpl->setCurrentBlock('success');
546  $tpl->setVariable('TXT_MSG_LOGIN_SUCCESS', $a_mess);
547  $tpl->setVariable('MESSAGE_HEADING', $lng->txt('success_message'));
548  $tpl->setVariable('ALT_IMAGE', $lng->txt('icon').' '.$lng->txt('success_message'));
549  $tpl->setVariable('SRC_IMAGE', ilUtil::getImagePath('mess_success.gif'));
550  $tpl->parseCurrentBlock();
551  }
552 
560  public function showAccountMigration($a_message = '')
561  {
562  global $tpl,$lng;
563 
564  $lng->loadLanguageModule('auth');
565  $tpl->addBlockFile("CONTENT", "content", "tpl.login_account_migration.html",
566  "Services/Init");
567  $tpl->addJavaScript('./Services/Authentication/js/account_migration.js');
568 
569  if(strlen($a_message))
570  {
571  ilUtil::sendInfo($a_message);
572  }
573  $tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this,'migrateAccount'));
574  $tpl->setVariable('TXT_ACCOUNT_MIGRATION',$lng->txt('auth_account_migration'));
575  $tpl->setVariable('INFO_MIGRATE',$lng->txt('auth_info_migrate'));
576  $tpl->setVariable('INFO_ADD',$lng->txt('auth_info_add'));
577 
578  $tpl->setVariable('MIG_USER',$_POST['username']);
579  $tpl->setVariable('TXT_USER',$lng->txt('login'));
580  $tpl->setVariable('TXT_PASS',$lng->txt('password'));
581 
582  $tpl->setVariable('TXT_SUBMIT',$lng->txt('save'));
583  $tpl->setVariable('TXT_CANCEL',$lng->txt('cancel'));
584 
585  $tpl->show('DEFAULT');
586  }
587 
594  public function migrateAccount()
595  {
596  global $lng,$ilClientIniFile,$ilLog,$rbacadmin;
597 
598  $lng->loadLanguageModule('auth');
599 
600  if(!isset($_POST['account_migration']))
601  {
602  $this->showAccountMigration($lng->txt('err_choose_migration_type'));
603  return false;
604  }
605 
606  if($_POST['account_migration'] == 1 and (!strlen($_POST['mig_username']) or !strlen($_POST['mig_password'])))
607  {
608  $this->showAccountMigration($lng->txt('err_wrong_login'));
609  return false;
610  }
611 
612  if($_POST['account_migration'] == 1)
613  {
614  if(!$user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST['mig_username'])))
615  {
616  $this->showAccountMigration($lng->txt('err_wrong_login'));
617  return false;
618  }
619  $_POST['username'] = $_POST['mig_username'];
620  $_POST['password'] = $_POST['mig_password'];
621 
622  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
623  include_once './Services/Database/classes/class.ilAuthContainerMDB2.php';
624 
626  $ilAuth->start();
627  if(!$ilAuth->checkAuth())
628  {
629  $ilAuth->logout();
630  $this->showAccountMigration($lng->txt('err_wrong_login'));
631  return false;
632  }
633 
634  $user = new ilObjUser($user_id);
635  $user->setAuthMode($_SESSION['tmp_auth_mode']);
636  $user->setExternalAccount($_SESSION['tmp_external_account']);
637  $user->update();
638 
639  // Assign to default role
640  if(is_array($_SESSION['tmp_roles']))
641  {
642  foreach($_SESSION['tmp_roles'] as $role)
643  {
644  $rbacadmin->assignUser((int) $role,$user->getId());
645  }
646  }
647 
648  // Log migration
649  $ilLog->write(__METHOD__.': Migrated '.$_SESSION['tmp_external_account'].' to ILIAS account '.$user->getLogin().'.');
650  }
651  elseif($_POST['account_migration'] == 2)
652  {
653  switch($_SESSION['tmp_auth_mode'])
654  {
655  case 'ldap':
656  $_POST['username'] = $_SESSION['tmp_external_account'];
657  $_POST['password'] = $_SESSION['tmp_pass'];
658 
659  include_once('Services/LDAP/classes/class.ilAuthContainerLDAP.php');
660  $container = new ilAuthContainerLDAP();
661  $container->forceCreation(true);
662  $ilAuth = ilAuthFactory::factory($container);
663  $ilAuth->start();
664  break;
665 
666  case 'radius':
667  $_POST['username'] = $_SESSION['tmp_external_account'];
668  $_POST['password'] = $_SESSION['tmp_pass'];
669 
670  include_once './Services/Authentication/classes/class.ilAuthFactory.php';
671  include_once './Services/Radius/classes/class.ilAuthContainerRadius.php';
672 
673  $container = new ilAuthContainerRadius();
674  $container->forceCreation(true);
675  $ilAuth = ilAuthFactory::factory($container);
676  $ilAuth->start();
677  break;
678  }
679  }
680  // show personal desktop
681  ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
682  }
683 
687  function showLogout()
688  {
690 
691  // LOGOUT CHAT USER
692  if($ilSetting->get("chat_active"))
693  {
694  include_once "./Modules/Chat/classes/class.ilChatServerCommunicator.php";
696  }
697 
698  $ilAuth->logout();
699  session_destroy();
700 
701  // reset cookie
702  $client_id = $_COOKIE["ilClientId"];
703  ilUtil::setCookie("ilClientId","");
704 
705  //instantiate logout template
706  $tpl->addBlockFile("CONTENT", "content", "tpl.logout.html",
707  "Services/Init");
708 
709  if ($ilSetting->get("pub_section"))
710  {
711  $tpl->setCurrentBlock("homelink");
712  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$_GET['lang']);
713  $tpl->setVariable("TXT_HOME",$lng->txt("home"));
714  $tpl->parseCurrentBlock();
715  }
716 
717  if ($ilIliasIniFile->readVariable("clients","list"))
718  {
719  $tpl->setCurrentBlock("client_list");
720  $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
721  $this->ctrl->setParameter($this, "client_id", $client_id);
722  $tpl->setVariable("CMD_CLIENT_LIST",
723  $this->ctrl->getLinkTarget($this, "showClientList"));
724  $tpl->parseCurrentBlock();
725  $this->ctrl->setParameter($this, "client_id", "");
726  }
727 
728  $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout"));
729  $tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text"));
730  $tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
731  $tpl->setVariable("CLIENT_ID","?client_id=".$client_id."&lang=".$_GET['lang']);
732 
733  $tpl->show();
734  }
735 
741  {
742  global $ilAuth, $tpl, $lng;
743 
744  $valid = $ilAuth->getValidationData();
745 
746  $tpl->addBlockFile("CONTENT", "content", "tpl.user_mapping_selection.html",
747  "Services/Init");
748  $email_user = ilObjUser::_getLocalAccountsForEmail($valid["email"]);
749 
750 
751  if ($ilAuth->sub_status == AUTH_WRONG_LOGIN)
752  {
753  $this->showFailure($lng->txt("err_wrong_login"));
754  }
755 
756  include_once('./Services/User/classes/class.ilObjUser.php');
757  if (count($email_user) == 1)
758  {
759  //$user = new ilObjUser(key($email_user));
760  $tpl->setCurrentBlock("one_user");
761  $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
762  $tpl->setVariable("VAL_USERNAME", current($email_user));
763  $tpl->setVariable("USER_ID", key($email_user));
764  $tpl->parseCurrentBlock();
765  }
766  else
767  {
768  foreach($email_user as $key => $login)
769  {
770  $tpl->setCurrentBlock("user");
771  $tpl->setVariable("USR_ID", $key);
772  $tpl->setVariable("VAL_USER", $login);
773  $tpl->parseCurrentBlock();
774  }
775  $tpl->setCurrentBlock("multpiple_user");
776  $tpl->parseCurrentBlock();
777  }
778 
779  $tpl->setCurrentBlock("content");
780  $this->ctrl->setParameter($this, "ext_uid", urlencode($_GET["ext_uid"]));
781  $this->ctrl->setParameter($this, "soap_pw", urlencode($_GET["soap_pw"]));
782  $this->ctrl->setParameter($this, "auth_stat", $_GET["auth_stat"]);
783  $tpl->setVariable("FORMACTION",
784  $this->ctrl->getFormAction($this));
785  $tpl->setVariable("TXT_ILIAS_LOGIN", $lng->txt("login_to_ilias"));
786  if (count($email_user) == 1)
787  {
788  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation"));
789  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_2"));
790  }
791  else
792  {
793  $tpl->setVariable("TXT_EXPLANATION", $lng->txt("ums_explanation_3"));
794  $tpl->setVariable("TXT_EXPLANATION_2", $lng->txt("ums_explanation_4"));
795  }
796  $tpl->setVariable("TXT_CREATE_USER", $lng->txt("ums_create_new_account"));
797  $tpl->setVariable("TXT_PASSWORD", $lng->txt("password"));
798  $tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST["password"]));
799  $tpl->setVariable("TXT_SUBMIT", $lng->txt("login"));
800 
801  $tpl->show();
802  }
803 
807  function showClientList()
808  {
809  global $tpl, $ilIliasIniFile, $ilCtrl;
810 //echo "1";
811  if (!$ilIliasIniFile->readVariable("clients","list"))
812  {
813  $this->processIndexPHP();
814  return;
815  }
816 //echo "2";
817  $tpl = new ilTemplate("tpl.main.html", true, true);
818 
819  // to do: get standard style
820  $tpl->setVariable("PAGETITLE","Client List");
821  $tpl->setVariable("LOCATION_STYLESHEET","./templates/default/delos.css");
822 
823  // load client list template
824  $tpl->addBlockfile("CONTENT", "content", "tpl.client_list.html",
825  "Services/Init");
826 
827  // load template for table
828  $tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html");
829 
830  // load template for table content data
831  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
832 
833  // load table content data
834  require_once("setup/classes/class.ilClientList.php");
835  require_once("setup/classes/class.ilClient.php");
836  require_once("setup/classes/class.ilDBConnections.php");
837  require_once("./Services/Table/classes/class.ilTableGUI.php");
838  $this->db_connections = new ilDBConnections();
839  $clientlist = new ilClientList($this->db_connections);
840  $list = $clientlist->getClients();
841 
842  if (count($list) == 0)
843  {
844  header("Location: ./setup/setup.php");
845  exit();
846  }
847 
848  foreach ($list as $key => $client)
849  {
850  $client->setDSN();
851  if ($client->checkDatabaseExists() and $client->ini->readVariable("client","access") and $client->getSetting("setup_ok"))
852  {
853  $this->ctrl->setParameter($this, "client_id", $key);
854  //$data[] = array(
855  // $client->getName(),
856  // "<a href=\"".$ilCtrl->getLinkTarget($this, "processIndexPHP")."\">Start page</a>",
857  // "<a href=\"".$ilCtrl->getLinkTarget($this, "showLogin")."\">Login page</a>"
858  // );
859  //$data[] = array(
860  // $client->getName(),
861  // "<a href=\"".$ilCtrl->getLinkTarget($this, "processIndexPHP")."\">Start page</a>",
862  // "<a href=\""."login.php?cmd=force_login&client_id=".urlencode($key)."\">Login page</a>"
863  // );
864  $data[] = array(
865  $client->getName(),
866  "<a href=\""."repository.php?client_id=".urlencode($key)."\">Start page</a>",
867  "<a href=\""."login.php?cmd=force_login&client_id=".urlencode($key)."\">Login page</a>"
868  );
869  }
870  }
871  $this->ctrl->setParameter($this, "client_id", "");
872 
873  // create table
874  $tbl = new ilTableGUI();
875 
876  // title & header columns
877  $tbl->setTitle("Available Clients");
878  $tbl->setHeaderNames(array("Installation Name","Public Access","Login"));
879  $tbl->setHeaderVars(array("name","index","login"));
880  $tbl->setColumnWidth(array("50%","25%","25%"));
881 
882  // control
883  $tbl->setOrderColumn($_GET["sort_by"],"name");
884  $tbl->setOrderDirection($_GET["sort_order"]);
885  $tbl->setLimit($_GET["limit"]);
886  $tbl->setOffset($_GET["offset"]);
887 
888  // content
889  $tbl->setData($data);
890 
891  // footer
892  $tbl->setFooter("tblfooter");
893 
894  // styles
895  $tbl->setStyle("table","std");
896 
897  $tbl->disable("icon");
898  $tbl->disable("numinfo");
899  $tbl->disable("sort");
900 
901  // render table
902  $tbl->render();
903  $tpl->show("DEFAULT", true, true);
904  }
905 
912  {
913  global $tpl;
914 
915  $str = "<p style=\"margin:15px;\">
916  You need to enable Session Cookies in your Browser to use ILIAS.
917  <br/>
918  <br/><b>Firefox</b>
919  <br/>Tools -> Options -> Privacy -> Cookies
920  <br/>Enable 'Allow sites to set cookies' and activate option 'Keep
921  <br/>cookies' auf 'until I close Firefox'
922  <br/>
923  <br/><b>Mozilla/Netscape</b>
924  <br/>Edit -> Preferences -> Privacy&Security -> Cookies
925  <br/>Go to 'Cookie Lifetime Policy' and check option 'Accept for current
926  <br/>session only'.
927  <br/>
928  <br/><b>Internet Explorer</b>
929  <br/>Tools -> Internet Options -> Privacy -> Advanced
930  <br/>- Check 'Override automatic cookie handling'
931  <br/>- Check 'Always allow session cookies'
932  </p>";
933  $tpl->setVariable("CONTENT", $str);
934  $tpl->show();
935  }
936 
940  function getAcceptance()
941  {
942  $this->showUserAgreement();
943  }
944 
948  function showUserAgreement()
949  {
950  global $lng, $tpl, $ilUser;
951 
952  require_once "./Services/User/classes/class.ilUserAgreement.php";
953 
954  $tpl->addBlockFile("CONTENT", "content", "tpl.view_usr_agreement.html",
955  "Services/Init");
956  $tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
957 
958 // ilUtil::sendInfo();
959  // display infopanel if something happened
961 
962  $tpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
963  $tpl->setVariable("TXT_OK", $lng->txt("ok"));
964 
965  // language selection
966  $languages = $lng->getInstalledLanguages();
967 
968  $count = (int) round(count($languages) / 2);
969  $num = 1;
970 
971  foreach ($languages as $lang_key)
972  {
973  $tpl->setCurrentBlock("languages");
974  $tpl->setVariable("LANG_VAL_CMD", $this->ctrl->getCmd());
975  $tpl->setVariable("AGR_LANG_ACTION",
976  $this->ctrl->getFormAction($this));
977  $tpl->setVariable("LANG_NAME",
978  ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_".$lang_key));
979  $tpl->setVariable("LANG_ICON", $lang_key);
980  $tpl->setVariable("LANG_KEY", $lang_key);
981  $tpl->setVariable("BORDER", 0);
982  $tpl->setVariable("VSPACE", 0);
983  $tpl->parseCurrentBlock();
984 
985  $num++;
986  }
987  $tpl->setCurrentBlock("content");
988 
989  // display tabs
990  $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("usr_agreement"));
991  $tpl->setVariable("TXT_PAGETITLE", "ILIAS3 - ".$lng->txt("usr_agreement"));
992  $tpl->setVariable("TXT_USR_AGREEMENT", ilUserAgreement::_getText());
993 
994  if ($this->ctrl->getCmd() == "getAcceptance")
995  {
996  if ($_POST["status"]=="accepted")
997  {
998  $ilUser->writeAccepted();
999  ilUtil::redirect("index.php?target=".$_GET["target"]."&client_id=".CLIENT_ID);
1000  }
1001  $tpl->setVariable("VAL_CMD", "getAcceptance");
1002  $tpl->setVariable("AGR_LANG_ACTION",
1003  $this->ctrl->getFormAction($this));
1004  $tpl->setCurrentBlock("get_acceptance");
1005  $tpl->setVariable("FORM_ACTION",
1006  $this->ctrl->getFormAction($this));
1007  $tpl->setVariable("ACCEPT_CHECKBOX", ilUtil::formCheckbox(0, "status", "accepted"));
1008  $tpl->setVariable("ACCEPT_AGREEMENT", $lng->txt("accept_usr_agreement"));
1009  $tpl->setVariable("TXT_SUBMIT", $lng->txt("submit"));
1010  $tpl->parseCurrentBlock();
1011  }
1012  else
1013  {
1014  $tpl->setCurrentBlock("back");
1015  $tpl->setVariable("BACK", $lng->txt("back"));
1016  $tpl->setVariable("LINK_BACK",
1017  $this->ctrl->getLinkTargetByClass("ilstartupgui", "showLogin"));
1018  $tpl->parseCurrentBlock();
1019  }
1020 
1021  $tpl->show();
1022 
1023 
1024  }
1025 
1029  function processIndexPHP()
1030  {
1032 
1033  // display client selection list if enabled
1034  if (!isset($_GET["client_id"]) &&
1035  $_GET["cmd"] == "" &&
1036  $ilIliasIniFile->readVariable("clients","list"))
1037  {
1038  $this->showClientList();
1039  //include_once "./include/inc.client_list.php";
1040  exit();
1041  }
1042 
1043  /*
1044  if ($_GET["cmd"] == "login")
1045  {
1046  $rep_ref_id = $_SESSION["il_rep_ref_id"];
1047 
1048  $ilAuth->logout();
1049  session_destroy();
1050 
1051  // reset cookie
1052  $client_id = $_COOKIE["ilClientId"];
1053  setcookie ("ilClientId","");
1054  $_COOKIE["ilClientId"] = "";
1055 
1056  $_GET["client_id"] = $client_id;
1057  $_GET["rep_ref_id"] = $rep_ref_id;
1058 
1059 
1060  ilUtil::redirect("login.php?client_id=".$client_id."&lang=".$_GET['lang'].
1061  "&rep_ref_id=".$rep_ref_id);
1062  }*/
1063 
1064 
1065  // if no start page was given, ILIAS defaults to the standard login page
1066  if ($start == "")
1067  {
1068  $start = "login.php";
1069  }
1070 
1071 
1072  //
1073  // index.php is called and public section is enabled
1074  //
1075  // && $ilAuth->status == -101 is important for soap auth (public section on + user mapping, alex)
1076  // $ilAuth->status -1 is given, if session ends (if public section -> jump to public section)
1077  if ($ilSetting->get("pub_section") && $_POST["sendLogin"] != "1"
1078  && ($ilAuth->getStatus() != -101 && $_GET["soap_pw"] == ""))
1079  {
1080  //
1081  // TO DO: THE FOLLOWING BLOCK IS COPY&PASTED FROM HEADER.INC
1082 
1083  $_POST["username"] = "anonymous";
1084  $_POST["password"] = "anonymous";
1085  $ilAuth->start();
1086  if (ANONYMOUS_USER_ID == "")
1087  {
1088  die ("Public Section enabled, but no Anonymous user found.");
1089  }
1090  if (!$ilAuth->getAuth())
1091  {
1092  die("ANONYMOUS user with the object_id ".ANONYMOUS_USER_ID." not found!");
1093  }
1094 
1095  // get user id
1096  $ilInit->initUserAccount();
1097  $this->processStartingPage();
1098  exit;
1099  }
1100  else
1101  {
1102  // index.php is called and public section is disabled
1103  $this->showLogin();
1104  }
1105  }
1106 
1107 
1114  {
1115  global $ilBench, $ilCtrl, $ilAccess, $lng, $ilUser;
1116 //echo "here";
1117  if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID || !empty($_GET["ref_id"]))
1118  {
1119 //echo "A";
1120  // if anonymous and a target given...
1121  if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID && $_GET["target"] != "")
1122  {
1123  // target is accessible -> goto target
1124  if ($this->_checkGoto($_GET["target"]))
1125  {
1126 //echo "B";
1127  ilUtil::redirect("./goto.php?target=".$_GET["target"]);
1128  }
1129  else // target is not accessible -> login
1130  {
1131 //echo "C";
1132  $this->showLogin();
1133  }
1134  }
1135 
1136  // just go to public section
1137  if (empty($_GET["ref_id"]))
1138  {
1139  $_GET["ref_id"] = ROOT_FOLDER_ID;
1140  }
1141  $ilCtrl->initBaseClass("");
1142  $ilCtrl->setCmd("frameset");
1143  $start_script = "repository.php";
1144  include($start_script);
1145  return true;
1146  }
1147  else
1148  {
1149  if((int)$_GET['forceShoppingCartRedirect'] && (int)$_SESSION['price_id'] && (int)$_SESSION['pobject_id'])
1150  {
1151  include_once 'payment/classes/class.ilPaymentShoppingCart.php';
1152  $oCart = new ilPaymentShoppingCart($ilUser);
1153  $oCart->setPriceId((int)$_SESSION['price_id']);
1154  $oCart->setPobjectId((int)$_SESSION['pobject_id']);
1155  $oCart->add();
1156 
1157  unset($_SESSION['price_id']);
1158  unset($_SESSION['pobject_id']);
1159 
1160  $lng->loadLanguageModule('payment');
1161  ilUtil::sendInfo($lng->txt('pay_added_to_shopping_cart'), true);
1162  ilUtil::redirect('ilias.php?baseClass=ilShopController&cmd=redirect&redirect_class=ilshopshoppingcartgui');
1163  }
1164 
1165  if (!$this->_checkGoto($_GET["target"]))
1166  {
1167  // message if target given but not accessible
1168  if ($_GET["target"] != "")
1169  {
1170  $tarr = explode("_", $_GET["target"]);
1171  if ($tarr[0] != "pg" && $tarr[0] != "st" && $tarr[1] > 0)
1172  {
1173  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1175  }
1176  }
1177 
1178  // show personal desktop
1179  #$ilCtrl->initBaseClass("ilPersonalDesktopGUI");
1180  #$start_script = "ilias.php";
1181  // Redirect here to switch back to http if desired
1182  ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
1183  }
1184  else
1185  {
1186 //echo "3";
1187  ilUtil::redirect("./goto.php?target=".$_GET["target"]);
1188  }
1189  }
1190 
1191  include($start_script);
1192  }
1193 
1194  function _checkGoto($a_target)
1195  {
1196  global $objDefinition;
1197 
1198  if ($a_target == "")
1199  {
1200  return false;
1201  }
1202 
1203  $t_arr = explode("_", $_GET["target"]);
1204  $type = $t_arr[0];
1205 
1206  if ($type == "git")
1207  {
1208  $type = "glo";
1209  }
1210 
1211  if ($type == "pg" | $type == "st")
1212  {
1213  $type = "lm";
1214  }
1215 
1216  $class = $objDefinition->getClassName($type);
1217  if ($class == "")
1218  {
1219  return false;
1220  }
1221  $location = $objDefinition->getLocation($type);
1222  $full_class = "ilObj".$class."Access";
1223  include_once($location."/class.".$full_class.".php");
1224 
1225  return call_user_func(array($full_class, "_checkGoto"),
1226  $a_target);
1227  }
1228 
1229  public function confirmRegistration()
1230  {
1231  ilUtil::setCookie('iltest', 'cookie', false);
1232 
1233  if(!isset($_GET['rh']) || !strlen(trim($_GET['rh'])))
1234  {
1235  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_confirmation_hash_not_passed');
1236  }
1237 
1238  try
1239  {
1240  global $lng, $ilias;
1241 
1242  require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
1243  $oRegSettings = new ilRegistrationSettings();
1244 
1247  $oUser->setActive(true);
1248  if($oRegSettings->passwordGenerationEnabled())
1249  {
1250  $passwd = ilUtil::generatePasswords(1);
1251  $password = $passwd[0];
1252  $oUser->setPasswd($password, IL_PASSWD_PLAIN);
1253  $oUser->setLastPasswordChangeTS( time() );
1254  }
1255  $oUser->update();
1256 
1257  if($lng->getLangKey() != $oUser->getPref('language'))
1258  {
1259  $lng = new ilLanguage($oUser->getPref('language'));
1260  }
1261 
1262  // send email
1263  // try individual account mail in user administration
1264  include_once("Services/Mail/classes/class.ilAccountMail.php");
1265  include_once './Services/User/classes/class.ilObjUserFolder.php';
1266  $amail = ilObjUserFolder::_lookupNewAccountMail($oUser->getPref('language'));
1267  if (trim($amail["body"]) != "" && trim($amail["subject"]) != "")
1268  {
1269  $acc_mail = new ilAccountMail();
1270  $acc_mail->setUser($oUser);
1271  if($oRegSettings->passwordGenerationEnabled())
1272  {
1273  $acc_mail->setUserPassword($password);
1274  }
1275  $acc_mail->send();
1276  }
1277  else // do default mail
1278  {
1279  include_once 'Services/Mail/classes/class.ilMail.php';
1280  $mail_obj = new ilMail(ANONYMOUS_USER_ID);
1281 
1282  // mail subject
1283  $subject = $lng->txt("reg_mail_subject");
1284 
1285  // mail body
1286  $body = $lng->txt("reg_mail_body_salutation")." ".$oUser->getFullname().",\n\n".
1287  $lng->txt("reg_mail_body_text1")."\n\n".
1288  $lng->txt("reg_mail_body_text2")."\n".
1289  ILIAS_HTTP_PATH."/login.php?client_id=".CLIENT_ID."\n";
1290  $body .= $lng->txt("login").": ".$oUser->getLogin()."\n";
1291 
1292  if($oRegSettings->passwordGenerationEnabled())
1293  {
1294  $body.= $lng->txt("passwd").": ".$password."\n";
1295  }
1296 
1297  $body.= "\n";
1298  $body.= $lng->txt('reg_mail_body_forgot_password_info')."\n";
1299 
1300  $body.= "\n";
1301 
1302  $body .= ($lng->txt("reg_mail_body_text3")."\n\r");
1303  $body .= $oUser->getProfileAsString($lng);
1304  $mail_obj->enableSoap(false);
1305  $mail_obj->appendInstallationSignature(true);
1306  $mail_obj->sendMail($oUser->getEmail(), '', '',
1307  $subject,
1308  $body,
1309  array(), array('normal'));
1310  }
1311 
1312  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg=reg_account_confirmation_successful');
1313  }
1314  catch(ilRegConfirmationLinkExpiredException $oException)
1315  {
1316  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$oException->getMessage());
1317  }
1318  catch(ilRegistrationHashNotFoundException $oException)
1319  {
1320  ilUtil::redirect('./login.php?cmd=force_login&reg_confirmation_msg='.$oException->getMessage());
1321  }
1322  }
1323 }
1324 ?>