本文整理汇总了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);
}
示例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);
}