$p = $App->all(); $out = new jsonOutput(); $list = array(); foreach ($p as $d => $v) { $item = array(); foreach (array("sysname", "name", "author", "email", "maturity", "category", "version", "filetypes", "compatible") as $key) { $item[$key] = $v->{$key}; } $item["files"] = array(); if (is_dir($GLOBALS['path'] . "/../desktop/dojotoolkit/lucid/apps/" . $item['sysname'])) { $item["files"][$v->sysname] = jsSearch($GLOBALS['path'] . "/../desktop/dojotoolkit/lucid/apps/" . $v->sysname, $GLOBALS['path'] . "/../desktop/dojotoolkit/lucid/apps/"); } $item["files"][] = $v->sysname . ".js"; array_push($list, $item); } $out->set($list); } } if ($_GET['section'] == "write") { if ($_GET['action'] == "save") { import("models.user"); $user = $User->get_current(); if (!$user->has_permission("core.app.write")) { internal_error("permission_denied"); } //if(!isset($_POST['filename'])) { if (!array_key_exists("sysname", $_POST)) { $_POST['sysname'] = ""; } $_POST['sysname'] = str_replace("..", "", $_POST['sysname']); $p = $App->filter("sysname", $_POST['sysname']);
$realpath = $module->getRealPath($sentpath); $newzip->set_options(array('inmemory' => 1, 'recurse' => 1, 'storepaths' => 1, 'basedir' => dirname($realpath))); $newzip->add_files(basename($realpath)); $newzip->create_archive(); $newzip->download_file(); } else { header("Content-type: {$type}"); header("Content-Disposition: attachment;filename=\"{$name}\""); header('Pragma: no-cache'); header('Expires: 0'); header("Content-length: {$size}"); echo $module->read($sentpath); } } } if ($_GET['action'] == "display") { $info = $module->getFileInfo($sentpath); $type = $info['type']; $size = $info['size']; $name = $info['name']; header("Content-type: {$type}"); header('Pragma: no-cache'); header('Expires: 0'); header("Content-length: {$size}"); echo $module->read($sentpath); } if ($_GET['action'] == "info") { $out = new jsonOutput(); $out->set($module->getFileInfo($sentpath)); } }
if ($p !== false && $p->id != $cur->id) { $p->delete(); } } if ($_GET['action'] == "list") { $p = $User->all(); $out = new jsonOutput(); $val = array(); foreach ($p as $d => $v) { $o = array(); foreach (array("id", "username", "name", "logged", "email", "permissions", "groups", "lastauth", "quota") as $key) { $o[$key] = $v->{$key}; } array_push($val, $o); } $out->set($val); } if ($_GET['action'] == "online") { $online = 0; $total = 0; $p = $User->all(); foreach ($p as $u) { $total++; if ($u->logged == 1) { $online++; } } $o = new jsonOutput(); $o->append("online", $online); $o->append("total", $total); }