コード例 #1
0
 /**
  * @param string $password
  */
 public function login($password)
 {
     /**
      * @var $lng ilLanguage
      */
     global $lng;
     ilStartUpGUI::initStartUpTemplate(array('tpl.usr_registered.html', 'Services/Registration'), true);
     $this->tpl->setVariable('TXT_PAGEHEADLINE', $this->lng->txt('registration'));
     $this->tpl->setVariable("TXT_WELCOME", $lng->txt("welcome") . ", " . $this->userObj->getTitle() . "!");
     if (($this->registration_settings->getRegistrationType() == IL_REG_DIRECT || $this->registration_settings->getRegistrationType() == IL_REG_CODES || $this->code_was_used) && !$this->registration_settings->passwordGenerationEnabled()) {
         $this->tpl->setCurrentBlock('activation');
         $this->tpl->setVariable('TXT_REGISTERED', $lng->txt('txt_registered'));
         $this->tpl->setVariable('FORMACTION', 'login.php?cmd=post&target=' . ilUtil::stripSlashes($_GET['target']));
         if (ilSession::get('forceShoppingCartRedirect')) {
             $this->tpl->setVariable('FORMACTION', './login.php?forceShoppingCartRedirect=1');
         }
         $this->tpl->setVariable('TARGET', 'target="_parent"');
         $this->tpl->setVariable('TXT_LOGIN', $lng->txt('login_to_ilias'));
         $this->tpl->setVariable('USERNAME', $this->userObj->getLogin());
         $this->tpl->setVariable('PASSWORD', $password);
         $this->tpl->parseCurrentBlock();
     } else {
         if ($this->registration_settings->getRegistrationType() == IL_REG_APPROVE) {
             $this->tpl->setVariable('TXT_REGISTERED', $lng->txt('txt_submitted'));
             if (IS_PAYMENT_ENABLED == true) {
                 if (ilSession::get('forceShoppingCartRedirect')) {
                     $this->tpl->setCurrentBlock('activation');
                     include_once 'Services/Payment/classes/class.ilShopLinkBuilder.php';
                     $shop_link = new ilShopLinkBuilder();
                     $this->tpl->setVariable('FORMACTION', $shop_link->buildLink('ilshopshoppingcartgui', '_forceShoppingCartRedirect_user='******'TARGET', 'target=\'_parent\'');
                     $this->lng->loadLanguageModule('payment');
                     $this->tpl->setVariable('TXT_LOGIN', $lng->txt('pay_goto_shopping_cart'));
                     $this->tpl->parseCurrentBlock();
                     $this->lng->loadLanguageModule('registration');
                 }
             }
         } else {
             if ($this->registration_settings->getRegistrationType() == IL_REG_ACTIVATION) {
                 $login_url = './login.php?cmd=force_login&lang=' . $this->userObj->getLanguage();
                 $this->tpl->setVariable('TXT_REGISTERED', sprintf($lng->txt('reg_confirmation_link_successful'), $login_url));
                 $this->tpl->setVariable('REDIRECT_URL', $login_url);
             } else {
                 $this->tpl->setVariable('TXT_REGISTERED', $lng->txt('txt_registered_passw_gen'));
             }
         }
     }
 }
コード例 #2
0
 /**
  * This form is used to show a message to the user.
  * @param string $text
  */
 public function showMessageForm($text)
 {
     ilStartUpGUI::initStartUpTemplate('tpl.pwassist_message.html', true);
     $this->tpl->setVariable('TXT_PAGEHEADLINE', $this->lng->txt('password_assistance'));
     $this->tpl->setVariable('IMG_PAGEHEADLINE', ilUtil::getImagePath('icon_auth_b.png'));
     $this->tpl->setVariable('TXT_TEXT', str_replace("\\n", '<br />', $text));
     $this->tpl->show();
 }