當前位置: 首頁>>代碼示例>>PHP>>正文


PHP KTUtil::save_base_kt_url方法代碼示例

本文整理匯總了PHP中KTUtil::save_base_kt_url方法的典型用法代碼示例。如果您正苦於以下問題:PHP KTUtil::save_base_kt_url方法的具體用法?PHP KTUtil::save_base_kt_url怎麽用?PHP KTUtil::save_base_kt_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在KTUtil的用法示例。


在下文中一共展示了KTUtil::save_base_kt_url方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: do_main

 function do_main()
 {
     global $default;
     $oPage = $GLOBALS['main'];
     // Check if the user is trying to reset their password.
     $reset_password = $this->checkReset();
     KTUtil::save_base_kt_url();
     if (is_a($oUser, 'User')) {
         $res = $this->performLogin($oUser);
         if ($res) {
             $oUser = array($res);
         }
     }
     if (is_array($oUser) && count($oUser)) {
         if (empty($_REQUEST['errorMessage'])) {
             $_REQUEST['errorMessage'] = array();
         } else {
             $_REQUEST['errorMessage'] = array($_REQUEST['errorMessage']);
         }
         foreach ($oUser as $oError) {
             $_REQUEST['errorMessage'][] = $oError->getMessage();
         }
         $_REQUEST['errorMessage'] = join('. <br /> ', $_REQUEST['errorMessage']);
     }
     if (!loginUtil::check() && $_SESSION['userID'] != -2) {
         // bounce here, potentially.
         // User is already logged in - get the redirect
         $redirect = strip_tags(KTUtil::arrayGet($_REQUEST, 'redirect'));
         $cookietest = KTUtil::randomString();
         setcookie("CookieTestCookie", $cookietest, 0);
         $this->redirectTo('checkCookie', array('cookieVerify' => $cookietest, 'redirect' => $redirect));
         exit(0);
     }
     header('Content-type: text/html; charset=UTF-8');
     $errorMessage = KTUtil::arrayGet($_REQUEST, 'errorMessage');
     session_start();
     $errorMessageConfirm = $_SESSION['errormessage']['login'];
     $redirect = strip_tags(KTUtil::arrayGet($_REQUEST, 'redirect'));
     // Get the list of languages
     $oReg =& KTi18nregistry::getSingleton();
     $aRegisteredLangs = $oReg->geti18nLanguages('knowledgeTree');
     $aLanguageNames = $oReg->getLanguages('knowledgeTree');
     $aRegisteredLanguageNames = array();
     if (!empty($aRegisteredLangs)) {
         foreach (array_keys($aRegisteredLangs) as $sLang) {
             $aRegisteredLanguageNames[$sLang] = $aLanguageNames[$sLang];
         }
         asort($aRegisteredLanguageNames);
     }
     $sLanguageSelect = $default->defaultLanguage;
     // extra disclaimer, if plugin is enabled
     $oRegistry =& KTPluginRegistry::getSingleton();
     $oPlugin =& $oRegistry->getPlugin('ktstandard.disclaimers.plugin');
     if (!PEAR::isError($oPlugin) && !is_null($oPlugin)) {
         $sDisclaimer = $oPlugin->getLoginDisclaimer();
     }
     $js = array();
     $css = array();
     $js[] = '/thirdpartyjs/extjs/adapter/ext/ext-base.js';
     $js[] = '/thirdpartyjs/extjs/ext-all.js';
     $css[] = '/thirdpartyjs/extjs/resources/css/ext-all.css';
     // Include additional js and css files
     $oPlugin =& $oRegistry->getPlugin('password.reset.plugin');
     $js[] = $oPlugin->getURLPath('resources/passwordReset.js');
     $css[] = $oPlugin->getURLPath('resources/passwordReset.css');
     $sUrl = KTUtil::addQueryStringSelf('action=');
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('login_reset');
     $aTemplateData = array('errorMessage' => $errorMessage, 'errorMessageConfirm' => $errorMessageConfirm, 'redirect' => $redirect, 'systemVersion' => $default->systemVersion, 'versionName' => $default->versionName, 'languages' => $aRegisteredLanguageNames, 'selected_language' => $sLanguageSelect, 'disclaimer' => $sDisclaimer, 'js' => $js, 'css' => $css, 'sUrl' => $sUrl, 'smallVersion' => substr($default->versionName, -17), 'reset_password' => $reset_password);
     return $oTemplate->render($aTemplateData);
 }
開發者ID:sfsergey,項目名稱:knowledgetree,代碼行數:71,代碼來源:loginResetDispatcher.php

示例2: do_main

 function do_main()
 {
     global $default;
     KTUtil::save_base_kt_url();
     $oUser =& KTInterceptorRegistry::checkInterceptorsForAuthenticated();
     if (is_a($oUser, 'User')) {
         $res = $this->performLogin($oUser);
         if ($res) {
             $oUser = array($res);
         }
     }
     if (is_array($oUser) && count($oUser)) {
         if (empty($_REQUEST['errorMessage'])) {
             $_REQUEST['errorMessage'] = array();
         } else {
             $_REQUEST['errorMessage'] = array($_REQUEST['errorMessage']);
         }
         foreach ($oUser as $oError) {
             $_REQUEST['errorMessage'][] = $oError->getMessage();
         }
         $_REQUEST['errorMessage'] = join('. <br /> ', $_REQUEST['errorMessage']);
     }
     KTInterceptorRegistry::checkInterceptorsForTakeOver();
     $this->check();
     // bounce here, potentially.
     header('Content-type: text/html; charset=UTF-8');
     $errorMessage = KTUtil::arrayGet($_REQUEST, 'errorMessage');
     session_start();
     $errorMessageConfirm = $_SESSION['errormessage']['login'];
     $redirect = strip_tags(KTUtil::arrayGet($_REQUEST, 'redirect'));
     $oReg =& KTi18nregistry::getSingleton();
     $aRegisteredLangs = $oReg->geti18nLanguages('knowledgeTree');
     $aLanguageNames = $oReg->getLanguages('knowledgeTree');
     $aRegisteredLanguageNames = array();
     if (!empty($aRegisteredLangs)) {
         foreach (array_keys($aRegisteredLangs) as $sLang) {
             $aRegisteredLanguageNames[$sLang] = $aLanguageNames[$sLang];
         }
     }
     $sLanguageSelect = $default->defaultLanguage;
     // extra disclaimer, if plugin is enabled
     $oRegistry =& KTPluginRegistry::getSingleton();
     $oPlugin =& $oRegistry->getPlugin('ktstandard.disclaimers.plugin');
     if (!PEAR::isError($oPlugin) && !is_null($oPlugin)) {
         $sDisclaimer = $oPlugin->getLoginDisclaimer();
     }
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate("ktcore/login");
     $aTemplateData = array("context" => $this, 'errorMessage' => $errorMessage, 'errorMessageConfirm' => $errorMessageConfirm, 'redirect' => $redirect, 'systemVersion' => $default->systemVersion, 'versionName' => $default->versionName, 'languages' => $aRegisteredLanguageNames, 'selected_language' => $sLanguageSelect, 'disclaimer' => $sDisclaimer, 'smallVersion' => substr($default->versionName, -17));
     return $oTemplate->render($aTemplateData);
 }
開發者ID:5haman,項目名稱:knowledgetree,代碼行數:51,代碼來源:login.php


注:本文中的KTUtil::save_base_kt_url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。