/** * */ protected function storeRequest() { /** * @var $http ilHTTPS */ global $https; if (!ilSession::get('orig_request_target')) { //#16324 don't use the complete REQUEST_URI $url = substr($_SERVER['REQUEST_URI'], strrpos($_SERVER['REQUEST_URI'], "/") + 1); ilSession::set('orig_request_target', $url); } }
/** * */ protected function storeRequest() { /** * @var $http ilHTTPS */ global $https; if (!ilSession::get('orig_request_target')) { $target_protocol = 'http'; if ($https->isDetected()) { $target_protocol .= 's'; } $host = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']; $request_url = $_SERVER['REQUEST_URI'][0] == '/' ? $_SERVER['REQUEST_URI'] : '/' . $_SERVER['REQUEST_URI']; $url = $target_protocol . '://' . $host . $request_url; ilSession::set('orig_request_target', $url); } }
/** * Show terms of service */ protected function showTermsOfService() { /** * @var $lng ilLanguage * @var $tpl ilTemplate * @var $ilUser ilObjUser * @var $ilSetting ilSetting */ global $lng, $tpl, $ilUser, $ilSetting; $back_to_login = '******' != $this->ctrl->getCmd(); self::initStartUpTemplate('tpl.view_terms_of_service.html', $back_to_login, !$back_to_login); $tpl->setVariable('TXT_PAGEHEADLINE', $lng->txt('usr_agreement')); try { require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceSignableDocumentFactory.php'; $document = ilTermsOfServiceSignableDocumentFactory::getByLanguageObject($lng); if ('getAcceptance' == $this->ctrl->getCmd()) { if (isset($_POST['status']) && 'accepted' == $_POST['status']) { require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php'; ilTermsOfServiceHelper::trackAcceptance($ilUser, $document); if (ilSession::get('orig_request_target')) { $target = ilSession::get('orig_request_target'); ilSession::set('orig_request_target', ''); ilUtil::redirect($target); } else { ilUtil::redirect('index.php?target=' . $_GET['target'] . '&client_id=' . CLIENT_ID); } } $tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, $this->ctrl->getCmd())); $tpl->setVariable('ACCEPT_CHECKBOX', ilUtil::formCheckbox(0, 'status', 'accepted')); $tpl->setVariable('ACCEPT_TERMS_OF_SERVICE', $lng->txt('accept_usr_agreement')); $tpl->setVariable('TXT_SUBMIT', $lng->txt('submit')); } $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $document->getContent()); } catch (ilTermsOfServiceNoSignableDocumentFoundException $e) { $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', sprintf($lng->txt('no_agreement_description'), 'mailto:' . ilUtil::prepareFormOutput($ilSetting->get('feedback_recipient')))); } $tpl->show(); }
/** * Save personal data form * */ public function savePersonalData() { global $tpl, $lng, $ilCtrl, $ilUser, $ilSetting, $ilAuth; $this->initPersonalDataForm(); if ($this->form->checkInput()) { $form_valid = true; // if form field name differs from setter $map = array("firstname" => "FirstName", "lastname" => "LastName", "title" => "UTitle", "sel_country" => "SelectedCountry", "phone_office" => "PhoneOffice", "phone_home" => "PhoneHome", "phone_mobile" => "PhoneMobile", "referral_comment" => "Comment", "interests_general" => "GeneralInterests", "interests_help_offered" => "OfferingHelp", "interests_help_looking" => "LookingForHelp"); include_once "./Services/User/classes/class.ilUserProfile.php"; $up = new ilUserProfile(); foreach ($up->getStandardFields() as $f => $p) { // if item is part of form, it is currently valid (if not disabled) $item = $this->form->getItemByPostVar("usr_" . $f); if ($item && !$item->getDisabled()) { $value = $this->form->getInput("usr_" . $f); switch ($f) { case "birthday": if (is_array($value)) { if (is_array($value['date'])) { if ($value['d'] > 0 && $value['m'] > 0 && $value['y'] > 0) { $ilUser->setBirthday(sprintf("%04d-%02d-%02d", $value['y'], $value['m'], $value['d'])); } else { $ilUser->setBirthday(""); } } else { $ilUser->setBirthday($value['date']); } } break; default: $m = ucfirst($f); if (isset($map[$f])) { $m = $map[$f]; } $ilUser->{"set" . $m}($value); break; } } } $ilUser->setFullname(); // set instant messengers if ($this->workWithUserSetting("instant_messengers")) { $ilUser->setInstantMessengerId('icq', $this->form->getInput("usr_im_icq")); $ilUser->setInstantMessengerId('yahoo', $this->form->getInput("usr_im_yahoo")); $ilUser->setInstantMessengerId('msn', $this->form->getInput("usr_im_msn")); $ilUser->setInstantMessengerId('aim', $this->form->getInput("usr_im_aim")); $ilUser->setInstantMessengerId('skype', $this->form->getInput("usr_im_skype")); $ilUser->setInstantMessengerId('jabber', $this->form->getInput("usr_im_jabber")); $ilUser->setInstantMessengerId('voip', $this->form->getInput("usr_im_voip")); } // check map activation include_once "./Services/Maps/classes/class.ilMapUtil.php"; if (ilMapUtil::isActivated()) { $location = $this->form->getInput("location"); $ilUser->setLatitude(ilUtil::stripSlashes($location["latitude"])); $ilUser->setLongitude(ilUtil::stripSlashes($location["longitude"])); $ilUser->setLocationZoom(ilUtil::stripSlashes($location["zoom"])); } // Set user defined data $defs = $this->user_defined_fields->getVisibleDefinitions(); $udf = array(); foreach ($defs as $definition) { $f = "udf_" . $definition['field_id']; $item = $this->form->getItemByPostVar($f); if ($item && !$item->getDisabled()) { $udf[$definition['field_id']] = $this->form->getInput($f); } } $ilUser->setUserDefinedData($udf); // if loginname is changeable -> validate $un = $this->form->getInput('username'); if ((int) $ilSetting->get('allow_change_loginname') && $un != $ilUser->getLogin()) { if (!strlen($un) || !ilUtil::isLogin($un)) { ilUtil::sendFailure($lng->txt('form_input_not_valid')); $this->form->getItemByPostVar('username')->setAlert($this->lng->txt('login_invalid')); $form_valid = false; } else { if (ilObjUser::_loginExists($un, $ilUser->getId())) { ilUtil::sendFailure($lng->txt('form_input_not_valid')); $this->form->getItemByPostVar('username')->setAlert($this->lng->txt('loginname_already_exists')); $form_valid = false; } else { $ilUser->setLogin($un); try { $ilUser->updateLogin($ilUser->getLogin()); $ilAuth->setAuth($ilUser->getLogin()); $ilAuth->start(); } catch (ilUserException $e) { ilUtil::sendFailure($lng->txt('form_input_not_valid')); $this->form->getItemByPostVar('username')->setAlert($e->getMessage()); $form_valid = false; } } } } // everthing's ok. save form data if ($form_valid) { $this->uploadUserPicture(); // profile ok $ilUser->setProfileIncomplete(false); // save user data & object_data $ilUser->setTitle($ilUser->getFullname()); $ilUser->setDescription($ilUser->getEmail()); $ilUser->update(); ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true); if (ilSession::get('orig_request_target')) { $target = ilSession::get('orig_request_target'); ilSession::set('orig_request_target', ''); ilUtil::redirect($target); } else { if ($redirect = $_SESSION['profile_complete_redirect']) { unset($_SESSION['profile_complete_redirect']); ilUtil::redirect($redirect); } else { $ilCtrl->redirect($this, "showPersonalData"); } } } } $this->form->setValuesByPost(); $this->showPersonalData(true); }
/** * Save password form * */ public function savePassword() { global $tpl, $lng, $ilCtrl, $ilUser, $ilSetting; // normally we should not end up here if (!$this->allowPasswordChange()) { $ilCtrl->redirect($this, "showPersonalData"); return; } $this->initPasswordForm(); if ($this->form->checkInput()) { $cp = $this->form->getItemByPostVar("current_password"); $np = $this->form->getItemByPostVar("new_password"); $error = false; // The old password needs to be checked for verification // unless the user uses Shibboleth authentication with additional // local authentication for WebDAV. #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local")) if ($ilUser->getAuthMode(true) == AUTH_LOCAL) { require_once 'Services/User/classes/class.ilUserPasswordManager.php'; if (!ilUserPasswordManager::getInstance()->verifyPassword($ilUser, ilUtil::stripSlashes($_POST['current_password']))) { $error = true; $cp->setAlert($this->lng->txt('passwd_wrong')); } } // select password from auto generated passwords if ($this->ilias->getSetting("passwd_auto_generate") == 1 && !ilUtil::isPassword($_POST["new_password"])) { $error = true; $np->setAlert($this->lng->txt("passwd_not_selected")); } if ($this->ilias->getSetting("passwd_auto_generate") != 1 && !ilUtil::isPassword($_POST["new_password"], $custom_error)) { $error = true; if ($custom_error != '') { $np->setAlert($custom_error); } else { $np->setAlert($this->lng->txt("passwd_invalid")); } } $error_lng_var = ''; if ($this->ilias->getSetting("passwd_auto_generate") != 1 && !ilUtil::isPasswordValidForUserContext($_POST["new_password"], $ilUser, $error_lng_var)) { ilUtil::sendFailure($this->lng->txt('form_input_not_valid')); $np->setAlert($this->lng->txt($error_lng_var)); $error = true; } if ($this->ilias->getSetting("passwd_auto_generate") != 1 && ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) && $_POST["current_password"] == $_POST["new_password"]) { $error = true; $np->setAlert($this->lng->txt("new_pass_equals_old_pass")); } if (!$error) { $ilUser->resetPassword($_POST["new_password"], $_POST["new_password"]); if ($_POST["current_password"] != $_POST["new_password"]) { $ilUser->setLastPasswordChangeToNow(); } if (ilSession::get('orig_request_target')) { ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true); $target = ilSession::get('orig_request_target'); ilSession::set('orig_request_target', ''); ilUtil::redirect($target); } else { ilUtil::sendSuccess($this->lng->txt('saved_successfully')); $this->showPassword(true, true); return; } } } $this->form->setValuesByPost(); $this->showPassword(true); }
/** * Set message. Please use ilUtil::sendInfo(), ilUtil::sendSuccess() * and ilUtil::sendFailure() */ function setMessage($a_type, $a_txt, $a_keep = false) { if (!in_array($a_type, array("info", "success", "failure", "question")) || $a_txt == "") { return; } if ($a_type == "question") { $a_type = "mess_question"; } if (!$a_keep) { $this->message[$a_type] = $a_txt; } else { ilSession::set($a_type, $a_txt); } }
/** * @param bool|null $status * @return void|bool */ public function hasToAcceptTermsOfServiceInSession($status = null) { if (null === $status) { return ilSession::get('has_to_accept_agr_in_session'); } require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php'; if (ilTermsOfServiceHelper::isEnabled()) { ilSession::set('has_to_accept_agr_in_session', (int) $status); } }
/** * Show page * * @param * @return */ function showPage() { global $lng; $page_id = (int) $_GET["help_page"]; $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help"); include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; $h_tpl->setCurrentBlock("backlink"); $h_tpl->setVariable("TXT_BACK", $lng->txt("back")); $h_tpl->setVariable("ONCLICK_BACK", "return il.Help.listHelp(event, true);"); $h_tpl->parseCurrentBlock(); $h_tpl->setVariable("HEAD", $lng->txt("help") . " - " . ilLMObject::_lookupTitle($page_id)); include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id)) { exit; } include_once "./Services/COPage/classes/class.ilPageObject.php"; include_once "./Services/COPage/classes/class.ilPageObjectGUI.php"; // get page object include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php"; include_once "./Modules/LearningModule/classes/class.ilLMPageGUI.php"; $page_gui = new ilLMPageGUI($page_id); $cfg = $page_gui->getPageConfig(); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $page_gui->setRawPageContent(true); $cfg->setEnablePCType("Map", false); $cfg->setEnablePCType("Tabs", false); $cfg->setEnablePCType("FileList", false); $page_gui->getPageObject()->buildDom(); $int_links = $page_gui->getPageObject()->getInternalLinks(); $link_xml = $this->getLinkXML($int_links); $link_xml .= $this->getLinkTargetsXML(); //echo htmlentities($link_xml); $page_gui->setLinkXML($link_xml); $ret = $page_gui->showPage(); $h_tpl->setVariable("CONTENT", $ret); $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png"))); ilSession::set("help_pg", $page_id); $page = $h_tpl->get(); // replace style classes //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page); echo $page; exit; }
/** * Filter tooltips * * @param * @return */ function filterTooltips() { global $lng, $ilCtrl; ilSession::set("help_tt_comp", ilUtil::stripSlashes($_POST["help_tt_comp"])); $ilCtrl->redirect($this, "showTooltipList"); }
protected function storeTokenToSession() { ilSession::set(self::EXOD_AUTH_BEARER, serialize($this->getExodBearerToken())); }
public function executeCommand() { if ($_GET["type"] == "search_res") { $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "attach") { ilMailFormCall::storeReferer($_GET); $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "new") { $_SESSION['rcp_to'] = $_GET['rcp_to']; $_SESSION['rcp_cc'] = $_GET['rcp_cc']; $_SESSION['rcp_bcc'] = $_GET['rcp_bcc']; ilMailFormCall::storeReferer($_GET); $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "reply") { $_SESSION['mail_id'] = $_GET['mail_id']; $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "read") { $_SESSION['mail_id'] = $_GET['mail_id']; $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail"); $this->ctrl->redirectByClass("ilmailfoldergui"); } if ($_GET["type"] == "deliverFile") { $_SESSION['mail_id'] = $_GET['mail_id']; $_SESSION['filename'] = $_POST["filename"] ? $_POST["filename"] : $_GET["filename"]; $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile"); $this->ctrl->redirectByClass("ilmailfoldergui"); } if ($_GET["type"] == "message_sent") { ilUtil::sendInfo($this->lng->txt('mail_message_send'), true); $this->ctrl->redirectByClass("ilmailfoldergui"); } if ($_GET["type"] == "role") { if (is_array($_POST['roles'])) { $_SESSION['mail_roles'] = $_POST['roles']; } else { if ($_GET["role"]) { $_SESSION['mail_roles'] = array($_GET["role"]); } } ilMailFormCall::storeReferer($_GET); $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["view"] == "my_courses") { $_SESSION['search_crs'] = $_GET['search_crs']; $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo"); $this->ctrl->redirectByClass("ilmailformgui"); } if (isset($_GET["viewmode"])) { ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]); $this->ctrl->setCmd("setViewMode"); } $this->forwardClass = $this->ctrl->getNextClass($this); $this->showHeader(); if ('tree' == ilSession::get(self::VIEWMODE_SESSION_KEY) && $this->ctrl->getCmd() != "showExplorer") { $this->showExplorer(); } include_once "Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery(); switch ($this->forwardClass) { case 'ilmailformgui': include_once 'Services/Mail/classes/class.ilMailFormGUI.php'; $this->ctrl->forwardCommand(new ilMailFormGUI()); break; case 'ilmailaddressbookgui': include_once 'Services/Contact/classes/class.ilMailAddressbookGUI.php'; $this->ctrl->forwardCommand(new ilMailAddressbookGUI()); break; case 'ilmailoptionsgui': include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php'; $this->ctrl->forwardCommand(new ilMailOptionsGUI()); break; case 'ilmailfoldergui': include_once 'Services/Mail/classes/class.ilMailFolderGUI.php'; $this->ctrl->forwardCommand(new ilMailFolderGUI()); break; default: if (!($cmd = $this->ctrl->getCmd())) { $cmd = "setViewMode"; } $this->{$cmd}(); break; } return true; }
/** * migrate account * * @access public * */ public function migrateAccount() { global $lng, $ilClientIniFile, $ilLog, $rbacadmin; $lng->loadLanguageModule('auth'); if (!isset($_POST['account_migration'])) { $this->showAccountMigration($lng->txt('err_choose_migration_type')); return false; } if ($_POST['account_migration'] == 1 and (!strlen($_POST['mig_username']) or !strlen($_POST['mig_password']))) { $this->showAccountMigration($lng->txt('err_wrong_login')); return false; } if ($_POST['account_migration'] == 1) { if (!($user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST['mig_username'])))) { $this->showAccountMigration($lng->txt('err_wrong_login')); return false; } $_POST['username'] = $_POST['mig_username']; $_POST['password'] = $_POST['mig_password']; include_once './Services/Authentication/classes/class.ilAuthFactory.php'; include_once './Services/Database/classes/class.ilAuthContainerMDB2.php'; $ilAuth = ilAuthFactory::factory(new ilAuthContainerMDB2()); $ilAuth->start(); if (!$ilAuth->checkAuth()) { $ilAuth->logout(); $this->showAccountMigration($lng->txt('err_wrong_login')); return false; } $user = new ilObjUser($user_id); $user->setAuthMode(ilSession::get('tmp_auth_mode')); $user->setExternalAccount(ilSession::get('tmp_external_account')); $user->setActive(true); $user->update(); // Assign to default role if (is_array(ilSession::get('tmp_roles'))) { foreach (ilSession::get('tmp_roles') as $role) { $rbacadmin->assignUser((int) $role, $user->getId()); } } // Log migration $ilLog->write(__METHOD__ . ': Migrated ' . ilSession::get('tmp_external_account') . ' to ILIAS account ' . $user->getLogin() . '.'); } elseif ($_POST['account_migration'] == 2) { switch (ilSession::get('tmp_auth_mode')) { case 'apache': $_POST['username'] = ilSession::get('tmp_external_account'); $_POST['password'] = ilSession::get('tmp_pass'); include_once 'Services/AuthApache/classes/class.ilAuthContainerApache.php'; $container = new ilAuthContainerApache(); $container->forceCreation(true); $ilAuth = ilAuthFactory::factory($container); $ilAuth->start(); break; case 'ldap': $_POST['username'] = ilSession::get('tmp_external_account'); $_POST['password'] = ilSession::get('tmp_pass'); include_once 'Services/LDAP/classes/class.ilAuthContainerLDAP.php'; $container = new ilAuthContainerLDAP(); $container->forceCreation(true); $ilAuth = ilAuthFactory::factory($container); $ilAuth->start(); break; case 'radius': $_POST['username'] = ilSession::get('tmp_external_account'); $_POST['password'] = ilSession::get('tmp_pass'); include_once './Services/Authentication/classes/class.ilAuthFactory.php'; include_once './Services/Radius/classes/class.ilAuthContainerRadius.php'; $container = new ilAuthContainerRadius(); $container->forceCreation(true); $ilAuth = ilAuthFactory::factory($container); $ilAuth->start(); break; case 'openid': $_POST['username'] = ilSession::get('dummy'); $_POST['password'] = ilSession::get('dummy'); $_POST['oid_username'] = ilSession::get('tmp_oid_username'); $_POST['oid_provider'] = ilSession::get('tmp_oid_provider'); //ilSession::set('force_creation', true); include_once './Services/Authentication/classes/class.ilAuthFactory.php'; include_once './Services/OpenId/classes/class.ilAuthContainerOpenId.php'; $container = new ilAuthContainerOpenId(); $container->forceCreation(true); ilAuthFactory::setContext(ilAuthFactory::CONTEXT_OPENID); include_once './Services/OpenId/classes/class.ilAuthOpenId.php'; $ilAuth = ilAuthFactory::factory($container); // logout first to initiate a new login session $ilAuth->logout(); ilSession::_destroy(session_id()); ilSession::set('force_creation', true); $ilAuth->start(); } // Redirect to acceptance ilUtil::redirect("ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&target=" . $_GET["target"] . "&cmd=getAcceptance"); } // show personal desktop ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI'); }
/** * Show terms of service */ protected function showTermsOfService() { /** * @var $lng ilLanguage * @var $tpl ilTemplate * @var $ilUser ilObjUser * @var $ilSetting ilSetting */ global $lng, $tpl, $ilUser, $ilSetting; $back_to_login = '******' != $this->ctrl->getCmd(); self::initStartUpTemplate('tpl.view_terms_of_service.html', $back_to_login, !$back_to_login); $tpl->setVariable('TXT_PAGEHEADLINE', $lng->txt('usr_agreement')); // #9728 $lang_opts = array(); foreach ($lng->getInstalledLanguages() as $lang_key) { $lang_opts[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key); } if (sizeof($lang_opts) > 1) { asort($lang_opts); foreach ($lang_opts as $lang_key => $lang_caption) { $tpl->setCurrentBlock('lang_headline_languages'); $tpl->setVariable('LANG_HEADLINE_LANGUAGES_LANG_NAME', $lang_caption); $tpl->setVariable('LANG_HEADLINE_LANGUAGES_LANG_KEY', $lang_key); if ($lang_key == $lng->getLangKey()) { $tpl->setVariable('LANG_HEADLINE_LANGUAGES_SELECTED_LANG', ' selected="selected"'); } $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('lang_headline'); $tpl->setVariable('LANG_CHANGE_CMD', $this->ctrl->getCmd()); $tpl->setVariable('LANG_CHANGE_FORMACTION', $this->ctrl->getFormAction($this, $this->ctrl->getCmd())); $tpl->setVariable('LANG_CHANGE_TXT_OK', $lng->txt('ok')); $tpl->setVariable('LANG_CHANGE_TXT_CHOOSE_LANGUAGE', $lng->txt('choose_language')); $tpl->setCurrentBlock('lang_headline'); } try { require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceSignableDocumentFactory.php'; $document = ilTermsOfServiceSignableDocumentFactory::getByLanguageObject($lng); if ('getAcceptance' == $this->ctrl->getCmd()) { if (isset($_POST['status']) && 'accepted' == $_POST['status']) { require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php'; ilTermsOfServiceHelper::trackAcceptance($ilUser, $document); if (ilSession::get('orig_request_target')) { $target = ilSession::get('orig_request_target'); ilSession::set('orig_request_target', ''); ilUtil::redirect($target); } else { ilUtil::redirect('index.php?target=' . $_GET['target'] . '&client_id=' . CLIENT_ID); } } $tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, $this->ctrl->getCmd())); $tpl->setVariable('ACCEPT_CHECKBOX', ilUtil::formCheckbox(0, 'status', 'accepted')); $tpl->setVariable('ACCEPT_TERMS_OF_SERVICE', $lng->txt('accept_usr_agreement')); $tpl->setVariable('TXT_SUBMIT', $lng->txt('submit')); } $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', $document->getContent()); } catch (ilTermsOfServiceNoSignableDocumentFoundException $e) { $tpl->setVariable('TERMS_OF_SERVICE_CONTENT', sprintf($lng->txt('no_agreement_description'), 'mailto:' . $ilSetting->get('feedback_recipient'))); } $tpl->show(); }
function finishTestCmd($requires_confirmation = true) { global $ilUser, $ilAuth; unset($_SESSION["tst_next"]); $active_id = $this->testSession->getActiveId(); $actualpass = $this->object->_getPass($active_id); $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->testSession->getTestId(), $active_id, $actualpass); /* * The following "endgames" are possible prior to actually finishing the test: * - Obligations (Ability to finish the test.) * If not all obligatory questions are answered, the user is presented a list * showing the deficits. * - Examview (Will to finish the test.) * With the examview, the participant can review all answers given in ILIAS or a PDF prior to * commencing to the finished test. * - Last pass allowed (Reassuring the will to finish the test.) * If passes are limited, on the last pass, an additional confirmation is to be displayed. */ // Obligations fulfilled? redirectQuestion : one or the other summary -> no finish if ($this->object->areObligationsEnabled() && !$allObligationsAnswered) { if ($this->object->getListOfQuestions()) { $_GET['activecommand'] = 'summary_obligations'; } else { $_GET['activecommand'] = 'summary_obligations_only'; } $this->redirectQuestion(); return; } // Examview enabled & !reviewed & requires_confirmation? test_submission_overview (review gui) if ($this->object->getEnableExamview() && !isset($_GET['reviewed']) && $requires_confirmation) { $_GET['activecommand'] = 'test_submission_overview'; $this->redirectQuestionCmd(); return; } // Last try in limited tries & !confirmed if ($requires_confirmation && $actualpass == $this->object->getNrOfTries() - 1) { if ($this->object->canShowSolutionPrintview($ilUser->getId())) { $template = new ilTemplate("tpl.il_as_tst_finish_navigation.html", TRUE, TRUE, "Modules/Test"); $template->setVariable("BUTTON_FINISH", $this->lng->txt("btn_next")); $template->setVariable("BUTTON_CANCEL", $this->lng->txt("btn_previous")); $template_top = new ilTemplate("tpl.il_as_tst_list_of_answers_topbuttons.html", TRUE, TRUE, "Modules/Test"); $template_top->setCurrentBlock("button_print"); $template_top->setVariable("BUTTON_PRINT", $this->lng->txt("print")); $template_top->parseCurrentBlock(); $this->showListOfAnswers($active_id, NULL, $template_top->get(), $template->get()); return; } else { // show confirmation page return $this->confirmFinishTestCmd(); } } // Last try in limited tries & confirmed? if ($actualpass == $this->object->getNrOfTries() - 1 && !$requires_confirmation) { $this->object->setActiveTestSubmitted($ilUser->getId()); $ilAuth->setIdle(ilSession::getIdleValue(), false); $ilAuth->setExpire(0); switch ($this->object->getMailNotification()) { case 1: $this->object->sendSimpleNotification($active_id); break; case 2: $this->object->sendAdvancedNotification($active_id); break; } } // Non-last try finish if (!$_SESSION['tst_pass_finish']) { if (!$_SESSION['tst_pass_finish']) { $_SESSION['tst_pass_finish'] = 1; } if ($this->object->getMailNotificationType() == 1) { switch ($this->object->getMailNotification()) { case 1: $this->object->sendSimpleNotification($active_id); break; case 2: $this->object->sendAdvancedNotification($active_id); break; } } $this->testSession->increaseTestPass(); ilSession::set('passincreased', $actualpass); } if ($this->object->getEnableArchiving()) { $this->archiveParticipantSubmission($active_id, $actualpass); } /** @var $ilPluginAdmin ilPluginAdmin */ global $ilPluginAdmin, $ilCtrl; if ($this->object->getSignSubmission() && count($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'tsig')) != 0) { $key = 'signed_' . $active_id . '_' . $actualpass; if (ilSession::get('passincreased') != null) { $key = 'signed_' . $active_id . '_' . ilSession::get('passincreased'); } $val = ilSession::get($key); if (is_null($val)) { /** @var $ilCtrl ilCtrl */ $ilCtrl->redirectByClass('ilTestSignatureGUI', 'invokeSignaturePlugin'); } } // Redirect after test $redirection_mode = $this->object->getRedirectionMode(); $redirection_url = $this->object->getRedirectionUrl(); if ($redirection_url && $redirection_mode && !$this->object->canViewResults()) { if ($redirection_mode == REDIRECT_KIOSK) { if ($this->object->getKioskMode()) { ilUtil::redirect($redirection_url); } } else { ilUtil::redirect($redirection_url); } } $this->redirectBackCmd(); }
/** * This is to be called by the plugin at the end of the signature process to redirect the user back to the test. */ public function redirectToTest($success) { /** @var $ilCtrl ilCtrl */ /** @var $ilUser ilObjUser */ global $ilCtrl, $ilUser; $active = $this->test->getActiveIdOfUser($ilUser->getId()); $pass = $this->test->_getMaxPass($active); $key = 'signed_' . $active . '_' . $pass; ilSession::set($key, $success); $ilCtrl->redirect($this->ilTestOutputGUI, 'afterTestPassFinished'); return; }
/** * Show page * * @param * @return */ function showPage() { global $lng; $page_id = (int) $_GET["help_page"]; $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help"); include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; $h_tpl->setCurrentBlock("backlink"); $h_tpl->setVariable("TXT_BACK", $lng->txt("back")); $h_tpl->setVariable("ONCLICK_BACK", "return il.Help.listHelp(event, true);"); $h_tpl->parseCurrentBlock(); $h_tpl->setVariable("HEAD", $lng->txt("help") . " - " . ilLMObject::_lookupTitle($page_id)); include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("lm", $page_id)) { exit; } include_once "./Services/COPage/classes/class.ilPageObject.php"; include_once "./Services/COPage/classes/class.ilPageObjectGUI.php"; // get page object include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php"; $page_gui =& new ilPageObjectGUI("lm", $page_id); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); $page_gui->setEnabledFileLists(false); $page_gui->setEnabledPCTabs(false); $page_gui->setFileDownloadLink("."); $page_gui->setFullscreenLink("."); $page_gui->setSourcecodeDownloadScript("."); $page_gui->setRawPageContent(true); $page_gui->setEnabledMaps(false); $ret = $page_gui->showPage(); $h_tpl->setVariable("CONTENT", $ret); $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png"))); ilSession::set("help_pg", $page_id); $page = $h_tpl->get(); // replace style classes //$page = str_replace("ilc_text_inline_Strong", "ilHelpStrong", $page); echo $page; exit; }
/** * init HTML output (level 3) */ protected static function initHTML() { global $ilUser; if (ilContext::hasUser()) { // load style definitions // use the init function with plugin hook here, too self::initStyle(); } // $tpl $tpl = new ilTemplate("tpl.main.html", true, true); self::initGlobal("tpl", $tpl); if (ilContext::hasUser() && ilContext::doAuthentication()) { /** * @var $ilUser ilObjUser * @var $ilCtrl ilCtrl */ global $ilUser, $ilCtrl; require_once 'Services/User/classes/class.ilUserRequestTargetAdjustment.php'; $request_adjuster = new ilUserRequestTargetAdjustment($ilUser, $ilCtrl); $request_adjuster->adjust(); } // load style sheet depending on user's settings $location_stylesheet = ilUtil::getStyleSheetLocation(); $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet); require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php"; self::initGlobal("ilNavigationHistory", "ilNavigationHistory", "Services/Navigation/classes/class.ilNavigationHistory.php"); self::initGlobal("ilBrowser", "ilBrowser", "./Services/Utilities/classes/class.ilBrowser.php"); self::initGlobal("ilHelp", "ilHelpGUI", "Services/Help/classes/class.ilHelpGUI.php"); self::initGlobal("ilToolbar", "ilToolbarGUI", "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"); self::initGlobal("ilLocator", "ilLocatorGUI", "./Services/Locator/classes/class.ilLocatorGUI.php"); self::initGlobal("ilTabs", "ilTabsGUI", "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"); if (ilContext::hasUser()) { // $ilMainMenu include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php'; $ilMainMenu = new ilMainMenuGUI("_top"); self::initGlobal("ilMainMenu", $ilMainMenu); unset($ilMainMenu); // :TODO: tableGUI related // set hits per page for all lists using table module $_GET['limit'] = (int) $ilUser->getPref('hits_per_page'); ilSession::set('tbl_limit', $_GET['limit']); // the next line makes it impossible to save the offset somehow in a session for // a specific table (I tried it for the user administration). // its not posssible to distinguish whether it has been set to page 1 (=offset = 0) // or not set at all (then we want the last offset, e.g. being used from a session var). // So I added the wrapping if statement. Seems to work (hopefully). // Alex April 14th 2006 if (isset($_GET['offset']) && $_GET['offset'] != "") { $_GET['offset'] = (int) $_GET['offset']; // old code } } else { // several code parts rely on ilObjUser being always included include_once "Services/User/classes/class.ilObjUser.php"; } }
protected function initSessionStorage() { $sess = ilSession::get('frm'); if (!is_array($sess)) { $sess = array(); ilSession::set('frm', $sess); } if (isset($_GET['thr_fk']) && !is_array($sess[(int) $_GET['thr_fk']])) { $sess[(int) $_GET['thr_fk']] = array(); ilSession::set('frm', $sess); } }
protected function hitsperpageObject() { ilSession::set("tbl_limit", $_POST["hitsperpage"]); $_GET["limit"] = $_POST["hitsperpage"]; }
public function executeCommand() { global $ilUser; // Check for incomplete profile if ($ilUser->getProfileIncomplete()) { ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI'); } // check whether password of user have to be changed // due to first login or password of user is expired if ($ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired()) { ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI'); } if ($_GET["type"] == "search_res") { $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "attach") { ilMailFormCall::storeReferer($_GET); $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "new") { $_SESSION['rcp_to'] = $_GET['rcp_to']; $_SESSION['rcp_cc'] = $_GET['rcp_cc']; $_SESSION['rcp_bcc'] = $_GET['rcp_bcc']; ilMailFormCall::storeReferer($_GET); $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "reply") { $_SESSION['mail_id'] = $_GET['mail_id']; $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["type"] == "read") { $_SESSION['mail_id'] = $_GET['mail_id']; $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail"); $this->ctrl->redirectByClass("ilmailfoldergui"); } if ($_GET["type"] == "deliverFile") { $_SESSION['mail_id'] = $_GET['mail_id']; $_SESSION['filename'] = $_POST["filename"] ? $_POST["filename"] : $_GET["filename"]; $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile"); $this->ctrl->redirectByClass("ilmailfoldergui"); } if ($_GET["type"] == "message_sent") { ilUtil::sendInfo($this->lng->txt('mail_message_send'), true); $this->ctrl->redirectByClass("ilmailfoldergui"); } if ($_GET["type"] == "role") { if (is_array($_POST['roles'])) { $_SESSION['mail_roles'] = $_POST['roles']; } else { if ($_GET["role"]) { $_SESSION['mail_roles'] = array($_GET["role"]); } } ilMailFormCall::storeReferer($_GET); $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole"); $this->ctrl->redirectByClass("ilmailformgui"); } if ($_GET["view"] == "my_courses") { $_SESSION['search_crs'] = $_GET['search_crs']; $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo"); $this->ctrl->redirectByClass("ilmailformgui"); } if (isset($_GET["viewmode"])) { ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]); $this->ctrl->setCmd("setViewMode"); } $this->forwardClass = $this->ctrl->getNextClass($this); if ($this->ctrl->getCmd() != "showMenu" && $this->ctrl->getCmd() != "refresh") { $this->showHeader(); } include_once "Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery(); switch ($this->forwardClass) { case 'ilmailformgui': include_once 'Services/Mail/classes/class.ilMailFormGUI.php'; $this->ctrl->forwardCommand(new ilMailFormGUI()); break; case 'ilmailaddressbookgui': include_once 'Services/Contact/classes/class.ilMailAddressbookGUI.php'; $this->ctrl->forwardCommand(new ilMailAddressbookGUI()); break; case 'ilmailoptionsgui': include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php'; $this->ctrl->forwardCommand(new ilMailOptionsGUI()); break; case 'ilmailfoldergui': include_once 'Services/Mail/classes/class.ilMailFolderGUI.php'; $this->ctrl->forwardCommand(new ilMailFolderGUI()); break; default: if (!($cmd = $this->ctrl->getCmd())) { $cmd = "setViewMode"; } $this->{$cmd}(); break; } return true; }