ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilAccountRegistrationGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
18 require_once './Services/Registration/classes/class.ilRegistrationSettings.php';
19 require_once "./Services/User/classes/class.ilUserAgreement.php";
20 
22 {
23  var $ctrl;
24  var $tpl;
26 
27  protected $code_was_used = false;
28 
29  public function __construct()
30  {
31  global $ilCtrl,$tpl,$lng;
32 
33  $this->tpl =& $tpl;
34 
35  $this->ctrl =& $ilCtrl;
36  $this->ctrl->saveParameter($this,'lang');
37 
38  $this->lng =& $lng;
39  $this->lng->loadLanguageModule('registration');
40 
41  $this->registration_settings = new ilRegistrationSettings();
42  }
43 
44  public function executeCommand()
45  {
46  global $ilErr, $tpl;
47 
48  if($this->registration_settings->getRegistrationType() == IL_REG_DISABLED)
49  {
50  $ilErr->raiseError($this->lng->txt('reg_disabled'),$ilErr->FATAL);
51  }
52 
53  $next_class = $this->ctrl->getNextClass($this);
54  $cmd = $this->ctrl->getCmd();
55 
56  switch($next_class)
57  {
58  default:
59  if($cmd)
60  {
61  $this->$cmd();
62  }
63  else
64  {
65  $this->displayForm();
66  }
67  break;
68  }
69  $tpl->show();
70  return true;
71  }
72 
73  public function displayForm()
74  {
75  global $lng;
76 
77  $this->tpl->addBlockFile("CONTENT", "content", "tpl.usr_registration.html");
78  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
79 
80  $this->tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("registration"));
81 
82  // language selection
83  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
84  $this->tpl->setVariable("TXT_OK",$lng->txt("ok"));
85  $this->tpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
86  $this->ctrl->getFormAction($this);
87 
88  $lang_opts = array();
89  foreach ($lng->getInstalledLanguages() as $lang_key)
90  {
91  $lang_opts[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_".$lang_key);
92  }
93  asort($lang_opts);
94 
95  $this->tpl->setCurrentBlock("languages");
96  foreach($lang_opts as $lang_key => $lang_caption)
97  {
98  $this->tpl->setVariable("LANG_NAME", $lang_caption);
99  $this->tpl->setVariable("LANG_ICON", $lang_key);
100 
101  if($lang_key == $lng->getLangKey())
102  {
103  $this->tpl->setVariable("SELECTED_LANG", " selected=\"selected\"");
104  }
105 
106  $this->tpl->parseCurrentBlock();
107  }
108 
109  if(!$this->form)
110  {
111  $this->__initForm();
112  }
113  $this->tpl->setVariable("FORM", $this->form->getHTML());
114  }
115 
116  protected function __initForm($a_force_code = false)
117  {
118  global $lng, $ilUser;
119 
120  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
121  $this->form = new ilPropertyFormGUI();
122  $this->form->setFormAction($this->ctrl->getFormAction($this));
123 
124  $display_code = ($this->registration_settings->registrationCodeRequired() ||
125  $this->registration_settings->getAllowCodes());
126 
127  // display code on separate page
128  // force_code is used for validation in saveCodeForm()
129  if($display_code && (!isset($_POST["usr_registration_code"]) || $a_force_code))
130  {
131  /*
132  $sh = new ilFormSectionHeaderGUI();
133  $sh->setTitle($lng->txt("prerequisites"));
134  $this->form->addItem($sh);
135  */
136 
137  include_once 'Services/Registration/classes/class.ilRegistrationCode.php';
138  $code = new ilTextInputGUI($lng->txt("registration_code"), "usr_registration_code");
139  $code->setSize(40);
140  $code->setMaxLength(ilRegistrationCode::CODE_LENGTH);
141  if((bool)$this->registration_settings->registrationCodeRequired())
142  {
143  $code->setRequired(true);
144  $code->setInfo($lng->txt("registration_code_required_info"));
145  }
146  else
147  {
148  $code->setInfo($lng->txt("registration_code_optional_info"));
149  }
150 
151  $this->form->addItem($code);
152 
153  $this->form->addCommandButton("saveCodeForm", $lng->txt("send"));
154  }
155  else
156  {
157  if(!$this->registration_code)
158  {
159  $this->registration_code = $_POST["usr_registration_code"];
160  }
161 
162  // code handling, check if role is
163  $predefined_role = null;
164  if($this->registration_code)
165  {
166  $code = new ilNonEditableValueGUI($lng->txt("registration_code"), "usr_registration_code");
167  $code->setValue($this->registration_code);
168  $this->form->addItem($code);
169 
170  include_once 'Services/Registration/classes/class.ilRegistrationCode.php';
171  $predefined_role = ilRegistrationCode::getCodeRole($this->registration_code);
172  }
173  // to make validation work properly (see isset() above)
174  else if($display_code)
175  {
176  $code = new ilHiddenInputGUI("usr_registration_code");
177  $code->setValue("");
178  $this->form->addItem($code);
179  }
180 
181  // user defined fields
182 
183  $user_defined_data = $ilUser->getUserDefinedData();
184 
185  include_once './Services/User/classes/class.ilUserDefinedFields.php';
186  $user_defined_fields =& ilUserDefinedFields::_getInstance();
187  $custom_fields = array();
188  foreach($user_defined_fields->getRegistrationDefinitions() as $field_id => $definition)
189  {
190  if($definition['field_type'] == UDF_TYPE_TEXT)
191  {
192  $custom_fields["udf_".$definition['field_id']] =
193  new ilTextInputGUI($definition['field_name'], "udf_".$definition['field_id']);
194  $custom_fields["udf_".$definition['field_id']]->setValue($user_defined_data["f_".$field_id]);
195  $custom_fields["udf_".$definition['field_id']]->setMaxLength(255);
196  $custom_fields["udf_".$definition['field_id']]->setSize(40);
197  }
198  else if($definition['field_type'] == UDF_TYPE_WYSIWYG)
199  {
200  $custom_fields["udf_".$definition['field_id']] =
201  new ilTextAreaInputGUI($definition['field_name'], "udf_".$definition['field_id']);
202  $custom_fields["udf_".$definition['field_id']]->setValue($user_defined_data["f_".$field_id]);
203  $custom_fields["udf_".$definition['field_id']]->setUseRte(true);
204  }
205  else
206  {
207  $custom_fields["udf_".$definition['field_id']] =
208  new ilSelectInputGUI($definition['field_name'], "udf_".$definition['field_id']);
209  $custom_fields["udf_".$definition['field_id']]->setValue($user_defined_data["f_".$field_id]);
210  $custom_fields["udf_".$definition['field_id']]->setOptions(
211  $user_defined_fields->fieldValuesToSelectArray($definition['field_values']));
212  }
213  if($definition['required'])
214  {
215  $custom_fields["udf_".$definition['field_id']]->setRequired(true);
216  }
217  }
218 
219  // standard fields
220  include_once("./Services/User/classes/class.ilUserProfile.php");
221  $up = new ilUserProfile();
222  $up->setMode(ilUserProfile::MODE_REGISTRATION);
223  $up->skipGroup("preferences");
224 
225  // add fields to form
226  $up->addStandardFieldsToForm($this->form, NULL, $custom_fields);
227  unset($custom_fields);
228 
229  // user agreement
230 
231  $field = new ilFormSectionHeaderGUI();
232  $field->setTitle($lng->txt("usr_agreement"));
233  $this->form->addItem($field);
234 
235  $field = new ilCustomInputGUI();
236  $field->setHTML('<div id="agreement">'.ilUserAgreement::_getText().'</div>');
237  $this->form->addItem($field);
238 
239  $field = new ilCheckboxInputGUI($lng->txt("accept_usr_agreement"), "usr_agreement");
240  $field->setRequired(true);
241  $field->setValue(1);
242  $this->form->addItem($field);
243 
244  // remove role select if already defined
245  if($predefined_role)
246  {
247  $this->form->removeItemByPostVar("usr_roles");
248 
249  $role = new ilHiddenInputGUI("usr_roles");
250  $role->setValue($predefined_role);
251  $this->form->addItem($role);
252  }
253 
254  $this->form->addCommandButton("saveForm", $lng->txt("register"));
255  }
256  }
257 
258  public function saveCodeForm()
259  {
260  global $lng;
261 
262  $this->__initForm(true);
263  if($this->form->checkInput())
264  {
265  $code = $this->form->getInput("usr_registration_code");
266  if($code)
267  {
268  // invalid code
269  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
271  {
272  $code_obj = $this->form->getItemByPostVar('usr_registration_code');
273  $code_obj->setAlert($lng->txt('registration_code_not_valid'));
274  }
275  // valid code
276  else
277  {
278  $this->registration_code = $code;
279  unset($this->form);
280  return $this->displayForm();
281  }
282  }
283  // optional code not given
284  else
285  {
286  unset($this->form);
287  return $this->displayForm();
288  }
289  }
290 
291  $this->form->setValuesByPost();
292  $this->displayForm();
293  }
294 
295  public function saveForm()
296  {
297  global $ilias, $lng, $rbacadmin, $ilDB, $ilErr, $ilSetting;
298 
299  $this->__initForm();
300  $form_valid = $this->form->checkInput();
301 
302  require_once 'Services/User/classes/class.ilObjUser.php';
303 
304  // custom validation
305 
306  if(!$this->form->getInput("usr_agreement"))
307  {
308  $agr_obj = $this->form->getItemByPostVar('usr_agreement');
309  $agr_obj->setAlert($lng->txt("force_accept_usr_agreement"));
310  $form_valid = false;
311  }
312 
313  $valid_role = false;
314 
315  // manual selection
316  if ($this->registration_settings->roleSelectionEnabled())
317  {
318  include_once "./Services/AccessControl/classes/class.ilObjRole.php";
319  $selected_role = $this->form->getInput("usr_roles");
320  if ($selected_role && ilObjRole::_lookupAllowRegister($selected_role))
321  {
322  $valid_role = true;
323  }
324  }
325  // assign by email
326  else
327  {
328  include_once 'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
329  $registration_role_assignments = new ilRegistrationRoleAssignments();
330  if ($registration_role_assignments->getRoleByEmail($this->form->getInput("usr_email")))
331  {
332  $valid_role = true;
333  }
334  }
335 
336  // no valid role could be determined
337  if (!$valid_role)
338  {
339  ilUtil::sendInfo($lng->txt("registration_no_valid_role"));
340  $form_valid = false;
341  }
342 
343  // validate username
344  $login_obj = $this->form->getItemByPostVar('username');
345  $login = $this->form->getInput("username");
346  if (!ilUtil::isLogin($login))
347  {
348  $login_obj->setAlert($lng->txt("login_invalid"));
349  $form_valid = false;
350  }
351  else if (ilObjUser::_loginExists($login))
352  {
353  $login_obj->setAlert($lng->txt("login_exists"));
354  $form_valid = false;
355  }
356  else if ((int)$ilSetting->get('allow_change_loginname') &&
357  (int)$ilSetting->get('prevent_reuse_of_loginnames') &&
359  {
360  $login_obj->setAlert($lng->txt('login_exists'));
361  $form_valid = false;
362  }
363 
364  if(!$form_valid)
365  {
366  ilUtil::sendFailure($lng->txt('form_input_not_valid'));
367  }
368  else
369  {
370  $password = $this->__createUser();
371  $this->__distributeMails($password);
372  $this->login($password);
373  return true;
374  }
375 
376  $this->form->setValuesByPost();
377  $this->displayForm();
378  return false;
379  }
380 
381  protected function __createUser()
382  {
383  global $ilSetting, $rbacadmin;
384 
385  $this->userObj = new ilObjUser();
386 
387  include_once("./Services/User/classes/class.ilUserProfile.php");
388  $up = new ilUserProfile();
389  $up->setMode(ilUserProfile::MODE_REGISTRATION);
390 
391  $map = array();
392  $up->skipGroup("preferences");
393  $up->skipGroup("settings");
394  $up->skipGroup("instant_messengers");
395  $up->skipField("password");
396  $up->skipField("birthday");
397  $up->skipField("upload");
398  foreach ($up->getStandardFields() as $k => $v)
399  {
400  if($v["method"])
401  {
402  $method = "set".substr($v["method"], 3);
403  if(method_exists($this->userObj, $method))
404  {
405  if ($k != "username")
406  {
407  $k = "usr_".$k;
408  }
409  $field_obj = $this->form->getItemByPostVar($k);
410  if($field_obj)
411  {
412 
413  $this->userObj->$method($this->form->getInput($k));
414  }
415  }
416  }
417  }
418 
419  $this->userObj->setFullName();
420 
421  $birthday_obj = $this->form->getItemByPostVar("usr_birthday");
422  if ($birthday_obj)
423  {
424  $birthday = $this->form->getInput("usr_birthday");
425  $birthday = $birthday["date"];
426 
427  // when birthday was not set, array will not be substituted with string by ilBirthdayInputGui
428  if(!is_array($birthday))
429  {
430  $this->userObj->setBirthday($birthday);
431  }
432  }
433 
434  // messenger
435  $map = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip");
436  foreach($map as $client)
437  {
438  $field = "usr_im_".$client;
439  $field_obj = $this->form->getItemByPostVar($field);
440  if($field_obj)
441  {
442  $this->userObj->setInstantMessengerId($client, $this->form->getInput($field));
443  }
444  }
445 
446  $this->userObj->setTitle($this->userObj->getFullname());
447  $this->userObj->setDescription($this->userObj->getEmail());
448 
449  if ($this->registration_settings->passwordGenerationEnabled())
450  {
451  $password = ilUtil::generatePasswords(1);
452  $password = $password[0];
453  }
454  else
455  {
456  $password = $this->form->getInput("usr_password");
457  }
458  $this->userObj->setPasswd($password);
459 
460 
461  // Set user defined data
462  include_once './Services/User/classes/class.ilUserDefinedFields.php';
463  $user_defined_fields =& ilUserDefinedFields::_getInstance();
464  $defs = $user_defined_fields->getRegistrationDefinitions();
465  $udf = array();
466  foreach ($_POST as $k => $v)
467  {
468  if (substr($k, 0, 4) == "udf_")
469  {
470  $f = substr($k, 4);
471  $udf[$f] = $v;
472  }
473  }
474  $this->userObj->setUserDefinedData($udf);
475 
476  $this->userObj->setTimeLimitOwner(7);
477 
478 
479  $default_role = false;
480  if ($this->registration_settings->roleSelectionEnabled())
481  {
482  $default_role = $this->form->getInput('usr_roles');
483  }
484  else
485  {
486  // Assign by email
487  include_once 'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
488  $registration_role_assignments = new ilRegistrationRoleAssignments();
489  $default_role = $registration_role_assignments->getRoleByEmail($this->userObj->getEmail());
490  }
491 
492  // get role from code / set code to used
493  $code = $this->form->getInput('usr_registration_code');
494  $this->code_was_used = false;
495  if($this->registration_settings->getRegistrationType() == IL_REG_CODES ||
496  ($code && $this->registration_settings->getAllowCodes()))
497  {
498  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
500  $this->code_was_used = true;
501 
502  // #7508: if role is set with code, use that one (even if it overwrites user input)
503  $code_role = ilRegistrationCode::getCodeRole($code);
504  if($code_role)
505  {
506  $default_role = $code_role;
507  }
508  }
509 
510  // something went wrong with the form validation
511  if(!$default_role)
512  {
513  global $ilias;
514  $ilias->raiseError("Invalid role selection in registration".
515  ", IP: ".$_SERVER["REMOTE_ADDR"], $ilias->error_obj->FATAL);
516  }
517 
518  if ($this->registration_settings->getAccessLimitation())
519  {
520  include_once 'Services/Registration/classes/class.ilRegistrationRoleAccessLimitations.php';
521  $access_limitations_obj = new ilRegistrationRoleAccessLimitations();
522 
523  $access_limit_mode = $access_limitations_obj->getMode($default_role);
524  if ($access_limit_mode == 'absolute')
525  {
526  $access_limit = $access_limitations_obj->getAbsolute($default_role);
527  $this->userObj->setTimeLimitUnlimited(0);
528  $this->userObj->setTimeLimitUntil($access_limit);
529  }
530  elseif ($access_limit_mode == 'relative')
531  {
532  $rel_d = (int) $access_limitations_obj->getRelative($default_role,'d');
533  $rel_m = (int) $access_limitations_obj->getRelative($default_role,'m');
534  $rel_y = (int) $access_limitations_obj->getRelative($default_role,'y');
535 
536  $access_limit = $rel_d * 86400 + $rel_m * 2592000 + $rel_y * 31536000 + time();
537  $this->userObj->setTimeLimitUnlimited(0);
538  $this->userObj->setTimeLimitUntil($access_limit);
539  }
540  else
541  {
542  $this->userObj->setTimeLimitUnlimited(1);
543  $this->userObj->setTimeLimitUntil(time());
544  }
545  }
546  else
547  {
548  $this->userObj->setTimeLimitUnlimited(1);
549  $this->userObj->setTimeLimitUntil(time());
550  }
551 
552  $this->userObj->setTimeLimitFrom(time());
553 
554  $this->userObj->create();
555 
556 
557  if($this->registration_settings->getRegistrationType() == IL_REG_DIRECT ||
558  $this->registration_settings->getRegistrationType() == IL_REG_CODES ||
560  {
561  $this->userObj->setActive(1,0);
562  }
563  else if($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION)
564  {
565  $this->userObj->setActive(0,0);
566  }
567  else
568  {
569  $this->userObj->setActive(0,0);
570  }
571 
572  $this->userObj->updateOwner();
573 
574  // set a timestamp for last_password_change
575  // this ts is needed by the ACCOUNT_SECURITY_MODE_CUSTOMIZED
576  // in ilSecuritySettings
577  $this->userObj->setLastPasswordChangeTS( time() );
578 
579  //insert user data in table user_data
580  $this->userObj->saveAsNew();
581 
582  // store acceptance of user agreement
583  $this->userObj->writeAccepted();
584 
585  // setup user preferences
586  $this->userObj->setLanguage($this->form->getInput('usr_language'));
587  $hits_per_page = $ilSetting->get("hits_per_page");
588  if ($hits_per_page < 10)
589  {
590  $hits_per_page = 10;
591  }
592  $this->userObj->setPref("hits_per_page", $hits_per_page);
593  $show_online = $ilSetting->get("show_users_online");
594  if ($show_online == "")
595  {
596  $show_online = "y";
597  }
598  $this->userObj->setPref("show_users_online", $show_online);
599  $this->userObj->writePrefs();
600 
601  $rbacadmin->assignUser((int)$default_role, $this->userObj->getId(), true);
602 
603  return $password;
604  }
605 
606  protected function __distributeMails($password)
607  {
608  global $ilSetting;
609 
610  include_once './Services/Language/classes/class.ilLanguage.php';
611  include_once './Services/User/classes/class.ilObjUser.php';
612  include_once "Services/Mail/classes/class.ilFormatMail.php";
613  include_once './Services/Registration/classes/class.ilRegistrationMailNotification.php';
614 
615  // Always send mail to approvers
616  if($this->registration_settings->getRegistrationType() == IL_REG_APPROVE && !$this->code_was_used)
617  {
618  $mail = new ilRegistrationMailNotification();
620  $mail->setRecipients($this->registration_settings->getApproveRecipients());
621  $mail->setAdditionalInformation(array('usr' => $this->userObj));
622  $mail->send();
623  }
624  else
625  {
626  $mail = new ilRegistrationMailNotification();
628  $mail->setRecipients($this->registration_settings->getApproveRecipients());
629  $mail->setAdditionalInformation(array('usr' => $this->userObj));
630  $mail->send();
631 
632  }
633  // Send mail to new user
634 
635  // Registration with confirmation link ist enabled
636  if($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION && !$this->code_was_used)
637  {
638  include_once './Services/Registration/classes/class.ilRegistrationMimeMailNotification.php';
639 
642  $mail->setRecipients(array($this->userObj));
643  $mail->setAdditionalInformation(
644  array(
645  'usr' => $this->userObj,
646  'hash_lifetime' => $this->registration_settings->getRegistrationHashLifetime()
647  )
648  );
649  $mail->send();
650  }
651  else
652  {
653  // try individual account mail in user administration
654  include_once("Services/Mail/classes/class.ilAccountMail.php");
655  include_once './Services/User/classes/class.ilObjUserFolder.php';
656  $amail = ilObjUserFolder::_lookupNewAccountMail($GLOBALS["lng"]->getDefaultLanguage());
657  if (trim($amail["body"]) != "" && trim($amail["subject"]) != "")
658  {
659  $acc_mail = new ilAccountMail();
660  $acc_mail->setUser($this->userObj);
661  if ($this->registration_settings->passwordGenerationEnabled())
662  {
663  $acc_mail->setUserPassword($password);
664  }
665  $acc_mail->send();
666  }
667  else // do default mail
668  {
669  include_once "Services/Mail/classes/class.ilMimeMail.php";
670 
671  $mmail = new ilMimeMail();
672  $mmail->autoCheck(false);
673  $mmail->From($ilSetting->get("admin_email"));
674  $mmail->To($this->userObj->getEmail());
675 
676  // mail subject
677  $subject = $this->lng->txt("reg_mail_subject");
678 
679  // mail body
680  $body = $this->lng->txt("reg_mail_body_salutation")." ".$this->userObj->getFullname().",\n\n".
681  $this->lng->txt("reg_mail_body_text1")."\n\n".
682  $this->lng->txt("reg_mail_body_text2")."\n".
683  ILIAS_HTTP_PATH."/login.php?client_id=".CLIENT_ID."\n";
684  $body .= $this->lng->txt("login").": ".$this->userObj->getLogin()."\n";
685 
686  if ($this->registration_settings->passwordGenerationEnabled())
687  {
688  $body.= $this->lng->txt("passwd").": ".$password."\n";
689  }
690  $body.= "\n";
691 
692  // Info about necessary approvement
693  if($this->registration_settings->getRegistrationType() == IL_REG_APPROVE && !$this->code_was_used)
694  {
695  $body .= ($this->lng->txt('reg_mail_body_pwd_generation')."\n\n");
696  }
697 
698  $body .= ($this->lng->txt("reg_mail_body_text3")."\n\r");
699  $body .= $this->userObj->getProfileAsString($this->lng);
700  $mmail->Subject($subject);
701  $mmail->Body($body);
702  $mmail->Send();
703  }
704  }
705  }
706 
707  public function login($password)
708  {
709  global $ilias,$lng,$ilLog;
710 
711  $ilLog->write("Entered login");
712 
713  $this->tpl->addBlockFile("CONTENT", "content", "tpl.usr_registered.html");
714 
715  $this->tpl->setVariable("IMG_USER",
716  ilUtil::getImagePath("icon_usr_b.gif"));
717  $this->tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("registration"));
718  $this->tpl->setVariable("TXT_WELCOME", $lng->txt("welcome").", ".$this->userObj->getTitle()."!");
719 
720  if (($this->registration_settings->getRegistrationType() == IL_REG_DIRECT or
721  $this->registration_settings->getRegistrationType() == IL_REG_CODES or
723  !$this->registration_settings->passwordGenerationEnabled())
724  {
725  $this->tpl->setCurrentBlock("activation");
726  $this->tpl->setVariable("TXT_REGISTERED", $lng->txt("txt_registered"));
727  $this->tpl->setVariable("FORMACTION", "login.php?cmd=post&target=".$_GET["target"]);
728  if(IS_PAYMENT_ENABLED && isset($_SESSION['forceShoppingCartRedirect']))
729  {
730  $this->tpl->setVariable("FORMACTION", './login.php?forceShoppingCartRedirect=1');
731  }
732  $this->tpl->setVariable("TARGET","target=\"_parent\"");
733  $this->tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
734  $this->tpl->setVariable("USERNAME",$this->userObj->getLogin());
735  $this->tpl->setVariable("PASSWORD",$password);
736  $this->tpl->parseCurrentBlock();
737  }
738  else if ($this->registration_settings->getRegistrationType() == IL_REG_APPROVE)
739  {
740  $this->tpl->setVariable("TXT_REGISTERED", $lng->txt("txt_submitted"));
741  }
742  else if($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION)
743  {
744  $this->tpl->setVariable("TXT_REGISTERED", sprintf($lng->txt("reg_confirmation_link_successful"), './login.php'));
745  $this->tpl->setVariable("REDIRECT_URL", './login.php');
746  }
747  else
748  {
749  $this->tpl->setVariable("TXT_REGISTERED", $lng->txt("txt_registered_passw_gen"));
750  }
751  }
752 }
753 ?>