当前位置: 首页>>代码示例>>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;未经允许,请勿转载。