Example #1
0
ini_set("display_errors", 1);
// include constants
require_once "../constants.php";
require_once "../functions.php";
require_once "../dbConfig.php";
//$_SESSION['SYSTEM_ENTRY'] = USCIC_SMS;
$loaded = dbConfig::load("../conf.php");
require_once "../config.php";
require_once "../object.php";
require_once "../component.php";
require_once "../setting.php";
require_once "../survey.php";
/* check for 'javascript enabled' indicator */
isJavascriptEnabled();
/* set path */
setPath();
/* database */
require_once 'database.php';
$db = new Database();
if ($db->getDb() == null) {
    //no connection with DB.. Errormessage!
    exit;
}
ini_set('xdebug.max_nesting_level', 2000);
ini_set("error_reporting", "ALL");
if (loadvar('ajaxr') != '') {
    $params = getAjaxParamsPost(loadvar('ajaxr'));
}
require_once 'surveyajax.php';
$ajax = new SurveyAjax($params);
$ajax->getPage(loadvar('p'));
Example #2
0
     if ($has_compression) {
         $final = gzdeflate($output, 9);
     } else {
         $final = $output;
     }
     // Write it!
     genCache($final, $is_developer, $cache_hash);
 }
 // Filter the JS
 if ($type == 'javascripts') {
     // Set the JS locales
     $output = setLocales($output, $locale);
     // Set the JS configuration
     $output = setConfiguration($output, $hash, $locale, $version, uploadMaxSize());
     // Set the Get API paths
     $output = setPath($output, $hash, HOST_STATIC, $type, $locale);
     // Translate the JS script
     require_once './gettext.php';
     includeTranslation($locale, 'main');
     $output = setTranslation($output);
     // Generate the cache
     if ($has_compression) {
         $final = gzdeflate($output, 9);
     } else {
         $final = $output;
     }
     // Write it!
     genCache($final, $is_developer, $cache_lang);
 }
 // Output a well-encoded string
 if ($deflate_support || !$has_compression) {
Example #3
0
function download($path = "")
{
    global $TmpUid;
    global $TmpCurrentDir;
    $files = getDirList($path);
    if (!$TmpUid) {
        $TmpUid = md5(uniqid() . date("H:i:s"));
    }
    if (!$TmpCurrentDir) {
        $TmpCurrentDir = "";
    }
    if (!file_exists(get('TmpPath'))) {
        echo 'TmpPath does not exist';
        exit;
    }
    $dirPath = get('TmpPath') . '/' . $TmpUid . '/';
    if (!file_exists($dirPath)) {
        mkdir($dirPath, 0777);
    }
    foreach ($files as $key => $value) {
        switch ($value['attrib']['kind']) {
            case 'dir':
                $TmpCurrentDir .= "/" . $value['name'];
                if (!file_exists($dirPath . ltrim($TmpCurrentDir, '/') . '/')) {
                    mkdir($dirPath . ltrim($TmpCurrentDir, '/') . '/', 0777);
                }
                download(getPath() . $TmpCurrentDir);
                $TmpCurrentDir = dirname($TmpCurrentDir);
                break;
            case 'file':
                $old_path = $_GET['path'];
                if (basename(getPath()) == $value['name']) {
                    setPath(getPath() . $TmpCurrentDir);
                } else {
                    setPath(getPath() . $TmpCurrentDir . "/" . $value['name']);
                }
                $file_content = getFile(true);
                if (!empty($file_content)) {
                    file_put_contents($dirPath . ltrim($TmpCurrentDir, '/') . '/' . $value['name'], $file_content);
                }
                revertPath();
                break;
            default:
                echo 'error';
                break;
        }
    }
    Zip($dirPath, get('TmpPath') . '/' . $TmpUid . '.zip');
    //rrmdir($dirPath);
    return $TmpUid;
}