function mxi_includes_end() { $content = ob_get_contents(); ob_end_clean(); $tmpArr = array_pop($GLOBALS['KT_dir_depth']); $GLOBALS['KT_REL_PATH'] = $tmpArr['relpath']; // dirty hack IIS $chk = true; if (substr($tmpArr['dir'], 0, strlen($tmpArr['dir']) - 1) !== realpath(dirname(__FILE__) . '/../../')) { $chk = chdir($tmpArr['dir']); } elseif (getcwd() !== realpath(dirname(__FILE__) . '/../../')) { chdir(realpath(dirname(__FILE__))); $chk = chdir('../../'); } if ($chk === false) { die(KT_getResource('PHP_CHDIR_FAILED', 'MXI', array($tmpArr['dirRelPath']))); } $content = mxi_ParseHtml($content, $tmpArr['relpath']); $GLOBALS['KT_REL_PATH'] = $GLOBALS['KT_dir_depth'][count($GLOBALS['KT_dir_depth']) - 1]['relpath']; echo $content; if (isset($GLOBALS['arrTNGs']) && count($GLOBALS['arrTNGs']) > 0) { $GLOBALS['tNGs'] = array_pop($GLOBALS['arrTNGs']); } }
function IncludeDynamic(&$connection, $tableName, $urlField, $fileField, $titleField, $keywordsField, $descriptionField) { KT_setDbType($connection); $sql = "SELECT " . KT_escapeFieldName($urlField) . "," . KT_escapeFieldName($fileField); if ($titleField != "") { $sql .= "," . KT_escapeFieldName($titleField); } if ($keywordsField != "") { $sql .= "," . KT_escapeFieldName($keywordsField); } if ($descriptionField != "") { $sql .= "," . KT_escapeFieldName($descriptionField); } $sql .= " FROM " . $tableName; $localRs = $connection->Execute($sql); if (!$localRs) { $res_errorMsg = KT_getResource('SQL_ERROR', 'MXI', array($connection->ErrorMsg(), $sql)); die($res_errorMsg); } $this->IncludeDynamicRecordset($localRs, $urlField, $fileField, $titleField, $keywordsField, $descriptionField); }
/* * ADOBE SYSTEMS INCORPORATED * Copyright 2007 Adobe Systems Incorporated * All Rights Reserved * * NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the * terms of the Adobe license agreement accompanying it. If you have received this file from a * 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. */ include_once dirname(realpath(__FILE__)) . '/../../common/lib/resources/KT_Resources.php'; $d = 'NXT'; KT_sendExpireHeader(60 * 60 * 24); header("Content-Type: application/JavaScript"); ?> //Javascript UniVAL Resources if (typeof(NXT_Messages) == 'undefined') { NXT_Messages = {}; } NXT_Messages['are_you_sure_move'] = '<?php echo KT_escapeJS(KT_getResource('ARE_YOU_SURE_MOVE', $d)); ?> '; NXT_Messages['Record_FH'] = '<?php echo KT_escapeJS(KT_getResource('Record_FH', $d)); ?> ';
/** * Gets the error message * @return string transaction error message (formatted) * @access public */ function getErrorMsg() { $ret_warning = ''; if (isset($this->noSuccess) && $this->noSuccess != 0) { $ret_warning = KT_getResource('MULTIPLE_OPERATIONS_SUCCEDED', 'tNG', array($this->noSuccess)); } if (!$this->getError()) { return array($ret_warning, '', ''); } $this->compileError(); $ret = parent::getErrorMsg(); $ret[0] .= $ret_warning; return $ret; }
function Trigger_Registration_CheckUniqueUsername(&$tNG) { $tblFldObj = new tNG_CheckUnique($tNG); $tblFldObj->setTable($GLOBALS['tNG_login_config']['table']); $tblFldObj->setFieldName($GLOBALS['tNG_login_config']['user_field']); $tblFldObj->setErrorMsg(KT_getResource("REGISTRATION_UNIQUE_USER_FIELDERR", "tNG")); return $tblFldObj->Execute(); }
echo KT_getResource('DELETE', 'tNG'); ?> " class="KT_delete_link button_smallest" onClick = "if (!confirm('Are you sure you want to delete?')) return false;" /> </form> </td> </tr> <?php $rsFiles->MoveNext(); } ?> <?php } // Show if recordset not empty ?> </table> </div> <div class="bottom" > <table width="100%" class="KT_tngtable" cellpadding="0" cellspacing="0"> <tr class="KT_buttons"> <th> <input type="button" value="<?php echo KT_getResource('CLOSE', 'tNG'); ?> " onClick = "window.close()" /> </th> </tr> </table> </div> </body> </html>
/** * Setter. set error for developper and user. * @var string $errorCode error message code; * @var array $arrArgsUsr array with optional parameters for sprintf functions; * @var array $arrArgsDev array with optional parameters for sprintf functions. * @return nothing; * @access private */ function setError($errorCode, $arrArgsUsr, $arrArgsDev) { $errorCodeDev = $errorCode; if (!in_array($errorCodeDev, array('', '%s'))) { $errorCodeDev .= '_D'; } if ($errorCode != '') { $this->errorType[] = KT_getResource($errorCode, 'FileUpload', $arrArgsUsr); } else { $this->errorType = array(); } if ($errorCodeDev != '') { $this->develErrorMessage[] = KT_getResource($errorCodeDev, 'FileUpload', $arrArgsDev); } else { $this->develErrorMessage = array(); } }
/** * executes tidy and gets the value * @param string column name from transaction * @param string string to test * @return boolean true if tidy executed succesfully * @access private */ function execTidy($colName, $value) { $arg_test = array('--version'); if (isset($_SESSION['TidyContent']['ExecPath'])) { $loc = array($_SESSION['TidyContent']['ExecPath']); } else { $loc = $GLOBALS['TidyContent_TidyLocations']; if (isset($GLOBALS['KT_prefered_tidy_path'])) { array_unshift($loc, $GLOBALS['KT_prefered_tidy_path'] . 'tidy'); array_unshift($loc, $GLOBALS['KT_prefered_tidy_path'] . 'tidy.exe'); } } $shell = new KT_shell(); $shell->execute($loc, $arg_test); if ($shell->hasError()) { $arr = $shell->getError(); $this->setErrorMsg($arr[0], $arr[1]); return false; } $execPath = $shell->getExecutedCommand(); if (!isset($_SESSION['TidyContent']['ExecPath']) && $execPath != '') { $_SESSION['TidyContent']['ExecPath'] = $execPath; $loc = array($execPath); } $tidyEncoding = 'raw'; if (strtolower($this->outEncoding) == 'iso-8859-1') { $tidyEncoding = 'ascii'; } if (strpos(strtolower($this->outEncoding), 'utf-8') !== false) { $tidyEncoding = 'utf8'; } $string = $value; $string = str_replace("&nbsp;", "&amp;nbsp;", $string); $string = str_replace(" ", "&nbsp;", $string); if (!file_exists($this->folderName)) { $folder = new KT_folder(); $folder->createFolder($this->folderName); if ($folder->hasError()) { $arr = $folder->getError(); $this->setErrorMsg($arr[0], $arr[1]); return false; } } $f = tempnam(substr($this->folderName, 0, -1), 'tidy'); if ($f === false) { $err = KT_getResource('ERROR_TIDY_CONTENT', 'tNG', array()); $this->setErrorMsg($err, $err); return false; } $fout = $f . '_out'; $file = new KT_file(); $file->writeFile($f, 'append', $string); if ($file->hasError()) { $arr = $file->getError(); $this->setErrorMsg($arr[0], $arr[1]); return false; } $path = $GLOBALS['TidyContent_TidyConfiguration']; $arg = array("-config", $path, '-' . $tidyEncoding, "-o", $fout, $f); $shell = new KT_shell(); $output = $shell->execute($loc, $arg); if ($shell->hasError() && !file_exists($fout)) { $arr = $shell->getError(); $this->setErrorMsg($arr[0], $arr[1]); @unlink($f); @unlink($fout); return false; } $file = new KT_file(); $content = $file->readFile($fout); if ($file->hasError()) { $arr = $file->getError(); $this->setErrorMsg($arr[0], $arr[1]); @unlink($f); @unlink($fout); return false; } $file->deleteFile($f); if ($file->hasError()) { $arr = $file->getError(); $this->setErrorMsg($arr[0], $arr[1]); @unlink($fout); return false; } $file->deleteFile($fout); if ($file->hasError()) { $arr = $file->getError(); $this->setErrorMsg($arr[0], $arr[1]); return false; } $content = str_replace("&nbsp;", " ", $content); $content = str_replace("&amp;nbsp;", "&nbsp;", $content); $content = $this->cleanContent($content); $this->tidiedValues[$colName] = $content; return true; }
/** * Returns the messages for the Login Page * @access public */ function getLoginMsg() { $show = false; for ($i = 0; $i < $this->n; $i++) { if ($this->tNGs[$i]->getTransactionType() == '_login' && !$this->tNGs[$i]->started) { $show = true; break; } } if ($show) { $info_resources = array('REG_ACTIVATE', 'REG_EMAIL', 'REG', 'ACTIVATED', 'FORGOT', 'DENIED', 'MAXTRIES', 'ACCOUNT_EXPIRE'); $info_key = KT_getRealValue("GET", "info"); if ($info_key != "") { if (in_array($info_key, $info_resources)) { $ret = '<div id="KT_tngdeverror">'; $ret .= '<label>' . KT_getResource('LOGIN_MESSAGE_LABEL', 'tNG') . '</label>'; $ret .= '<div>' . KT_getResource('LOGIN_MESSAGE__' . $info_key, 'tNG') . '</div>'; $ret .= '</div>'; return $ret; } } } return ''; }
function loadGenericValidationMessages(&$arr) { $d = 'tNG_FormValidation'; $arr["failed"] = KT_getResource('FAILED', $d); $arr["required"] = KT_getResource('REQUIRED', $d); $arr["type"] = KT_getResource('TYPE', $d); $arr["format"] = KT_getResource('FORMAT', $d); $arr["text_"] = KT_getResource('TEXT_', $d); $arr["text_email"] = KT_getResource('TEXT_EMAIL', $d); $arr["text_cc_generic"] = KT_getResource('TEXT_CC_GENERIC', $d); $arr["text_cc_visa"] = KT_getResource('TEXT_CC_VISA', $d); $arr["text_cc_mastercard"] = KT_getResource('TEXT_CC_MASTERCARD', $d); $arr["text_cc_americanexpress"] = KT_getResource('TEXT_CC_AMERICANEXPRESS', $d); $arr["text_cc_discover"] = KT_getResource('TEXT_CC_DISCOVER', $d); $arr["text_cc_dinersclub"] = KT_getResource('TEXT_CC_DINERSCLUB', $d); $arr["text_zip_generic"] = KT_getResource('TEXT_ZIP_GENERIC', $d); $arr["text_zip_us5"] = KT_getResource('TEXT_ZIP_US5', $d); $arr["text_zip_us9"] = KT_getResource('TEXT_ZIP_US9', $d); $arr["text_zip_canada"] = KT_getResource('TEXT_ZIP_CANADA', $d); $arr["text_zip_uk"] = KT_getResource('TEXT_ZIP_UK', $d); $arr["text_phone"] = KT_getResource('TEXT_PHONE', $d); $arr["text_ssn"] = KT_getResource('TEXT_SSN', $d); $arr["text_url"] = KT_getResource('TEXT_URL', $d); $arr["text_ip"] = KT_getResource('TEXT_IP', $d); $arr["text_color_hex"] = KT_getResource('TEXT_COLOR_HEX', $d); $arr["text_color_generic"] = KT_getResource('TEXT_COLOR_GENERIC', $d); $arr["numeric_"] = KT_getResource('NUMERIC_', $d); $arr["numeric_int"] = KT_getResource('NUMERIC_INT', $d); $arr["numeric_int_positive"] = KT_getResource('NUMERIC_INT_POSITIVE', $d); $arr["numeric_zip_generic"] = KT_getResource('TEXT_ZIP_GENERIC', $d); $arr["double_"] = KT_getResource('DOUBLE_', $d); $arr["double_float"] = KT_getResource('DOUBLE_FLOAT', $d); $arr["double_float_positive"] = KT_getResource('DOUBLE_FLOAT_POSITIVE', $d); $arr["date_"] = KT_getResource('DATE_', $d); $arr["date_date"] = KT_getResource('DATE_DATE', $d); $arr["date_time"] = KT_getResource('DATE_TIME', $d); $arr["date_datetime"] = KT_getResource('DATE_DATETIME', $d); $arr["mask_"] = KT_getResource('MASK_', $d); $arr["regexp_"] = KT_getResource('REGEXP_', $d); $arr["regexp_failed"] = KT_getResource('REGEXP_FAILED', $d); $arr["text_min"] = KT_getResource('TEXT_MIN', $d); $arr["text_max"] = KT_getResource('TEXT_MAX', $d); $arr["text_between"] = KT_getResource('TEXT_BETWEEN', $d); $arr["other_min"] = KT_getResource('OTHER_MIN', $d); $arr["other_max"] = KT_getResource('OTHER_MAX', $d); $arr["other_between"] = KT_getResource('OTHER_BETWEEN', $d); }
$err[1] .= '<br/>' . $arr[1]; if (isset($_GET['isFlash'])) { !isset($_SESSION['tng_upload']['errorForFlash']) ? $_SESSION['tng_upload']['errorForFlash'] = '' : ''; if ($GLOBALS['tNG_debug_mode'] == 'DEVELOPMENT') { $_SESSION['tng_upload']['errorForFlash'] .= $err[1] . '<br/>'; } else { $_SESSION['tng_upload']['errorForFlash'] .= $err[0] . '<br/>'; } } } } } } else { if (isset($_GET['isFlash'])) { !isset($_SESSION['tng_upload']['errorForFlash']) ? $_SESSION['tng_upload']['errorForFlash'] = '' : ''; $_SESSION['tng_upload']['errorForFlash'] .= KT_getResource('MAX_FILES_NO_REACHED', 'tNG', array($uploadHash['maxFiles'])) . '<br/>'; } } } // end page execution if we are calling from flash; if (isset($_GET['isFlash'])) { echo " "; exit; } //folder recordset $listFolder = new tNG_FileListRecordset("../../../", $KT_conn_mupload); $listFolder->setBaseFolder($folder); $listFolder->setFolder(""); $listFolder->setAllowedExtensions(implode(',', $uploadHash['allowedExtensions'])); $listFolder->setOrder('name', 'ASC'); //create the fake recordset
<?php } // endif Conditional region4 ?> </li> </ul> </div> </div> <?php } // endif Conditional region1 // Show IF Conditional region5 if (isset($err) && $GLOBALS['tNG_debug_mode'] == 'DEVELOPMENT') { ?> <div id="KT_tngerror"><label><?php echo KT_getResource('ERROR_LABEL', 'tNG'); ?> </label> <div><?php echo $err[1]; ?> </div> </div> <?php } // endif Conditional region5 ?> <table width="100%" height="96%"> <tr> <td align="center"> <a href="#" onClick="window.close()" title="Click to Close">
/** * Gets a MySQL recordset (resource id). Optimized for mysql version 4 or higher. * @return integer * @access private */ function getMySQL4fakeRS() { $fields = array(); $i = 0; $select_sql = ''; foreach ($this->fields as $key => $value) { $i = 0; if (!is_array($value)) { $fields[$i][$key] = $value; } else { foreach ($value as $key2 => $val) { $fields[$i][$key] = $val; $i++; } } } for ($i = 0; $i < count($fields); $i++) { $row = $fields[$i]; if ($i > 0) { $select_sql .= ' UNION ALL '; } $select_sql .= 'SELECT '; foreach ($row as $colName => $value) { $select_sql .= "'" . mysql_escape_string($value) . "' AS " . $colName . ", "; } $select_sql = substr(trim($select_sql), 0, -1); } if ($select_sql == '') { $select_sql = "SELECT * FROM (SELECT 1 AS tmp) AS tmptable where tmptable.tmp = 2"; } $result = $this->connection->MySQL_Execute($select_sql); if ($result === false) { $this->error = KT_getResource('PHP_DB_SELECT_UNION_D', 'DB', array($this->connection->ErrorMsg(), $select_sql)); $this->hasError = true; return null; } return $result; }
echo KT_escapeJS(KT_getResource('the_date_format_is', $d)); ?> '; WDG_Messages['calendar_button'] = '<?php echo KT_escapeJS(KT_getResource('calendar_button', $d)); ?> '; WDG_Messages['calendar_button'] = '<?php echo KT_escapeJS(KT_getResource('calendar_button', $d)); ?> '; WDG_Messages['rte_maximum_reached'] = '<?php echo KT_escapeJS(KT_getResource('rte_maximum_reached', $d)); ?> '; WDG_Messages['dyn_add_label_text'] = '<?php echo KT_escapeJS(KT_getResource('dyn_add_label_text', $d)); ?> '; WDG_Messages['dyn_are_you_sure_text'] = '<?php echo KT_escapeJS(KT_getResource('dyn_are_you_sure_text', $d)); ?> '; WDG_Messages['dyn_submit_text'] = '<?php echo KT_escapeJS(KT_getResource('dyn_submit_text', $d)); ?> '; WDG_Messages['dyn_default_option_text'] = '<?php echo KT_escapeJS(KT_getResource('dyn_default_option_text', $d)); ?> ';
/** * Gets the error message * Adds the import specific messages, then calls the parent getErrorMsg method. * @return string transaction error message (formatted) * @access public */ function getErrorMsg() { $ret_warning = ''; if (isset($this->noSkip) && $this->noSkip != 0) { $ret_warning = KT_getResource('IMPORT_OPERATIONS_SKIPPED', 'tNG', array($this->noSkip)); } $ret = parent::getErrorMsg(); $ret[0] .= $ret_warning; $ret[0] = trim($ret[0]); return $ret; }
/** * Main Class method. Sets the action: remove|replace|block. * @return mixt object in case of errors or null * @access public */ function Execute() { $ret = null; $arr = $this->tNG->columns; $columns = array(); foreach ($arr as $colName => $colDetails) { if ($colDetails['type'] == 'STRING_TYPE') { $columns[$colName] = $colDetails['value']; } } if (count($columns) == 0) { return; } $words = $this->getWords(); if (is_object($this->error)) { return $this->error; } if (count($words) == 0) { return; } $fieldWithErrors = array(); foreach ($columns as $colName => $value) { if (!$this->checkValue($colName, $value, $words)) { $error = true; $fieldWithErrors[] = $colName; } } // action block if (isset($error) && $this->action == 'block') { if ($this->errorMsg == '') { $ret = new tNG_error('TRIGGER_MESSAGE__CHECK_FORBIDDEN_WORDS', array(implode(', ', $fieldWithErrors)), array()); } else { $ret = new tNG_error('%s', array($this->errorMsg), array('')); } $errorMsg = KT_getResource('FORBIDDEN_FIELD_ERROR', 'tNG', array()); foreach ($fieldWithErrors as $colName) { // set field error to $errorMsg $ret->setFieldError($colName, '%s', array($errorMsg)); if ($this->tNG->columns[$colName]['method'] != 'POST') { // set composed message as user error $ret->addDetails('%s', array($errorMsg), array('')); } } // action remove/replace } else { if (isset($error) && $this->action != 'block') { foreach ($this->replacements as $colName => $value) { $this->tNG->setColumnValue($colName, $value); } } } return $ret; }
function getScripts() { $includedpath = $this->relpath; if (isset($GLOBALS['KT_REL_PATH'])) { $includedpath = $GLOBALS['KT_REL_PATH'] . $includedpath; } $url = KT_addReplaceParam(KT_getFullUri(), '/^totalRows_.*$/i'); $flashURL = KT_addReplaceParam($url, 'isFlash'); $flashURL = KT_addReplaceParam($flashURL, session_name(), session_id()); $ret = ''; $ret .= '<script src="' . $this->relpath . 'includes/tng/pub/flashembed.js" type="text/javascript" language="javascript"></script>' . "\n"; $ret .= '<script type="text/javascript"> //this is the unique instance of the multiple file upload object myupload = new tNG_FlashUpload(\'' . $includedpath . '\',\'uploadComponent\', \'progressComponent\', \'myupload\'); myupload.setColors(\'' . $this->barColor . '\',\'' . $this->textColor . '\',\'' . $this->borderColor . '\'); myupload.initialize( \'' . KT_addReplaceParam($flashURL, 'isFlash', 1) . '\', \'' . KT_getResource('UPLOAD', 'tNG') . '\', \'' . $this->maxSize . '\', \'' . $this->maxNumber . '\', \'' . $this->existentNumber . '\', \'' . $this->allowedExtensions . '\', \'' . KT_escapeJS(KT_getResource('FLASH_MAX_SIZE_REACHED', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_MAX_FILES_REACHED', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_EMPTY_FILE', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_SKIPPING', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_HTTPERROR', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_HTTPERROR_HEAD', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_IOERROR', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_IOERROR_HEAD', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_COMPLETE_MSG', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_UPLOAD_BATCH', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_UPLOAD_SINGLE', 'tNG')) . '\'); KT_self_url = "' . KT_addReplaceParam($url, 'isFlash') . '"; </script>' . "\n"; return $ret; }
function NAV_getResource($resourceName) { return KT_getResource($resourceName, 'NAV'); }
/** * Add error for user and developer (append to an existent error) * @param string $errorCode error code for user * @param array $arrArgs arguments for user error * @param array $arrArgsDev arguments for developper error * @return nothing * @access protected */ function addDetails($errorCode, $arrArgsUsr, $arrArgsDev) { if ($this->details != '') { $this->details .= "<br />"; } if ($this->devDetails != '') { $this->devDetails .= "<br />"; } $errorCodeDev = $errorCode; if (!in_array($errorCodeDev, array('', '%s'))) { $errorCodeDev .= '_D'; } $res_details = KT_getResource($errorCode, 'tNG', $arrArgsUsr); $res_devDetails = KT_getResource($errorCodeDev, 'tNG', $arrArgsDev); $this->details .= $res_details; $this->devDetails .= $res_devDetails; if ($errorCode != "%s" && $errorCode != "" && $res_devDetails != "") { $this->devDetails .= " (" . $errorCode . ")"; } }
echo KT_escapeJS(KT_getResource('REGEXP_', $d)); ?> '; UNI_Messages['text_min'] = '<?php echo KT_escapeJS(KT_getResource('TEXT_MIN', $d)); ?> '; UNI_Messages['text_max'] = '<?php echo KT_escapeJS(KT_getResource('TEXT_MAX', $d)); ?> '; UNI_Messages['text_between'] = '<?php echo KT_escapeJS(KT_getResource('TEXT_BETWEEN', $d)); ?> '; UNI_Messages['other_min'] = '<?php echo KT_escapeJS(KT_getResource('OTHER_MIN', $d)); ?> '; UNI_Messages['other_max'] = '<?php echo KT_escapeJS(KT_getResource('OTHER_MAX', $d)); ?> '; UNI_Messages['other_between'] = '<?php echo KT_escapeJS(KT_getResource('OTHER_BETWEEN', $d)); ?> '; UNI_Messages['form_was_modified'] = '<?php echo KT_escapeJS(KT_getResource('FORM_WAS_MODIFIED', $d)); ?> ';
die(KT_getResource('ERR_DOWNLOAD_FILE', $d)); } if (!isset($_SESSION['tNG']['download'][$uniqueId]['realPath']) || !isset($_SESSION['tNG']['download'][$uniqueId]['fileName'])) { die(KT_getResource('ERR_DOWNLOAD_FILE', $d)); } $realPath = $_SESSION['tNG']['download'][$uniqueId]['realPath']; $fileName = $_SESSION['tNG']['download'][$uniqueId]['fileName']; if (md5($realPath) != $uniqueId) { die(KT_getResource('ERR_DOWNLOAD_FILE_WRONG_HASH', $d)); } if (!@fopen($realPath, "rb")) { die(KT_getResource('ERR_DOWNLOAD_FILE_NO_READ', $d, array($realPath))); } //define('MAX_READ',131072); $mime_type = function_exists('mime_content_type') ? mime_content_type($realPath) : 'application/octet-stream'; header('Content-type: ' . $mime_type); header('Cache-control: private'); header('Content-Length: ' . filesize($realPath)); header('Content-disposition: attachment; filename="' . $fileName . '";'); $fd = fopen($realPath, "rb"); if (!$fd) { header('Status-code: 404'); die(KT_getResource('ERR_DOWNLOAD_FILE_NO_READ', $d, array($realPath))); } do { echo fread($fd, 8192); flush(); usleep(10000); } while (!feof($fd) && connection_status() == 0); fclose($fd); exit;
* All Rights Reserved * * NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the * terms of the Adobe license agreement accompanying it. If you have received this file from a * 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. */ include_once dirname(realpath(__FILE__)) . '/../../common/lib/resources/KT_Resources.php'; $d = 'NXT'; KT_sendExpireHeader(60 * 60 * 24); header("Content-Type: application/JavaScript"); ?> //Javascript UniVAL Resources if (typeof(NXT_Messages) == 'undefined') { NXT_Messages = {}; } NXT_Messages['are_you_sure_move'] = '<?php echo KT_escapeJS(KT_getResource('ARE_YOU_SURE_MOVE', $d)); ?> '; NXT_Messages['are_you_sure_delete'] = '<?php echo KT_escapeJS(KT_getResource('ARE_YOU_SURE_DELETE', $d)); ?> '; NXT_Messages['please_select_record'] = '<?php echo KT_escapeJS(KT_getResource('PLEASE_SELECT_RECORD', $d)); ?> ';
/** * Main class method; return the code in page * @param string * @access public */ function Execute() { if (!isset($_GET['isFlash'])) { unset($_SESSION['tng_errors']); } $ret = ''; $url = KT_addReplaceParam(KT_getFullUri(), '/^totalRows_.*$/i'); $url2 = KT_addReplaceParam($url, 'isFlash'); $url = KT_addReplaceParam($url2, session_name(), session_id()); if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") { $protocol = "https"; } else { $protocol = "http"; } $ret .= '<div id="multiple_upload" style="display:none;"> <input type="button" value="' . KT_getResource('UPLOAD', 'tNG') . '" class="button_big" onClick="myupload.loadFlashMovie( \'' . KT_addReplaceParam($url, 'isFlash', 1) . '\', \'' . $this->maxSize . '\', \'' . $this->maxNumber . '\', \'' . $this->existentNumber . '\', \'' . $this->allowedExtensions . '\', \'' . KT_escapeJS(KT_getResource('FLASH_MAX_SIZE_REACHED', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_MAX_FILES_REACHED', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_EMPTY_FILE', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_SKIPPING', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_HTTPERROR', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_HTTPERROR_HEAD', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_IOERROR', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_IOERROR_HEAD', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_COMPLETE_MSG', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_UPLOAD_BATCH', 'tNG')) . '\', \'' . KT_escapeJS(KT_getResource('FLASH_UPLOAD_SINGLE', 'tNG')) . '\' )"/> </div>'; $ret .= '<div id="singleIndicator" style="display:none;width=100%; text-align:center;"> <h3>Uploading files</h3> <img id="pbar" src="' . $this->relpath . 'includes/tng/pub/loading.gif"/> </div> <div id="simple_upload" style=""> <form id="singleUpload" method="post" action="' . KT_escapeAttribute($url2) . '" enctype="multipart/form-data" onSubmit="tNG_showIndicator()"> <table cellpadding="2" cellspacing="0" class="KT_tngtable"> <tr> <td><label for="filename_pic">Filename:</label></td> <td align="right"><input type="file" name="Filedata" id="Filedata" size = "40%" /><input type="submit" name="KT_Insert1" id="KT_Insert1" value="' . KT_getResource('UPLOAD', 'tNG') . '"class="button_big" /></td> </tr> </table> </form> </div> <script> tNG_initFileUpload("' . $protocol . '"); </script>'; return $ret; }
/** * Main class method. Resize the image and apply the watermark; * @return string error string or url to thumbnail * @access public */ function Execute() { $ret = ""; $relpath = $this->relpath; $folder = KT_TransformToUrlPath($this->folder); $fileName = KT_DynamicData($this->renameRule, null); $fileName = KT_TransformToUrlPath($fileName, false); $fullFolder = KT_realpath($folder, true); $fullFileName = KT_realpath($fullFolder . $fileName, false); $path_info = KT_pathinfo($fullFileName); $thumbnailFolder = $path_info['dirname'] . '/thumbnails/'; if (substr($fullFileName, 0, strlen($fullFolder)) != $fullFolder) { if ($GLOBALS['tNG_debug_mode'] == 'DEVELOPMENT') { $baseFileName = dirname($fullFileName); $errorMsg = KT_getResource("FOLDER_DEL_SECURITY_ERROR_D", "tNG", array($baseFileName, $fullFolder)); $ret = $relpath . "includes/tng/styles/cannot_thumbnail.gif\" />" . $errorMsg . "<img style=\"display:none\" src=\"" . $relpath . "includes/tng/styles/cannot_thumbnail.gif"; } else { $ret = $relpath . "includes/tng/styles/cannot_thumbnail.gif"; } } else { if ($this->getFileName() !== false) { // make the resize $proportional = $this->keepProportion; $width = $this->width; $height = $this->height; if (!$this->watermark) { $thumbnailName = $path_info['filename'] . '_' . $width . 'x' . $height . (isset($path_info['extension']) ? '.' . $path_info['extension'] : ''); } else { $hash = tNG_watermarkHash(KT_realpath($this->watermarkImage, false), $this->watermarkAlpha, $this->watermarkResize, $this->watermarkAlignment); $thumbnailName = $path_info['filename'] . '_' . $width . 'x' . $height . '_w_' . $hash . (isset($path_info['extension']) ? '.' . $path_info['extension'] : ''); } $thumbnailFullName = $thumbnailFolder . $thumbnailName; if (!file_exists(KT_realpath($thumbnailFullName, false))) { $imageObj = new KT_image(); $imageObj->setPreferedLib($GLOBALS['tNG_prefered_image_lib']); $imageObj->addCommand($GLOBALS['tNG_prefered_imagemagick_path']); $imageObj->thumbnail($fullFileName, $thumbnailFolder, $thumbnailName, (int) $width, (int) $height, $proportional); if ($imageObj->hasError()) { $errorArr = $imageObj->getError(); if ($GLOBALS['tNG_debug_mode'] == 'DEVELOPMENT') { $errMsg = $errorArr[1]; $ret = $relpath . "includes/tng/styles/cannot_thumbnail.gif\" />" . $errMsg . "<img style=\"display:none\" src=\"" . $relpath . "includes/tng/styles/cannot_thumbnail.gif"; } else { $ret = $relpath . "includes/tng/styles/cannot_thumbnail.gif"; } return $ret; } else { // apply watermark if ($this->watermark) { // delete other watermarks for same picture tNG_deleteThumbnails($thumbnailFolder, $path_info['filename'] . '_' . $width . 'x' . $height, $hash); $imageObj = new KT_image(); $imageObj->setPreferedLib($GLOBALS['tNG_prefered_image_lib']); $imageObj->addCommand($GLOBALS['tNG_prefered_imagemagick_path']); $imageObj->watermark($thumbnailFullName, $thumbnailFullName, KT_realpath($this->watermarkImage, false), $this->watermarkAlpha, $this->watermarkResize, $this->watermarkAlignment); if ($imageObj->hasError()) { @unlink($thumbnailFullName); $arrError = $imageObj->getError(); $errObj = new tNG_error('IMG_WATERMARK', array(), array($arrError[1])); if ($GLOBALS['tNG_debug_mode'] == 'DEVELOPMENT') { $errMsg = $arrError[1]; $ret = $relpath . "includes/tng/styles/cannot_thumbnail.gif\" />" . $errMsg . "<img style=\"display:none\" src=\"" . $relpath . "includes/tng/styles/cannot_thumbnail.gif"; } else { $ret = $relpath . "includes/tng/styles/cannot_thumbnail.gif"; } return $ret; } } } $thumbnailURL = $this->folder . KT_DynamicData($this->renameRule, null); $thumbnailURL = dirname($thumbnailURL) . "/thumbnails/" . $thumbnailName; $ret = KT_CanonizeRelPath($thumbnailURL); if (!$imageObj->hasError()) { //$ret .= '?' . md5(filectime($ret)); } } else { $thumbnailURL = $this->folder . KT_DynamicData($this->renameRule, null); $thumbnailURL = dirname($thumbnailURL) . "/thumbnails/" . $thumbnailName; $ret = KT_CanonizeRelPath($thumbnailURL); } } else { $ret = $relpath . "includes/tng/styles/img_not_found.gif"; } } return $ret; }
/** * main class method; Create the image and return the url to the image file; * @param string relative path to site root * @return mixt image url or error */ function getImageURL($relpath) { $this->garbageCollector(); // check write permissions on captcha folder $fld = new KT_folder(); $fld->createFolder(KT_CAPTCHA_TEMP_FOLDER); if (!$fld->checkRights(KT_CAPTCHA_TEMP_FOLDER, 'write')) { if ($GLOBALS['tNG_debug_mode'] == 'DEVELOPMENT') { $error = KT_getResource('FOLDER_ERROR_D', 'Captcha', array(KT_CAPTCHA_TEMP_FOLDER)); } else { $error = KT_getResource('FOLDER_ERROR', 'Captcha'); } return $this->formatError($error); } // with gd if ($this->lib == "gd") { $arr["GD Version"] = 'GD not available'; if (function_exists('gd_info')) { $arr = gd_info(); preg_match("/(2)\\.[\\d]+/i", $arr["GD Version"], $matches); } if (!isset($arr) || !isset($matches[1]) || (int) $matches[1] < 2) { $error = KT_getResource('PHP_GD_VERSION_ERROR', 'Captcha', array($arr["GD Version"])); return $this->formatError($error); } $im = imagecreatefrompng(dirname(__FILE__) . '/captcha.png') or $error = KT_getResource('PHP_GD_ERROR', 'Captcha', array()); if (isset($error)) { return $this->formatError($error); } $string = $this->getTextCaptcha(); $font = imageloadfont(dirname(__FILE__) . "/fonts/Courier.gdf"); if ($font === false) { $font = 5; } $fontFileName = dirname(__FILE__) . '/fonts/MyriadWebPro.ttf'; $wFont = 24; $hFont = 24; // write the letters for ($i = 0; $i < strlen($string); $i++) { $color1 = rand(0, 64); $color2 = rand(0, 64); $color3 = rand(0, 64); $text_color = imagecolorallocate($im, $color1, $color2, $color3); $okttf = false; if (function_exists('imagettftext')) { $okttf = @imagettftext($im, 14, rand(-25, 25), 10 + $i * $wFont, $hFont + rand(4, 26), $text_color, $fontFileName, $string[$i]); } if ($okttf === false) { $fim = imagecreatetruecolor($wFont + 9, $hFont + 9); $back = imagecolorallocate($fim, 255, 255, 255); imagefilledrectangle($fim, 0, 0, $wFont + 8, $hFont + 8, $back); $transparent2 = imagecolorallocate($fim, 255, 255, 255); $text_color = imagecolorallocate($fim, $color1, $color2, $color3); imagestring($fim, $font, 4, 4, $string[$i], $text_color); if (function_exists("imagerotate")) { $fim = imagerotate($fim, rand(-25, 25), $transparent2); } $iTranspa2 = imagecolortransparent($fim, $transparent2); imagecopymerge($im, $fim, 0 + $i * $wFont, rand(4, 26), 0, 0, $wFont + 9, $hFont + 9, 80); imagedestroy($fim); } } imagepng($im, KT_CAPTCHA_TEMP_FOLDER . $this->filename); imagedestroy($im); // with imagemagick } else { $sourceFileName = dirname(__FILE__) . '/captcha.png'; $fontFileName = dirname(__FILE__) . '/fonts/MyriadWebPro.ttf'; $destFileName = KT_CAPTCHA_TEMP_FOLDER . $this->filename; $arrCommands = array($GLOBALS['KT_prefered_imagemagick_path'] . 'convert'); $shell = new KT_shell(); $direction = rand(0, 10); if ($direction % 2 == 0) { $textRend = -rand(8, 11) . 'x0+' . (5 + (8 - strlen($this->text)) * 20) . '+' . (70 - (8 - strlen($this->text)) * 5); } else { $textRend = rand(8, 11) . 'x0+' . (5 + (8 - strlen($this->text)) * 20) . '+' . (35 + (8 - strlen($this->text)) * 5); } $arrArguments = array('-font', $fontFileName, '-pointsize', '34', '-fill', 'rgb(' . rand(0, 32) . ',' . rand(0, 32) . ',' . rand(0, 32) . ')', '-annotate', $textRend, $this->text, '-wave', '3x50', '-region', '100x70+' . rand(0, 100) . '+0', '-swirl', '25', '-region', '100x70+' . rand(0, 100) . '+0', '-swirl', '-25', $sourceFileName, $destFileName); $shell->execute($arrCommands, $arrArguments); if ($shell->hasError()) { $arr = $shell->getError(); $ret = $this->formatError($arr[0]); return $ret; } } return $relpath . KT_CAPTCHA_TEMP_URL . $this->filename; }
/** * Return the resource for NeXTensio * @param string $resourceName the resource name * @return string the value for the resource name */ function NXT_getResource($resourceName) { return KT_getResource($resourceName, 'NXT'); }