function Execute() { if (isset($_POST[$this->orderPostField])) { $permArr = array(); $arr = explode(',', $_POST[$this->orderPostField]); if (count($arr) > 0) { foreach ($arr as $key => $val) { $arrParts = explode('|', $val); if (count($arrParts) == 3 && $arrParts[1] != $arrParts[2]) { $permArr[] = $arrParts; } } $n = count($permArr); if ($n > 0) { $sql = 'SELECT MAX(' . KT_escapeFieldName($this->orderField) . ') +1 AS kt_tor_max FROM ' . $this->tableName; $rs = $this->connection->Execute($sql) or die("Internal Error. Table Order:<br/>\n" . $this->connection->ErrorMsg()); $max = (int) $rs->Fields('kt_tor_max'); for ($i = 0; $i < count($permArr); $i++) { $this->UpdateOrder($permArr[$i][0], $permArr[$i][1] + $max); } for ($i = 0; $i < count($permArr); $i++) { $this->UpdateOrder($permArr[$i][0], $permArr[$i][2]); } } } if ($this->doRedirectOnExec) { KT_redir(KT_getFullUri()); } } }
function Execute() { $sorter_reference = "sorter_" . $this->sorterName; if (isset($_GET[$sorter_reference])) { $sorterString = $_GET[$sorter_reference]; $columnName = str_replace(" DESC", "", $sorterString); if (isset($this->columns[$columnName])) { $_SESSION[$sorter_reference] = $_GET[$sorter_reference]; $url = KT_addReplaceParam(KT_getFullUri(), $sorter_reference); KT_redir($url); } } }
function checkBoundries() { $this->maxRows = $GLOBALS['maxRows_' . $this->rsName]; $this->pageNum = $GLOBALS['pageNum_' . $this->rsName]; $this->totalPages = $GLOBALS['totalPages_' . $this->rsName]; $this->totalRows = $GLOBALS['totalRows_' . $this->rsName]; $KT_url = KT_getFullUri(); $pageNum = $this->pageNum; $maxRows = $this->maxRows; $totalRows = $this->totalRows; if ($this->pageNum > $this->totalPages && $this->totalPages > -1) { $KT_url = KT_addReplaceParam($KT_url, 'pageNum_' . $this->rsName, $this->totalPages); KT_redir($KT_url); } if ($this->pageNum < 0) { $KT_url = KT_addReplaceParam($KT_url, 'pageNum_' . $this->rsName); KT_redir($KT_url); } }
* source other than Adobe, then your use, modification, or distribution of it requires the prior * written permission of Adobe. */ /* Copyright (c) InterAKT Online 2000-2006. All rights reserved. */ if (isset($_GET['KT_back'])) { require_once dirname(realpath(__FILE__)) . '/../common/KT_common.php'; KT_session_start(); $tmp = KT_addReplaceParam(KT_getFullUri(), 'KT_back'); if (isset($_SERVER['HTTP_REFERER'])) { $backURL = $_SERVER['HTTP_REFERER']; $backURL = KT_addReplaceParam($backURL, '/^totalRows_.*$/i'); KT_SessionKtBack($backURL); } if (isset($_POST['KT_Delete1'])) { echo '<html><head></head><body><form action="' . $tmp . '" method="POST" name="KT_backForm">'; foreach ($_POST as $key => $value) { if ($key == 'KT_Delete1' || strpos($key, 'kt_pk_') === 0) { if (get_magic_quotes_gpc()) { $value = stripslashes($value); } echo '<input type="hidden" name="' . $key . '" value="' . KT_escapeAttribute($value) . '" />'; } } echo '</form><script>document.forms.KT_backForm.submit();</script></body></html>'; } else { KT_redir($tmp); } exit; }
function checkBoundries() { if (isset($_GET['KT_az'])) { $cond = KT_getRealValue("GET", "KT_az"); $do_redirect = false; if ($this->linkRenderType != 2) { if (!in_array($cond, $this->arrLetters)) { $do_redirect = true; } } else { $allowed = range('A', 'Z'); if ($this->useNumbers) { $allowed[] = "0_9"; } $allowed[] = "other"; $allowed[] = "all"; if (!in_array($cond, $allowed)) { $do_redirect = true; } } if ($do_redirect) { $KT_url = KT_getFullUri(); $KT_url = KT_addReplaceParam($KT_url, 'KT_az'); KT_redir($KT_url); } } }
/** * Main method of the class. grant the access to the page or make the redirect page setted in control panel * @return mix null or error object * @access public */ function Execute() { tNG_cookieLogin($this->connection); // access denied defaults to "redirect_failed" specified in Login Config $grantAccess = false; $redirect_page = $GLOBALS['tNG_login_config']['redirect_failed']; tNG_clearSessionVars(); if (isset($_SESSION['kt_login_user'])) { if (count($this->levels) > 0) { if (isset($_SESSION['kt_login_level'])) { if (in_array($_SESSION['kt_login_level'], $this->levels)) { $grantAccess = true; } else { // acceess denied. check for level default redirect pages if (is_array($GLOBALS['tNG_login_config_redirect_failed']) && array_key_exists($_SESSION['kt_login_level'], $GLOBALS['tNG_login_config_redirect_failed']) and $GLOBALS['tNG_login_config_redirect_failed'][$_SESSION['kt_login_level']] != "") { $redirect_page = $GLOBALS['tNG_login_config_redirect_failed'][$_SESSION['kt_login_level']]; } else { // the failure page for the current user level is not defined.. so fall back to default $redirect_page = $GLOBALS['tNG_login_config']['redirect_failed']; } } } // if levels are required, and the current user doesn't have one.. access is denied } else { // no levels are required for this page access // the user is logged in, so grant the access $grantAccess = true; } } if (!$grantAccess) { // save the accessed page into a session for later use $_SESSION['KT_denied_pageuri'] = KT_getFullUri(); KT_setSessionVar('KT_denied_pageuri'); $_SESSION['KT_denied_pagelevels'] = $this->levels; KT_setSessionVar('KT_denied_pagelevels'); if (isset($_SESSION['KT_max_tries_error'])) { $redirect_page = KT_addReplaceParam($redirect_page, 'info', 'MAXTRIES'); } else { if (isset($_SESSION['KT_account_expire_error'])) { $redirect_page = KT_addReplaceParam($redirect_page, 'info', 'ACCOUNT_EXPIRE'); } else { $redirect_page = KT_addReplaceParam($redirect_page, 'info', 'DENIED'); } } KT_redir($this->relPath . $redirect_page); } else { // clear the sessions used for redirect ?? } }
/** * Main method of the class. Execute the code; Make the redirect * @return nothing * @access public */ function Execute() { // remove sessions if (strtolower($this->logoutType) == "load") { $this->unsetAll(); if ($this->pageRedirect != "") { KT_redir($this->pageRedirect); } } else { if (isset($_GET['KT_logout_now']) && $_GET['KT_logout_now'] == "true") { $this->unsetAll(); if ($this->pageRedirect != "") { KT_redir($this->pageRedirect); } else { // redirect to self - after removing value for KT_logout_now KT_redir(KT_addReplaceParam(KT_getFullUri(), 'KT_logout_now', '')); } } } }
function checkBoundries() { if (isset($_GET[$this->getVarName])) { $needle = KT_getRealValue("GET", $this->getVarName); if (!in_array($needle, $this->arrCategory)) { $KT_url = KT_getFullUri(); $KT_url = KT_addReplaceParam($KT_url, $this->getVarName); KT_redir($KT_url); } } }
/** * Main method of the class. make the redirect * @return nothing * @access public */ function Execute() { if (!isset($this->tNG)) { $page = KT_DynamicData($this->URL, null, 'rawurlencode'); } else { $useSavedData = false; if ($this->tNG->getTransactionType() == '_delete' || $this->tNG->getTransactionType() == '_multipleDelete') { $useSavedData = true; } $page = KT_DynamicData($this->URL, $this->tNG, 'rawurlencode', $useSavedData); } if ($this->keepUrlParams) { foreach ($_GET as $param => $value) { $page = KT_addReplaceParam($page, $param, $value); } } KT_redir($page); }
echo '</div></div></body></html>'; exit; } } // delete selected file if (isset($_POST['delete']) && isset($_SESSION['tng_upload_delete'][$_POST['delete']])) { $file = new KT_file(); $file->deleteFile($folder . $_SESSION['tng_upload_delete'][$_POST['delete']]); if ($file->hasError()) { $err = $file->getError(); } else { // delete thumbnails tNG_deleteThumbnails($folder . '/thumbnails/', $_SESSION['tng_upload_delete'][$_POST['delete']], ''); } $_SESSION['tng_upload_delete'] = array(); KT_redir(KT_getFullUri()); } $_SESSION['tng_upload_delete'] = array(); // upload the files; if (isset($_FILES['Filedata'])) { $folderObj = new KT_folder(); $entries = $folderObj->readFolder($folder); if ($uploadHash['maxFiles'] == 0 || isset($uploadHash['maxFiles']) && isset($entries['files']) && count($entries['files']) < $uploadHash['maxFiles'] || !isset($uploadHash['maxFiles']) || !isset($entries['files'])) { $fileUpload = new KT_fileUpload(); $fileUpload->setFileInfo('Filedata'); $fileUpload->setFolder($folder); $fileUpload->setRequired(true); $fileUpload->setAllowedExtensions($uploadHash['allowedExtensions']); $fileUpload->setAutoRename(true); $fileUpload->setMaxSize($uploadHash['maxSize']); $fileName = $fileUpload->uploadFile($_FILES['Filedata']['name'], '');
Copyright (c) InterAKT Online 2000-2006. All rights reserved. */ require_once '../common/KT_common.php'; KT_setServerVariables(); KT_session_start(); if (!isset($_SESSION['KT_backArr'])) { if (isset($_SERVER['HTTP_REFERER'])) { $_SESSION['KT_backArr'] = array(); array_push($_SESSION['KT_backArr'], $_SERVER['HTTP_REFERER']); } else { //TODO die('There is no page set to go back to. Please click the Back link to be redirected to the form. <a href="javascript: history.go(-1)">Back</a>'); } } else { if (count($_SESSION['KT_backArr']) < 1) { if (isset($_SESSION['KT_exBack'])) { array_push($_SESSION['KT_backArr'], $_SESSION['KT_exBack']); } else { //TODO die('Internal Error'); } } } $KT_back = array_pop($_SESSION['KT_backArr']); if (count($_SESSION['KT_backArr'] > 0) && isset($_GET['KT_back']) && $_GET['KT_back'] == -2) { $KT_back = array_pop($_SESSION['KT_backArr']); } $_SESSION['KT_exBack'] = $KT_back; $KT_back = KT_addReplaceParam($KT_back, '/^totalRows_.*$/i'); KT_redir($KT_back); exit;
function Execute() { $show_filter_reference = "show_filter_" . $this->filterName; $reset_filter_reference = "reset_filter_" . $this->filterName; $has_filter_reference = "has_filter_" . $this->filterName; $filter_reference = "filter_" . $this->filterName; if (isset($_GET[$show_filter_reference])) { $_SESSION[$has_filter_reference] = 1; $url = KT_addReplaceParam(KT_getFullUri(), $show_filter_reference); KT_redir($url); } if (isset($_GET[$reset_filter_reference])) { unset($_SESSION[$reset_filter_reference]); unset($_SESSION[$has_filter_reference]); unset($_SESSION[$filter_reference]); foreach ($this->columns as $key => $columnDetails) { foreach ($columnDetails as $key => $details) { $_SESSION[$details['reference']] = ''; } } $url = KT_addReplaceParam(KT_getFullUri(), $reset_filter_reference); KT_redir($url); } if (sizeof($_POST) > 0 && isset($_POST[$this->filterName])) { foreach ($this->columns as $columnName => $columnDetails) { foreach ($columnDetails as $key => $details) { $variableName = $details['reference']; if (isset($_POST[$variableName])) { $details['method'] = 'POST'; if ($details['type'] == 'DATE_TYPE' || $details['type'] == 'DATE_ACCESS_TYPE') { $details['type'] = 'STRING_TYPE'; tNG_prepareValues($details); } else { tNG_prepareValues($details); } $_SESSION[$variableName] = $details['value']; } else { $_SESSION[$variableName] = ''; } } } $url = KT_getFullUri(); $url = KT_addReplaceParam($url, '/pageNum_.*/'); $url = KT_addReplaceParam($url, '/totalRows_.*/'); KT_redir($url); } $condition = ''; foreach ($this->columns as $columnName => $columnDetails) { foreach ($columnDetails as $key => $details) { $variableName = $details['reference']; $details['value'] = @$_SESSION[$variableName]; if (!isset($details['value']) || $details['value'] == '') { continue; } if ($condition != '') { $condition .= " AND "; } $variableValue = trim($details['value']); $compareType = $details['compareType']; switch ($details['type']) { case 'NUMERIC_TYPE': case 'DOUBLE_TYPE': // if decimal separator is , => . $variableValue = str_replace(',', '.', $variableValue); if (preg_match('/^(<|>|=|<=|>=|=<|=>|<>|!=)\\s?-?\\d*\\.?\\d+$/', $variableValue, $matches)) { $modifier = trim($matches[1]); if ($modifier == '!=') { $modifier = '<>'; } $variableValue = trim(substr($variableValue, strlen($modifier))); $condition .= KT_escapeFieldName($columnName) . ' ' . $modifier . ' ' . $variableValue; } else { $condition .= KT_escapeFieldName($columnName) . ' ' . $compareType . ' ' . KT_escapeForSql($variableValue, $details['type']); } break; case 'CHECKBOX_1_0_TYPE': case 'CHECKBOX_-1_0_TYPE': if (preg_match('/^[<>]{1}\\s?-?\\d*\\.?\\d+$/', $variableValue)) { $condition .= KT_escapeFieldName($columnName) . $variableValue; } else { $condition .= KT_escapeFieldName($columnName) . " = " . KT_escapeForSql($variableValue, $details['type']); } break; case 'DATE_TYPE': case 'DATE_ACCESS_TYPE': $localCond = $this->prepareDateCondition($columnName, $details); if ($localCond != '') { $condition .= $localCond; } else { if (strlen($condition) > 0) { // if the date entered is invalid, we will not add it to the condition $condition = substr($condition, 0, strlen($condition) - 5); } } break; default: switch ($compareType) { case '=': break; case 'A%': $variableValue = $variableValue . '%'; $compareType = 'LIKE'; break; case '%A': $variableValue = '%' . $variableValue; $compareType = 'LIKE'; break; default: $variableValue = '%' . $variableValue . '%'; $compareType = 'LIKE'; break; } $variableValue = KT_escapeForSql($variableValue, $details['type']); $condition .= KT_escapeFieldName($columnName) . ' ' . $compareType . ' ' . $variableValue; break; } } } if ($condition == '') { $condition = '1=1'; } $condition = str_replace("%", "%%", $condition); $_SESSION[$filter_reference] = $condition; }