本文整理汇总了PHP中ilSession::set方法的典型用法代码示例。如果您正苦于以下问题:PHP ilSession::set方法的具体用法?PHP ilSession::set怎么用?PHP ilSession::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilSession
的用法示例。
在下文中一共展示了ilSession::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: storeRequest
/**
*
*/
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);
}
}
示例2: storeRequest
/**
*
*/
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);
}
}
示例3: showTermsOfService
/**
* 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 = 'getAcceptance' != $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();
}
示例4: savePersonalData
/**
* 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
//.........这里部分代码省略.........
示例5: savePassword
/**
* 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);
}
示例6: setMessage
/**
* 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);
}
}
示例7: hasToAcceptTermsOfServiceInSession
/**
* @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);
}
}
示例8: showPage
/**
* 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;
}
示例9: filterTooltips
/**
* Filter tooltips
*
* @param
* @return
*/
function filterTooltips()
{
global $lng, $ilCtrl;
ilSession::set("help_tt_comp", ilUtil::stripSlashes($_POST["help_tt_comp"]));
$ilCtrl->redirect($this, "showTooltipList");
}
示例10: storeTokenToSession
protected function storeTokenToSession()
{
ilSession::set(self::EXOD_AUTH_BEARER, serialize($this->getExodBearerToken()));
}
示例11: executeCommand
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;
}
示例12: migrateAccount
/**
* 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
//.........这里部分代码省略.........
示例13: showTermsOfService
/**
* 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 = 'getAcceptance' != $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();
}
示例14: finishTestCmd
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
//.........这里部分代码省略.........
示例15: redirectToTest
/**
* 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;
}