Ejemplo n.º 1
0
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;
}
$config = $man->getConfig();
$suffix = "";
if ($domain) {
    $suffix .= "?domain=" . $domain;
}
// Dispatch onInit event
if ($man->isAuthenticated()) {
Ejemplo n.º 2
0
    readfile($file->getPath());
    die;
}
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 MCMANAGER_ABSPATH . "CorePlugin.php";
require_once "../config.php";
$man->dispatchEvent("onPreInit", array($type));
$mcConfig = $man->getConfig();
// Include all plugins
$pluginPaths = $man->getPluginPaths();
foreach ($pluginPaths as $path) {
    require_once "../" . $path;
}
// Dispatch onAuthenticate event
if ($man->isAuthenticated()) {
    if ($_SERVER["REQUEST_METHOD"] == "GET") {
        $args = $_GET;
        // Dispatch event before starting to stream
        $man->dispatchEvent("onBeforeStream", array($cmd, &$args));
Ejemplo n.º 3
0
<?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";
Ejemplo n.º 4
0
<?php

// Use installer
if (file_exists("../install")) {
    die("alert('You need to run the installer or rename/remove the \"install\" directory.');");
}
error_reporting(E_ALL ^ E_NOTICE);
require_once "../includes/general.php";
require_once '../classes/Utils/JSCompressor.php';
require_once "../classes/ManagerEngine.php";
$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 MCMANAGER_ABSPATH . "CorePlugin.php";
require_once "../config.php";
$man->dispatchEvent("onPreInit", array($type));
$mcConfig = $man->getConfig();
// Include all plugins
$pluginPaths = $man->getPluginPaths();
foreach ($pluginPaths as $path) {
    require_once "../" . $path;
}
if ($package) {
    $compressor = new Moxiecode_JSCompressor(array('expires_offset' => 3600 * 24 * 10, 'disk_cache' => true, 'cache_dir' => '_cache', 'gzip_compress' => true, 'remove_whitespace' => true, 'charset' => 'UTF-8', 'name' => $theme . "_" . $package));
    require_once '../classes/Utils/ClientResources.php';
    $resources = new Moxiecode_ClientResources();
    // Load theme resources
    $resources->load('../pages/' . $theme . '/resources.xml');
    // Load plugin resources
Ejemplo n.º 5
0
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;
}
// Dispatch auth event to make authenticators override config options
$man->isAuthenticated();
$langPack =& $man->getLangPack();
$groups =& $langPack->getGroups();
// TinyMCE specific format
if ($format == "tinymce") {
    echo "tinyMCE.addToLang('',{\n";
Ejemplo n.º 6
0
    die('{"result":null,"id":null,"error":{"errstr":"Could not get raw post data.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
}
// Get JSON data
$json = new Moxiecode_JSON();
$input = $json->decode($raw);
// Parse prefix and method
$chunks = explode('.', $input['method']);
$type = $chunks[0];
$input['method'] = $chunks[1];
// Clean up type, only a-z stuff.
$type = preg_replace("/[^a-z]/i", "", $type);
if ($type == "") {
    die('{"result":null,"id":null,"error":{"errstr":"No type set.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
}
// 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();
// Include all plugins
$pluginPaths = $man->getPluginPaths();
foreach ($pluginPaths as $path) {
    require_once "../" . $path;
}
// Dispatch onInit event
if ($man->isAuthenticated()) {
    $man->dispatchEvent("onBeforeRPC", array($input['method'], $input['params'][0]));
    $result = new stdClass();
    $result->result = $man->executeEvent("onRPC", array($input['method'], $input['params'][0]));
    $result->id = $input['id'];
Ejemplo n.º 7
0
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 MCMANAGER_ABSPATH . "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();
$suffix = "";
if ($domain) {
    $suffix .= "?domain=" . $domain;
}
// Dispatch onInit event
//if ($man->isAuthenticated()) {