当前位置: 首页>>代码示例>>PHP>>正文


PHP ilUtil::redirect方法代码示例

本文整理汇总了PHP中ilUtil::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::redirect方法的具体用法?PHP ilUtil::redirect怎么用?PHP ilUtil::redirect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilUtil的用法示例。


在下文中一共展示了ilUtil::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeCommand

 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');
     }
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         case 'ilpageobjectgui':
             $this->prepareOutput();
             $ret = $this->forwardToPageObject();
             if ($ret != '') {
                 $this->tpl->setContent($ret);
             }
             break;
         default:
             switch ($this->cmd) {
                 case 'firstpage':
                     $this->clearFilter();
                     if (!$this->genSet->get('show_general_filter') && !$this->genSet->get('show_topics_filter') && !$this->genSet->get('show_shop_explorer')) {
                         $cmd = 'performSearch';
                     } else {
                         if (ilPaymentSettings::useShopSpecials() == true) {
                             $cmd = 'showSpecialContent';
                         } else {
                             $cmd = 'performSearch';
                         }
                     }
                     break;
                 case 'resetFilter':
                     $cmd = 'resetFilter';
                     break;
                 case 'setFilter':
                     $cmd = 'setFilter';
                     break;
                 default:
                     $cmd = 'performSearch';
                     break;
             }
             if ($this->cmd != 'firstpage' && (isset($_GET['ref_id']) || $this->cmd == 'showTree')) {
                 $obj_type = ilObject::_lookupType(ilObject::_lookupObjId($this->cur_ref_id));
                 $container = array("root", "cat", 'catr', "grp", "icrs", "crs", 'crsr', 'rcrs');
                 if (in_array($obj_type, $container)) {
                     $cmd = 'showContainerContent';
                 } else {
                     $cmd = 'performSearch';
                 }
             }
             $this->prepareOutput();
             $this->{$cmd}();
             break;
     }
     return true;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:60,代码来源:class.ilShopGUI.php

示例2: handleCode

 /**
  * Handle target parameter
  * @param object $a_target
  * @return 
  */
 public static function handleCode($a_ref_id, $a_type, $a_code)
 {
     global $lng, $tree, $ilUser;
     include_once './Services/Link/classes/class.ilLink.php';
     $lng->loadLanguageModule($a_type);
     try {
         self::useCode($a_code, $a_ref_id);
         $title = ilObject::_lookupTitle(ilObject::_lookupObjectId($a_ref_id));
         ilUtil::sendSuccess(sprintf($lng->txt($a_type . "_admission_link_success_registration"), $title), true);
         ilUtil::redirect(ilLink::_getLink($a_ref_id));
     } catch (ilMembershipRegistrationException $e) {
         switch ($e->getCode()) {
             case 124:
                 //added to waiting list
                 ilUtil::sendSuccess($e->getMessage(), true);
                 break;
             case 123:
                 //object is full
                 ilUtil::sendFailure($lng->txt($a_type . "_admission_link_failure_membership_limited"), true);
                 break;
             case 789:
                 //out of registration period
                 ilUtil::sendFailure($lng->txt($a_type . "_admission_link_failure_registration_period"), true);
                 break;
             default:
                 ilUtil::sendFailure($e->getMessage(), true);
                 break;
         }
         $GLOBALS['ilLog']->logStack();
         $GLOBALS['ilLog']->write($e->getCode() . ': ' . $e->getMessage());
         $parent_id = $tree->getParentId($a_ref_id);
         ilUtil::redirect(ilLink::_getLink($parent_id));
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:39,代码来源:class.ilMembershipRegistrationCodeUtils.php

示例3: checkPermission

 protected function checkPermission($a_cmd)
 {
     global $ilAccess;
     $ref_id = $this->object->getRefId();
     if (!$ilAccess->checkAccess($a_cmd, "", $ref_id)) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         ilUtil::redirect("goto.php?target=" . $this->object->getType() . "_" . $ref_id);
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:9,代码来源:class.ilContainerStartObjectsGUI.php

示例4: adjust

 /**
  * @return void
  */
 public function adjust()
 {
     if (isset($_GET['baseClass']) && strtolower($_GET['baseClass']) == 'ilpersonaldesktopgui') {
         $this->ctrl->setTargetScript('ilias.php');
         ilUtil::redirect($this->ctrl->getLinkTargetByClass(array('ilpersonaldesktopgui', 'ilpersonalprofilegui'), 'showPersonalData', '', false, false));
     } else {
         ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilUserProfileIncompleteRequestTargetAdjustmentCase.php

示例5: handleCode

 /**
  * Handle target parameter
  * @param object $a_target
  * @return 
  */
 public static function handleCode($a_ref_id, $a_type, $a_code)
 {
     include_once './Services/Link/classes/class.ilLink.php';
     try {
         self::useCode($a_code, $a_ref_id);
         ilUtil::redirect(ilLink::_getLink($a_ref_id, ilObject::_lookupType(ilObject::_lookupObjId($a_ref_id))));
     } catch (Exception $e) {
         $GLOBALS['ilLog']->logStack();
         $GLOBALS['ilLog']->write($e->getMessage());
         ilUtil::redirect(ilLink::_getLink($e->getCode(), ilObject::_lookupType(ilObject::_lookupObjId($e->getCode()))));
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:17,代码来源:class.ilMembershipRegistrationCodeUtils.php

示例6: switch

 function &executeCommand()
 {
     global $rbacsystem, $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');
     }
     include_once 'Services/Search/classes/class.ilSearchSettings.php';
     // Check hacks
     if (!$rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
     switch ($forward_class) {
         case 'illucenesearchgui':
             $this->setLastClass('illucenesearchgui');
             include_once './Services/Search/classes/Lucene/class.ilLuceneSearchGUI.php';
             $this->ctrl->forwardCommand(new ilLuceneSearchGUI());
             break;
         case 'illuceneadvancedsearchgui':
             $this->setLastClass('illuceneadvancedsearchgui');
             include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchGUI.php';
             $this->ctrl->forwardCommand(new ilLuceneAdvancedSearchGUI());
             break;
         case 'iladvancedsearchgui':
             // Remember last class
             $this->setLastClass('iladvancedsearchgui');
             include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
             $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
             break;
         case 'ilsearchgui':
             // Remember last class
             $this->setLastClass('ilsearchgui');
         default:
             include_once 'Services/Search/classes/class.ilSearchGUI.php';
             $search_gui = new ilSearchGUI();
             $this->ctrl->forwardCommand($search_gui);
             break;
     }
     $this->tpl->show();
     return true;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:47,代码来源:class.ilSearchController.php

示例7: renderFullscreen

 protected function renderFullscreen()
 {
     global $tpl, $lng, $ilMainMenu;
     if (!ilImprint::isActive()) {
         ilUtil::redirect("ilias.php?baseClass=ilPersonalDesktopGUI");
     }
     $tpl->getStandardTemplate();
     $this->setRawPageContent(true);
     $html = $this->showPage();
     $itpl = new ilTemplate("tpl.imprint.html", true, true, "Services/Imprint");
     $itpl->setVariable("PAGE_TITLE", $lng->txt("imprint"));
     $itpl->setVariable("IMPRINT", $html);
     unset($html);
     $tpl->setContent($itpl->get());
     $ilMainMenu->showLogoOnly(true);
     echo $tpl->show("DEFAULT", true, false);
     exit;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:18,代码来源:class.ilImprintGUI.php

示例8: sendMailToSelectedUsers

 /**
  * show send mail
  *
  * @access public
  * @param
  * @return
  */
 public function sendMailToSelectedUsers()
 {
     if (isset($_GET['member_id'])) {
         $_POST['participants'] = array($_GET['member_id']);
     } else {
         $_POST['participants'] = array_unique(array_merge((array) $_POST['admins'], (array) $_POST['tutors'], (array) $_POST['members'], (array) $_POST['roles'], (array) $_POST['waiting'], (array) $_POST['subscribers']));
     }
     if (!count($_POST['participants'])) {
         ilUtil::sendFailure($GLOBALS['lng']->txt("no_checkbox"), TRUE);
         $this->ctrl->returnToParent($this);
         return false;
     }
     foreach ($_POST['participants'] as $usr_id) {
         $rcps[] = ilObjUser::_lookupLogin($usr_id);
     }
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     ilUtil::redirect(ilMailFormCall::getRedirectTarget($this->getCurrentObject(), 'members', array(), array('type' => 'new', 'rcp_to' => implode(',', $rcps), 'sig' => $this->createMailSignature())));
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:26,代码来源:class.ilMembershipGUI.php

示例9: callProvider

 /**
  * Auth login function
  * Redirects to openid provider
  * @param object $username
  * @param object $status
  * @param object $auth
  * @return 
  */
 public function callProvider($username, $status, $auth)
 {
     global $ilCtrl;
     $username = $_POST['oid_username'];
     if (!$this->parseUsername($username, $auth)) {
         return false;
     }
     $consumer = $this->settings->getConsumer();
     $oid_auth = $consumer->begin($username);
     if (!$oid_auth) {
         $auth->status = AUTH_WRONG_LOGIN;
         return false;
     }
     include_once 'Auth/OpenID/SReg.php';
     $sreg_req = Auth_OpenID_SRegRequest::build(array('nickname'), array('fullname', 'dob', 'email', 'gender', 'postcode', 'language', 'timezone'));
     if ($sreg_req) {
         $oid_auth->addExtension($sreg_req);
     }
     // TODO: Switch openid v. 1,2
     $url = $oid_auth->redirectURL(ILIAS_HTTP_PATH, $this->settings->getReturnLocation());
     ilUtil::redirect($url);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:30,代码来源:class.ilAuthOpenId.php

示例10: redirectFeedbackMailObject

 /**
  * set feedback status for member and redirect to mail screen
  */
 function redirectFeedbackMailObject()
 {
     $this->checkPermission("write");
     $members = array();
     if ($_GET["member_id"] != "") {
         if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
             $members = ilExAssignment::getTeamMembersByAssignmentId($this->ass->getId(), $_GET["member_id"]);
         } else {
             $members = array($_GET["member_id"]);
         }
     } else {
         if (count($_POST["member"]) > 0) {
             if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
                 foreach (array_keys($_POST["member"]) as $user_id) {
                     $members = array_merge($members, ilExAssignment::getTeamMembersByAssignmentId($this->ass->getId(), $user_id));
                 }
                 $members = array_unique($members);
             } else {
                 $members = array_keys($_POST["member"]);
             }
         }
     }
     if ($members) {
         $logins = array();
         foreach ($members as $user_id) {
             ilExAssignment::updateStatusFeedbackForUser($this->ass->getId(), $user_id, 1);
             $logins[] = ilObjUser::_lookupLogin($user_id);
         }
         $logins = implode($logins, ",");
         require_once 'Services/Mail/classes/class.ilMailFormCall.php';
         ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, 'members', array(), array('type' => 'new', 'rcp_to' => $logins)));
     }
     ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
     $this->ctrl->redirect($this, "members");
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:38,代码来源:class.ilObjExerciseGUI.php

示例11: mailMembers

 function mailMembers()
 {
     global $ilUser;
     $members = array();
     if (!is_array($this->umail->getSavedData())) {
         $this->umail->savePostData($ilUser->getId(), array(), "", "", "", "", "", "", "", "");
     }
     $ids = (int) $_GET['search_members'] ? array((int) $_GET['search_members']) : $_POST['search_members'];
     foreach ($ids as $member) {
         $login = ilObjUser::_lookupLogin($member);
         array_push($members, $login);
     }
     $mail_data = $this->umail->appendSearchResult($members, "to");
     $this->umail->savePostData($mail_data["user_id"], $mail_data["attachments"], $mail_data["rcp_to"], $mail_data["rcp_cc"], $mail_data["rcp_bcc"], $mail_data["m_type"], $mail_data["m_email"], $mail_data["m_subject"], $mail_data["m_message"], $mail_data["use_placeholders"]);
     ilUtil::redirect("ilias.php?baseClass=ilMailGUI&type=search_res");
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:16,代码来源:class.ilMailSearchGroupsGUI.php

示例12: importFileObject

 /**
  * display status information or report errors messages
  * in case of error
  *
  * @access	public
  */
 function importFileObject()
 {
     global $_FILES, $rbacsystem, $ilDB, $tpl;
     include_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
     if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $_GET["new_type"])) {
         $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
         return;
     }
     $form = $this->initImportForm();
     if ($form->checkInput()) {
         // create and insert object in objecttree
         include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php";
         $newObj = new ilObjContentObject();
         $newObj->setType($_GET["new_type"]);
         $newObj->setTitle($_FILES["xmldoc"]["name"]);
         $newObj->setDescription("");
         $newObj->create(true);
         $newObj->createReference();
         $newObj->putInTree($_GET["ref_id"]);
         $newObj->setPermissions($_GET["ref_id"]);
         $newObj->notify("new", $_GET["ref_id"], $_GET["parent_non_rbac_id"], $_GET["ref_id"], $newObj->getRefId());
         // create learning module tree
         $newObj->createLMTree();
         // import lm from file
         $mess = $newObj->importFromZipFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $_POST["validate"]);
         if ($mess == "") {
             ilUtil::sendSuccess($this->lng->txt($this->type . "_added"), true);
             ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() . "&baseClass=ilLMEditorGUI");
         } else {
             $link = '<a href="' . "ilias.php?ref_id=" . $newObj->getRefId() . "&baseClass=ilLMEditorGUI" . '" target="_top">' . $this->lng->txt("btn_next") . '</a>';
             $tpl->setContent("<br />" . $link . "<br /><br />" . $mess . $link);
         }
     } else {
         $form->setValuesByPost();
         $tpl->setContent($form->getHtml());
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:43,代码来源:class.ilObjContentObjectGUI.php

示例13: mailToList

 public function mailToList()
 {
     global $ilUser, $rbacsystem;
     // check if current user may send mails
     include_once "Services/Mail/classes/class.ilMail.php";
     $mail = new ilMail($_SESSION["AccountId"]);
     $mailing_allowed = $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId());
     if (!$mailing_allowed) {
         ilUtil::sendFailure($this->lng->txt('no_permission'));
         return true;
     }
     $ml_ids = (int) $_GET['ml_id'] ? array($_GET['ml_id']) : $_POST['ml_id'];
     if (!$ml_ids) {
         ilUtil::sendInfo($this->lng->txt('mail_select_one_entry'));
         $this->showMailingLists();
         return true;
     }
     $mail_data = $this->umail->getSavedData();
     if (!is_array($mail_data)) {
         $this->umail->savePostData($ilUser->getId(), array(), '', '', '', '', '', '', '', '');
     }
     $lists = array();
     foreach ($ml_ids as $id) {
         if (ilMailingList::_isOwner($id, $ilUser->getId()) && !$this->umail->doesRecipientStillExists('#il_ml_' . $id, $mail_data['rcp_to'])) {
             $lists[] = '#il_ml_' . $id;
         }
     }
     if (count($lists)) {
         $mail_data = $this->umail->appendSearchResult($lists, 'to');
         $this->umail->savePostData($mail_data['user_id'], $mail_data['attachments'], $mail_data['rcp_to'], $mail_data['rcp_cc'], $mail_data['rcp_bcc'], $mail_data['m_type'], $mail_data['m_email'], $mail_data['m_subject'], $mail_data['m_message'], $mail_data['use_placeholders']);
     }
     ilUtil::redirect("ilias.php?baseClass=ilMailGUI&type=search_res");
     return true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:34,代码来源:class.ilMailingListsGUI.php

示例14: mailObject

 function mailObject()
 {
     global $ilUser;
     $user_ids = $this->getActionUserIds();
     if (!$user_ids) {
         ilUtil::sendFailure($this->lng->txt('select_one'));
         return $this->viewObject();
     }
     // remove existing (temporary) lists
     include_once "Services/Contact/classes/class.ilMailingLists.php";
     $list = new ilMailingLists($ilUser);
     $list->deleteTemporaryLists();
     // create (temporary) mailing list
     include_once "Services/Contact/classes/class.ilMailingList.php";
     $list = new ilMailingList($ilUser);
     $list->setMode(ilMailingList::MODE_TEMPORARY);
     $list->setTitle("-TEMPORARY SYSTEM LIST-");
     $list->setDescription("-USER ACCOUNTS MAIL-");
     $list->setCreateDate(date("Y-m-d H:i:s"));
     $list->insert();
     $list_id = $list->getId();
     // after list has been saved...
     foreach ($user_ids as $user_id) {
         $list->assignAddressbookEntry($user_id);
     }
     include_once "Services/Mail/classes/class.ilFormatMail.php";
     $umail = new ilFormatMail($ilUser->getId());
     $mail_data = $umail->getSavedData();
     if (!is_array($mail_data)) {
         $mail_data = array("user_id" => $ilUser->getId());
     }
     // ???
     // $mail_data = $umail->appendSearchResult(array('#il_ml_'.$list_id), 'to');
     $umail->savePostData($mail_data['user_id'], $mail_data['attachments'], '#il_ml_' . $list_id, $mail_data['rcp_cc'], $mail_data['rcp_bcc'], $mail_data['m_type'], $mail_data['m_email'], $mail_data['m_subject'], $mail_data['m_message'], $mail_data['use_placeholders']);
     ilUtil::redirect("ilias.php?baseClass=ilMailGUI&type=search_res");
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:36,代码来源:class.ilObjUserFolderGUI.php

示例15: redirect

 /**
  * Redirects to target url if context supports it
  * 
  * @param string $a_target
  * @param string $a_message_id
  * @param array $a_message_details
  */
 protected static function redirect($a_target, $a_message_id, $a_message_static)
 {
     // #12739
     if (defined("ILIAS_HTTP_PATH") && !stristr($a_target, ILIAS_HTTP_PATH)) {
         $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
     }
     if (ilContext::supportsRedirects()) {
         ilUtil::redirect($a_target);
     } else {
         $message = self::translateMessage($a_message_id, $a_message_static);
         // user-directed linked message
         if (ilContext::usesHTTP() && ilContext::hasHTML()) {
             $link = self::translateMessage("init_error_redirect_click", array("en" => 'Please click to continue.', "de" => 'Bitte klicken um fortzufahren.'));
             $mess = $message . '<br /><a href="' . $a_target . '">' . $link . '</a>';
         } else {
             // not much we can do here
             $mess = $message;
             if (!trim($mess)) {
                 $mess = self::translateMessage("init_error_redirect_info", array("en" => 'Redirect not supported by context.', "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')) . ' (' . $a_target . ')';
             }
         }
         self::abortAndDie($mess);
     }
 }
开发者ID:JKN-INC,项目名称:SHELBY-ILIAS,代码行数:31,代码来源:class.ilInitialisation.php


注:本文中的ilUtil::redirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。