/** * 验证用户的有效性,如果用户是阿里平台用户,则返回用户的Id,否则返回false。 * * @return mixed 如果验证成功,返回用户的Id(string),否则返回false。 */ public function authenticate() { $user_id = getRequestParam('user_id'); $app_instance_id = getRequestParam('app_instance_id'); $token = getRequestParam('token'); // validate user by REST service $ret_code = AlisoftValidateUserService::validateUser($user_id, $app_instance_id, $token); // 该用户是应用的订购者,返回用户的Id if ($ret_code == '1') { return $user_id; } else { return false; } }
/** * 验证群用户的有效性,如果用户是阿里平台用户,则返回用户的Id,否则返回false。 * * @return mixed 如果验证成功,返回群的Id(string),否则返回false。 */ public function authenticate() { $user_id = getRequestParam('user_id'); $app_instance_id = getRequestParam('app_instance_id'); $token = getRequestParam('token'); // validate user by REST service $ret = AliTribeService::validateUser($user_id, $app_instance_id, $token); if ($ret['result'] >= '0') { $tribInfo['group_id'] = $ret['tribeId']; $tribInfo['user_id'] = $user_id; $tribInfo['role'] = $this->getUserRole($ret['result']); return $tribInfo; } else { return false; } }
function controllerAction() { global $data; $template = getRequestParam('tmpl'); if ($template == 'auctionlistinfo') { return updateListAuction(); } $auctionId = getRequestParam('id'); try { $lastBidInfo = getLastBidInfo($auctionId); if (!$lastBidInfo) { if (getRequestParam('current_bid_id')) { echo '<div id="result_auction_reset"></div>'; } return; } if (isset($lastBidInfo['auctionbid_id'])) { $currentBid = getRequestParam('current_bid_id'); if ($currentBid != $lastBidInfo['auctionbid_id']) { echo $lastBidInfo['auctioninfo']; } } } catch (Exception $e) { return; } }
<?php require_once "header.inc"; $apiKey = getRequestParam('api_key'); if ($apiKey == null) { RingsideWebUtils::redirect('index.php'); } $props = array('application_name', 'secret_key', 'api_key'); $resp = $client->api_client->admin_getAppProperties($props, null, null, $apiKey); $secret = $resp['secret_key']; $appName = $resp['application_name']; include 'ringside/apps/developer/templates/new_app_success.tpl';
if (!$fileFilterA->accept($toFile)) { $data['errorMsg'] = $config['filesystem.invalid_file_name_msg']; renderPage("createdoc.tpl.php", $data); } // Setup second filter $fileFilterB =& new BasicFileFilter(); $fileFilterB->setIncludeFilePattern($config['createdoc.include_file_pattern']); $fileFilterB->setExcludeFilePattern($config['createdoc.exclude_file_pattern']); if (!$fileFilterB->accept($toFile)) { $data['errorMsg'] = $config['createdoc.invalid_file_name_msg']; renderPage("createdoc.tpl.php", $data); } // File exists if ($toFile->exists()) { $data['errorMsg'] = "error_exists"; renderPage("createdoc.tpl.php", $data); } $templateFile->copyTo($toFile, true); // Replace title $fileData = file_get_contents($toFile->getAbsolutePath()); // Replace all fields for ($i = 0; $i < count($fields); $i += 2) { $fileData = str_replace('${' . $fields[$i] . '}', htmlentities(getRequestParam("field_" . $fields[$i], "")), $fileData); } if (($fp = fopen($toFile->getAbsolutePath(), "w")) != null) { fwrite($fp, $fileData); fclose($fp); } } // Render output renderPage("createdoc.tpl.php", $data);
if (strlen($name) == 0) { $errorMessage = 'Please specify a network name.'; } $authUrl = getRequestParam('auth_url', ''); if (strlen($authUrl) == 0) { $errorMessage = 'Please specify an authorization URL.'; } $loginUrl = getRequestParam('login_url', ''); if (strlen($loginUrl) == 0) { $errorMessage = 'Please specify an login URL.'; } $canvasUrl = getRequestParam('canvas_url', ''); if (strlen($canvasUrl) == 0) { $errorMessage = 'Please specify an canvas URL.'; } $webUrl = getRequestParam('web_url', ''); if (strlen($webUrl) == 0) { $errorMessage = 'Please specify an web URL.'; } if ($errorMessage == null) { try { $resp = $client->api_client->admin_createNetwork($name, $authUrl, $loginUrl, $canvasUrl, $webUrl); $key = $resp['network']['key']; } catch (Exception $e) { $errorMessage = "Error creating app: " . $e->getMessage(); } } if ($errorMessage == null) { RingsideWebUtils::redirect("edit_network.php?key={$key}&created=true&form_action=edit"); } } else {
<?php // vim: set et sw=4 ts=4 sts=4 ft=php fdm=marker ff=unix fenc=utf8 nobomb: /** * @author mingcheng<lucky#gracecode.com> * @date 2013-03-22 */ require_once "common.inc.php"; require_once "config.inc.php"; $Database = new PDO("sqlite:" . AQI_DATABASE); $sql = 'select value, recordDate as date, areaName from aqi where division = %d order by recordDate'; $sql = sprintf($sql, getRequestParam("division", 330100, "get")); $stmt = $Database->prepare($sql); $stmt->execute(); $items = array(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); //var_dump($result); if (empty($result)) { $result[0]['areaName'] = ""; } else { foreach ($result as $item) { array_push($items, sprintf("[new Date(%s), %d]", date("Y, n, j", $item['date']), $item['value'])); } } header("Content-type: text/javascript;charset=utf-8"); printf('var data = [%s], areaName = "%s";', implode($items, ", "), $result[0]['areaName']); $Database = null;
$fileFilterA->setIncludeFilePattern($config['filesystem.include_file_pattern']); $fileFilterA->setExcludeFilePattern($config['filesystem.exclude_file_pattern']); if (!$fileFilterA->accept($targetFile)) { $data['errorMsg'] = $config['filesystem.invalid_file_name_msg']; renderPage("zip.tpl.php", $data); } /* // Setup second filter $fileFilterB =& new BasicFileFilter(); $fileFilterB->setIncludeFilePattern($config['zip.include_file_pattern']); $fileFilterB->setExcludeFilePattern($config['zip.exclude_file_pattern']); if (!$fileFilterB->accept($targetFile)) { $data['errorMsg'] = $config['zip.invalid_file_name_msg']; renderPage("zip.tpl.php", $data); } */ $archive = new PclZip($targetFile->getAbsolutePath()); $files = array(); for ($i = 0; $absPath = getRequestParam("file" . $i, false); $i++) { $file =& $fileFactory->getFile($absPath); $files[] = $file->getAbsolutePath(); } $list = $archive->create(implode(',', $files), PCLZIP_OPT_REMOVE_PATH, $targetFile->getParent()); if ($list == 0) { $data['errorMsg'] = $archive->errorInfo(true); } else { $targetFile->importFile(); } } // Render output renderPage("zip.tpl.php", $data);
<img src="static/birthday.png" class="not_selected"/> <img src="static/birthday_selected.png" class="selected"/> </a> <a class="btn" href="?page=partner"> <img src="static/partner.png" class="not_selected"/> <img src="static/partner_selected.png" class="selected"/> </a> <a class="btn" href="?page=contacts"> <img src="static/contacts.png" class="not_selected"/> <img src="static/contacts_selected.png" class="selected"/> </a> </div> <div align="center" style="width:700px; min-height: 500px; margin-left: auto; margin-right: auto"> <?php switch (getRequestParam("page", null)) { case "news": require_once "news.php"; break; case "places": require_once "places.php"; break; case "birthday": require_once "birthday.php"; break; case "partner": require_once "partner.php"; break; case "contacts": require_once "contacts.php"; break;
* * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. ******************************************************************************/ require_once 'header.inc'; $statusMessage = null; $errorMessage = null; $formAction = getRequestParam('form_action'); $appId = getRequestParam('app_id'); if ($formAction == 'delete') { if ($appId == null) { $errorMessage = 'No app ID specified.'; } if ($errorMessage == null) { try { DeveloperAppUtils::deleteApp($appId, $uid); } catch (Exception $e) { $errorMessage = 'Could not delete app: ' . $e->getMessage(); } } if ($errorMessage == null) { RingsideWebUtils::redirect('index.php'); } } else {
?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Columbus</title> </head> <body style="text-align: center"> <a href='index.php?page=places&place=<?php echo getRequestParam("place", ""); ?> #photos'> <img style="width: 100%" src='static/new/<?php echo getRequestParam("place", ""); ?> /<?php echo getRequestParam("photo", ""); ?> '/> <br/> <h1>Назад ко всем фотографиям</h1> <br/> <img src='static/<?php echo getRequestParam("place", ""); ?> 1.png' style="width: 30%"/> </a> </body> </html>
* @copyright Copyright © 2007, Moxiecode Systems AB, All rights reserved. */ // Use install if (file_exists("../install")) { die('{"result":null,"id":null,"error":{"errstr":"You need to run the installer or rename/remove the \\"install\\" directory.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); } error_reporting(E_ALL ^ E_NOTICE); require_once "../classes/Utils/JSON.php"; require_once "../classes/Utils/Error.php"; @set_time_limit(5 * 60); // 5 minutes execution time $MCErrorHandler = new Moxiecode_Error(false); set_error_handler("StreamErrorHandler"); require_once "../includes/general.php"; require_once "../classes/ManagerEngine.php"; $cmd = getRequestParam("cmd", ""); if ($cmd == "") { die("No command."); } $chunks = explode('.', $cmd); $type = $chunks[0]; $method = $cmd = $chunks[1]; // Clean up type, only a-z stuff. $type = preg_replace("/[^a-z]/i", "", $type); if ($type == "") { die("No type set."); } // Include Base and Core and Config. $man = new Moxiecode_ManagerEngine($type); require_once $basepath . "CorePlugin.php"; require_once "../config.php";
* * @package MCFileManager.pages * @author Moxiecode * @copyright Copyright © 2005, Moxiecode Systems AB, All rights reserved. */ require_once "includes/general.php"; require_once "includes/stream.php"; require_once "classes/FileSystems/FileFactory.php"; require_once "classes/FileSystems/LocalFileImpl.php"; verifyAccess($mcFileManagerConfig); $path = getRequestParam("path"); $rootpath = getRequestParam("rootpath", toUnixPath(getRealPath($mcFileManagerConfig, 'filesystem.rootpath'))); $fileFactory =& new FileFactory($mcFileManagerConfig, $rootpath); $targetFile =& $fileFactory->getFile($path); $config = $targetFile->getConfig(); $mode = getRequestParam("mode", "stream"); $mimeType = mapMimeTypeFromUrl($path, $config['stream.mimefile']); $file =& $fileFactory->getFile($path); // Setup first filter $fileFilterA =& new BasicFileFilter(); $fileFilterA->setIncludeFilePattern($config['filesystem.include_file_pattern']); $fileFilterA->setExcludeFilePattern($config['filesystem.exclude_file_pattern']); $fileFilterA->setIncludeExtensions($config['filesystem.extensions']); // Setup second filter $fileFilterB =& new BasicFileFilter(); $fileFilterB->setIncludeFilePattern($config['download.include_file_pattern']); $fileFilterB->setExcludeFilePattern($config['download.exclude_file_pattern']); $fileFilterB->setIncludeExtensions($config['download.extensions']); if (!$fileFilterA->accept($targetFile) || !$fileFilterB->accept($targetFile)) { trigger_error("Error: Requested file is not valid for download, check your config.", ERROR); }
$orgHeight = getRequestParam("orgheight"); $newWidth = getRequestParam("newwidth"); $newHeight = getRequestParam("newheight"); $left = getRequestParam("left"); $top = getRequestParam("top"); $action = getRequestParam("action"); $path = getRequestParam("path"); $orgpath = getRequestParam("orgpath", ""); $filename = getRequestParam("filename", ""); $msg = ""; if ($orgpath == "") { $orgpath = $path; } $temp_image = "mcic_" . session_id() . ""; verifyAccess($mcImageManagerConfig); $rootpath = removeTrailingSlash(getRequestParam("rootpath", toUnixPath(getRealPath($mcImageManagerConfig, 'filesystem.rootpath')))); $fileFactory =& new FileFactory($mcImageManagerConfig, $rootPath); addFileEventListeners($fileFactory); $file =& $fileFactory->getFile($path); $config = $file->getConfig(); $demo = checkBool($config['general.demo']) ? "true" : "false"; $imageutils = new $config['thumbnail'](); $tools = explode(',', $config['thumbnail.image_tools']); if (!in_array("edit", $tools)) { trigger_error("The thumbnail.image_tools needs to include edit.", WARNING); } // File info $fileInfo = getFileType($file->getAbsolutePath()); $file_icon = $fileInfo['icon']; $file_type = $fileInfo['type']; $file_ext = $fileInfo['ext'];
$defaultMode = $spellCheckerConfig['default.mode']; // Normaly not required to configure $defaultSpelling = $spellCheckerConfig['default.spelling']; $defaultJargon = $spellCheckerConfig['default.jargon']; $defaultEncoding = $spellCheckerConfig['default.encoding']; $outputType = "xml"; // Do not change // Get input parameters. $check = urldecode(getRequestParam('check')); $cmd = sanitize(getRequestParam('cmd')); $lang = sanitize(getRequestParam('lang'), "strict"); $mode = sanitize(getRequestParam('mode'), "strict"); $spelling = sanitize(getRequestParam('spelling'), "strict"); $jargon = sanitize(getRequestParam('jargon'), "strict"); $encoding = sanitize(getRequestParam('encoding'), "strict"); $sg = sanitize(getRequestParam('sg'), "bool"); $words = array(); $validRequest = true; if (empty($check)) { $validRequest = false; } if (empty($lang)) { $lang = $defaultLanguage; } if (empty($mode)) { $mode = $defaultMode; } if (empty($spelling)) { $spelling = $defaultSpelling; } if (empty($jargon)) {
<?php $rootpath = dirname(__FILE__); require_once "../init.inc.php"; require_once "../lib/rss.class.inc.php"; $solr = new Solr(); if ($solr->connect($theme->getSolrHost(), $theme->getSolrPort(), $theme->getSolrBaseUrl(), $theme->getSolrCore())) { $crit = getRequestParam("q"); $tag = getRequestParam("t"); $querylang = getRequestParam("ql"); $fqitms = array(); $word_variations = getRequestParam("wv") == "1"; $filter_lang = getRequestParam("lang"); $filter_country = getRequestParam("country"); $filter_mimetype = getRequestParam("mime"); $filter_source = getRequestParam("org"); $filter_tag = array(); if ($tag != "") { $filter_tag = explode(",", $tag); } if ($filter_country != "" || $filter_lang != "" || $filter_mimetype != "" || $filter_source != "") { $mode = "advanced"; } else { $mode = "simple"; } $queryField = getQueryField($search_language_code); $response = $solr->query($crit, $queryField, $querylang, '', 0, 0, 100, $fqitms, $word_variations, $filter_lang, $filter_country, $filter_mimetype, $filter_source, $filter_collection, $filter_tag, '', '', '', '', '', true, false); if ($response->getHttpStatus() == 200) { //print_r( $response->getRawResponse() ); $url = $config->get("application.url"); $title = $config->get("application.title");
*/ error_reporting(E_ALL ^ E_NOTICE); header("Content-type: text/javascript"); // Load MCManager core require_once "../includes/general.php"; require_once "../classes/ManagerEngine.php"; require_once "../classes/Utils/Error.php"; require_once "../classes/Utils/JSON.php"; $MCErrorHandler = new Moxiecode_Error(false); set_error_handler("JSErrorHandler"); $json = new Moxiecode_JSON(); // NOTE: Remove default value $type = getRequestParam("type", "im"); $format = getRequestParam("format", false); $prefix = getRequestParam("prefix", ""); $code = getRequestParam("code", "en"); if ($type == "") { die("alert('No type set.');"); } // Clean up type, only a-z stuff. $type = preg_replace("/[^a-z]/i", "", $type); // Include Base and Core and Config. $man = new Moxiecode_ManagerEngine($type); require_once $basepath . "CorePlugin.php"; require_once "../config.php"; $man->dispatchEvent("onPreInit", array($type)); // Include all plugins $pluginPaths = $man->getPluginPaths(); foreach ($pluginPaths as $path) { require_once "../" . $path; }
* @author Moxiecode * @copyright Copyright © 2005, Moxiecode Systems AB, All rights reserved. */ require_once "includes/general.php"; require_once "classes/FileSystems/FileFactory.php"; require_once "classes/FileSystems/LocalFileImpl.php"; $data = array(); verifyAccess($mcFileManagerConfig); $path = getRequestParam("path", ""); $rootpath = getRequestParam("rootpath", toUnixPath(getRealPath($mcFileManagerConfig, 'filesystem.rootpath'))); $fileFactory =& new FileFactory($mcFileManagerConfig, $rootpath); $targetFile =& $fileFactory->getFile($path); $config = $targetFile->getConfig(); addFileEventListeners($fileFactory); $filename = getRequestParam("filename", false); $submitted = getRequestParam("submitted", false); $data['path'] = $path; $data['submitted'] = $submitted; $data['short_path'] = getUserFriendlyPath($path, 30); $data['full_path'] = getUserFriendlyPath($path); $data['errorMsg'] = ""; $data['demo'] = checkBool($config['general.demo']) ? "true" : "false"; $data['demo_msg'] = $config['general.demo_msg']; if (!$filename) { $filename = $targetFile->getName(); if (strpos($filename, ".") > 0) { $filename = substr($filename, 0, strrpos($filename, ".")); } } $data['filename'] = $filename; if ($submitted) {
<?php require_once "../../includes/general.php"; require_once "../../classes/ManagerEngine.php"; // Get input $returnURL = getRequestParam('return_url', ''); $path = getRequestParam('path', ''); $rootpath = getRequestParam('rootpath', ''); $user = getRequestParam('user', ''); $key = getRequestParam('key'); // Setup mananager $man =& new Moxiecode_ManagerEngine($type); require_once $basepath . "CorePlugin.php"; require_once "../../config.php"; // Pre init and grab config $man->dispatchEvent("onPreInit", array($type)); $config =& $man->getConfig(); // Change this to match the one in config.php $secretKey = "someSecretKey"; // Is the hash correct if ($key == MD5($returnURL . $path . $rootpath . $user . $secretKey)) { @session_start(); $_SESSION['mcmanager_ext_auth'] = true; $_SESSION['mcmanager_ext_path'] = $path; $_SESSION['mcmanager_ext_rootpath'] = $rootpath; header('location: ' . $returnURL); } else { sleep(1); // Prevent bots from trying die('Error: Invalid hash verify that the secret keys match up.'); }
<?php require_once "../includes/general.php"; require_once '../classes/Utils/ClientResources.php'; require_once '../classes/Utils/CSSCompressor.php'; require_once "../classes/ManagerEngine.php"; // Set the error reporting to minimal @error_reporting(E_ERROR | E_WARNING | E_PARSE); $theme = getRequestParam("theme", "", true); $package = getRequestParam("package", "", true); $type = getRequestParam("type", "", true); // Include Base and Core and Config. $man = new Moxiecode_ManagerEngine($type); require_once $basepath . "CorePlugin.php"; require_once "../config.php"; $man->dispatchEvent("onPreInit", array($type)); $config = $man->getConfig(); $compressor = new Moxiecode_CSSCompressor(array('expires_offset' => 3600 * 24 * 10, 'disk_cache' => true, 'cache_dir' => '_cache', 'gzip_compress' => true, 'remove_whitespace' => false, 'charset' => 'UTF-8', 'name' => $theme . "_" . $package, 'convert_urls' => true)); $resources = new Moxiecode_ClientResources(); // Load theme resources $resources->load('../pages/' . $theme . '/resources.xml'); // Load plugin resources $plugins = explode(',', $config["general.plugins"]); foreach ($plugins as $plugin) { $resources->load('../plugins/' . $plugin . '/resources.xml'); } $files = $resources->getFiles($package); if ($resources->isDebugEnabled() || checkBool($config["general.debug"])) { header('Content-type: text/css'); $pagePath = dirname($_SERVER['SCRIPT_NAME']); echo "/* Debug enabled, css files will be loaded without compression */\n";
<?php // Use install if (file_exists("install")) { header("location: install/index.php"); die; } require_once "includes/general.php"; require_once "classes/Utils/Error.php"; require_once "classes/ManagerEngine.php"; $MCErrorHandler = new Moxiecode_Error(false); set_error_handler("HTMLErrorHandler"); // NOTE: Remove default value $type = getRequestParam("type"); // Clean up type, only a-z stuff. $type = preg_replace("/[^a-z]/i", "", $type); if (!$type) { header('location: examples.html'); die; } // Include Base and Core and Config. $man = new Moxiecode_ManagerEngine($type); require_once $basepath . "CorePlugin.php"; require_once "config.php"; $man->dispatchEvent("onPreInit", array($type)); // Include all plugins $pluginPaths = $man->getPluginPaths(); foreach ($pluginPaths as $path) { require_once $path; } $config = $man->getConfig();
$toolbarCommands = explode(',', $config['general.toolbar']); $tools = array(); foreach ($toolbarCommands as $command) { foreach ($toolbar as $tool) { if ($tool['command'] == $command) { $tools[] = $tool; } } } $imageTools = array(); $imageTools = explode(',', $config['thumbnail.image_tools']); $information = array(); $information = explode(',', $config['thumbnail.information']); $data['js'] = getRequestParam("js", ""); $data['formname'] = getRequestParam("formname", ""); $data['elementnames'] = getRequestParam("elementnames", ""); $data['disabled_tools'] = $config['general.disabled_tools']; $data['image_tools'] = $imageTools; $data['toolbar'] = $tools; $data['full_path'] = $path; $data['root_path'] = $rootpath; $data['errorMsg'] = "dfdf"; //addslashes($errorMsg); $data['selectedPath'] = $selectedPath; $data['dirlist'] = $dirList; $data['anchor'] = $anchor; $data['exif_support'] = exifExists(); $data['gd_support'] = $isGD; $data['edit_enabled'] = checkBool($config["thumbnail.gd.enabled"]); $data['demo'] = checkBool($config["general.demo"]); $data['demo_msg'] = $config["general.demo_msg"];
* @copyright Copyright © 2007, Moxiecode Systems AB, All rights reserved. */ error_reporting(E_ALL ^ E_NOTICE); header("Content-type: text/javascript"); // Load MCManager core require_once "../includes/general.php"; require_once "../classes/ManagerEngine.php"; require_once "../classes/Utils/Error.php"; require_once "../classes/Utils/JSON.php"; $MCErrorHandler = new Moxiecode_Error(false); set_error_handler("JSErrorHandler"); $json = new Moxiecode_JSON(); // NOTE: Remove default value $type = getRequestParam("type", "im"); $format = getRequestParam("format", false); $prefix = getRequestParam("prefix", ""); if ($type == "") { die("alert('No type set.');"); } // Clean up type, only a-z stuff. $type = preg_replace("/[^a-z]/i", "", $type); // Include Base and Core and Config. $man = new Moxiecode_ManagerEngine($type); require_once $basepath . "CorePlugin.php"; require_once "../config.php"; $man->dispatchEvent("onPreInit", array($type)); // Include all plugins $pluginPaths = $man->getPluginPaths(); foreach ($pluginPaths as $path) { require_once "../" . $path; }
$solr->setDebug($debug); $response = $solr->query($crit, $queryField, $querylang, $sort, $groupsize, ($page - 1) * $item_per_page, $item_per_page, $fqsearch, $word_variations, $filter_lang, $filter_country, $filter_mimetype, $filter_source, $filter_collection, $filter_tag, $filter_location_lat, $filter_location_lng, $filter_location_radius, $theme->getSolrFields(), $theme->getParamExtra(), $mode, false, $debug); if ($response->getHttpStatus() == 200) { $res .= $theme->generateResults(); } else { $res .= $response->getHttpStatusMessage(); } } } else { $res = "not pinging"; //$res .= " (http://" . $solr_host . ":" . $solr_port . $solr_baseurl . $solr_corename . ")"; } } else { if ($action == "preferences_display") { $config_facet_union_check = ""; if ($facet_union) { $config_facet_union_check = 'checked="checked"'; } $res = <<<EOD \t\t\t\t<form name="pref_form" id="pref_form" action=""> \t\t\t\t\tFacet UNION <input type="checkbox" name="config_facet_union" id="config_facet_union" value="1" {$config_facet_union_check}> \t\t\t\t</form> EOD; } if ($action == "preferences_save") { $value = getRequestParam("facet_union"); $config->setCookie("facet.mode_union", $value); } } //$res = $_SERVER["QUERY_STRING"] . "<br/>" . $res; print $res;
session_id($_REQUEST['sessionid']); */ // Use install if (file_exists("install")) { header("location: install/index.php"); die; } require_once "includes/general.php"; require_once "classes/Utils/Error.php"; require_once "classes/ManagerEngine.php"; $MCErrorHandler = new Moxiecode_Error(false); set_error_handler("HTMLErrorHandler"); // NOTE: Remove default value $type = getRequestParam("type"); $page = getRequestParam("page", "index.html"); $domain = getRequestParam("domain"); // Clean up type, only a-z stuff. $type = preg_replace("/[^a-z]/i", "", $type); if (!$type) { header('location: examples.html'); die; } // Include Base and Core and Config. $man = new Moxiecode_ManagerEngine($type); require_once $basepath . "CorePlugin.php"; require_once "config.php"; $man->dispatchEvent("onPreInit", array($type)); // Include all plugins $pluginPaths = $man->getPluginPaths(); foreach ($pluginPaths as $path) { require_once $path;
function detectCookie() { $storeId = getRequestParam('store_id') ? getRequestParam('store_id') : 0; if (getAffiliateplusConfig('action/detect_cookie', $storeId)) { if (isset($_COOKIE['cpm']) && $_COOKIE['cpm']) { return true; } $expiredTime = getAffiliateplusConfig('general/expired_time', $storeId); $expiredTime = $expiredTime ? time() + intval($expiredTime) * 86400 : 0; setcookie('cpm', 1, $expiredTime); } return false; }
die('{"result":null,"id":null,"error":{"errstr":"You need to run the installer or rename/remove the \\"install\\" directory.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); } error_reporting(E_ALL ^ E_NOTICE); require_once "../classes/Utils/JSON.php"; require_once "../classes/Utils/Error.php"; @set_time_limit(5 * 60); // 5 minutes execution time $MCErrorHandler = new Moxiecode_Error(false); set_error_handler("StreamErrorHandler"); require_once "../includes/general.php"; require_once "../classes/ManagerEngine.php"; $cmd = getRequestParam("cmd", ""); $theme = getRequestParam("theme", "", true); $package = getRequestParam("package", "", true); $type = getRequestParam("type", "", true); $file = getRequestParam("file", "", true); if ($package) { require_once '../classes/Utils/ClientResources.php'; $resources = new Moxiecode_ClientResources(); $resources->load('../pages/' . $theme . '/resources.xml'); if ($type) { $man = new Moxiecode_ManagerEngine($type); require_once MCMANAGER_ABSPATH . "CorePlugin.php"; require_once "../config.php"; $man->dispatchEvent("onPreInit", array($type)); $mcConfig = $man->getConfig(); // Load plugin resources $plugins = explode(',', $mcConfig["general.plugins"]); foreach ($plugins as $plugin) { $resources->load('../plugins/' . $plugin . '/resources.xml'); }
* createdir.php * * @package MCImageManager.pages * @author Moxiecode * @copyright Copyright © 2005-2006, Moxiecode Systems AB, All rights reserved. */ require_once "includes/general.php"; require_once "classes/FileSystems/FileFactory.php"; require_once "classes/FileSystems/LocalFileImpl.php"; $data = array(); verifyAccess($mcImageManagerConfig); $path = getRequestParam("path", toUnixPath(getRealPath($mcImageManagerConfig, 'filesystem.path'))); $rootpath = getRequestParam("rootpath", toUnixPath(getRealPath($mcImageManagerConfig, 'filesystem.rootpath'))); $action = getRequestParam("action", ""); $dirname = getRequestParam("dirname", false); $template = getRequestParam("template", ""); $fileFactory =& new FileFactory($mcImageManagerConfig, $rootpath); $targetFile =& $fileFactory->getFile($path); $config = $targetFile->getConfig(); addFileEventListeners($fileFactory); $data['path'] = $path; $data['short_path'] = getUserFriendlyPath($path, 30); $data['full_path'] = getUserFriendlyPath($path); $data['dirname'] = $dirname; $data['template'] = $template; $data['errorMsg'] = ""; $data['demo'] = checkBool($config['general.demo']) ? "true" : "false"; $data['demo_msg'] = $config['general.demo_msg']; $data['forceDirectoryTemplate'] = checkBool($config['filesystem.force_directory_template']); $data['dir_path'] = ""; $templates = explode(',', $config['filesystem.directory_templates']);
* @author Moxiecode * @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved. */ require_once "./includes/general.php"; // Set RPC response headers header('Content-Type: text/plain'); header('Content-Encoding: UTF-8'); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); $raw = ""; // Try param if (isset($_POST["json_data"])) { $raw = getRequestParam("json_data"); } // Try globals array if (!$raw && isset($_GLOBALS) && isset($_GLOBALS["HTTP_RAW_POST_DATA"])) { $raw = $_GLOBALS["HTTP_RAW_POST_DATA"]; } // Try globals variable if (!$raw && isset($HTTP_RAW_POST_DATA)) { $raw = $HTTP_RAW_POST_DATA; } // Try stream if (!$raw) { if (!function_exists('file_get_contents')) { $fp = fopen("php://input", "r"); if ($fp) { $raw = "";
<?php $profileName = getRequestParam("profile_name"); $fileContents = loadFile($profileName); echo $fileContents; function getRequestParam($key) { return $_GET[$key]; } function loadFile($profileName) { $filePath = $_SERVER['DOCUMENT_ROOT'] . "/viking-saga/" . $profileName . ".txt"; $myfile = fopen($filePath, "r") or die("Unable to open file!"); $fileContents = fread($myfile, filesize($filePath)); fclose($myfile); return $fileContents; } function saveFile($fileContents) { $fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/viking-saga/ethlore.txt", "wb"); fwrite($fp, $fileContents); fclose($fp); }