$itype = 'uid'; echo '<form action="?gmanager_action=change&c=' . Registry::get('rCurrent') . '&go=1" method="post"><div class="telo"><table><tr><th><input type="checkbox" onclick="Gmanager.check(this.form,\'check[]\',this.checked)"/></th>' . (Config::get('Display', 'name') ? '<th><a href="?c=' . Registry::get('rCurrent') . '">' . Language::get('name') . '</a></th>' : '') . (Config::get('Display', 'down') ? '<th>' . Language::get('get') . '</th>' : '') . (Config::get('Display', 'type') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&type">' . Language::get('type') . '</a></th>' : '') . (Config::get('Display', 'size') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&size">' . Language::get('size') . '</a></th>' : '') . (Config::get('Display', 'change') ? '<th>' . Language::get('change') . '</th>' : '') . (Config::get('Display', 'del') ? '<th>' . Language::get('del') . '</th>' : '') . (Config::get('Display', 'chmod') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&chmod">' . Language::get('chmod') . '</a></th>' : '') . (Config::get('Display', 'date') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&time">' . Language::get('date') . '</a></th>' : '') . (Config::get('Display', 'uid') ? '<th>' . $mnem . ' <a href="?c=' . Registry::get('rCurrent') . '&uid' . $down . '">' . Language::get('uid') . '</a></th>' : '') . (Config::get('Display', 'gid') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&gid">' . Language::get('gid') . '</a></th>' : '') . (Config::get('Display', 'n') ? '<th>' . Language::get('n') . '</th>' : '') . '</tr>'; } elseif (isset($_GET['gid'])) { $itype = 'gid'; echo '<form action="?gmanager_action=change&c=' . Registry::get('rCurrent') . '&go=1" method="post"><div class="telo"><table><tr><th><input type="checkbox" onclick="Gmanager.check(this.form,\'check[]\',this.checked)"/></th>' . (Config::get('Display', 'name') ? '<th><a href="?c=' . Registry::get('rCurrent') . '">' . Language::get('name') . '</a></th>' : '') . (Config::get('Display', 'down') ? '<th>' . Language::get('get') . '</th>' : '') . (Config::get('Display', 'type') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&type">' . Language::get('type') . '</a></th>' : '') . (Config::get('Display', 'size') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&size">' . Language::get('size') . '</a></th>' : '') . (Config::get('Display', 'change') ? '<th>' . Language::get('change') . '</th>' : '') . (Config::get('Display', 'del') ? '<th>' . Language::get('del') . '</th>' : '') . (Config::get('Display', 'chmod') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&chmod">' . Language::get('chmod') . '</a></th>' : '') . (Config::get('Display', 'date') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&time">' . Language::get('date') . '</a></th>' : '') . (Config::get('Display', 'uid') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&uid">' . Language::get('uid') . '</a></th>' : '') . (Config::get('Display', 'gid') ? '<th>' . $mnem . ' <a href="?c=' . Registry::get('rCurrent') . '&gid' . $down . '">' . Language::get('gid') . '</a></th>' : '') . (Config::get('Display', 'n') ? '<th>' . Language::get('n') . '</th>' : '') . '</tr>'; } else { $itype = ''; echo '<form action="?gmanager_action=change&c=' . Registry::get('rCurrent') . '&go=1" method="post"><div class="telo"><table><tr><th><input type="checkbox" onclick="Gmanager.check(this.form,\'check[]\',this.checked)"/></th>' . (Config::get('Display', 'name') ? '<th>' . $mnem . ' <a href="?c=' . Registry::get('rCurrent') . $down . '">' . Language::get('name') . '</a></th>' : '') . (Config::get('Display', 'down') ? '<th>' . Language::get('get') . '</th>' : '') . (Config::get('Display', 'type') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&type">' . Language::get('type') . '</a></th>' : '') . (Config::get('Display', 'size') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&size">' . Language::get('size') . '</a></th>' : '') . (Config::get('Display', 'change') ? '<th>' . Language::get('change') . '</th>' : '') . (Config::get('Display', 'del') ? '<th>' . Language::get('del') . '</th>' : '') . (Config::get('Display', 'chmod') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&chmod">' . Language::get('chmod') . '</a></th>' : '') . (Config::get('Display', 'date') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&time">' . Language::get('date') . '</a></th>' : '') . (Config::get('Display', 'uid') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&uid">' . Language::get('uid') . '</a></th>' : '') . (Config::get('Display', 'gid') ? '<th><a href="?c=' . Registry::get('rCurrent') . '&gid">' . Language::get('gid') . '</a></th>' : '') . (Config::get('Display', 'n') ? '<th>' . Language::get('n') . '</th>' : '') . '</tr>'; } } elseif ($archive != Archive::FORMAT_GZ) { echo '<form action="?gmanager_action=change&c=' . Registry::get('rCurrent') . '&go=1" method="post"><div class="telo"><table><tr><th><input type="checkbox" onclick="Gmanager.check(this.form,\'check[]\',this.checked)"/></th>' . (Config::get('Display', 'name') ? '<th>' . $mnem . ' <a href="?c=' . Registry::get('rCurrent') . $down . '">' . Language::get('name') . '</a></th>' : '') . (Config::get('Display', 'down') ? '<th>' . Language::get('get') . '</th>' : '') . (Config::get('Display', 'type') ? '<th>' . Language::get('type') . '</th>' : '') . (Config::get('Display', 'size') ? '<th>' . Language::get('size') . '</th>' : '') . (Config::get('Display', 'change') ? '<th>' . Language::get('change') . '</th>' : '') . (Config::get('Display', 'del') ? '<th>' . Language::get('del') . '</th>' : '') . (Config::get('Display', 'chmod') ? '<th>' . Language::get('chmod') . '</th>' : '') . (Config::get('Display', 'date') ? '<th>' . Language::get('date') . '</th>' : '') . (Config::get('Display', 'uid') ? '<th>' . Language::get('uid') . '</th>' : '') . (Config::get('Display', 'gid') ? '<th>' . Language::get('gid') . '</th>' : '') . (Config::get('Display', 'n') ? '<th>' . Language::get('n') . '</th>' : '') . '</tr>'; } } if ($archive && $archive != Archive::FORMAT_GZ) { $obj = new Archive(); $factory = $obj->setFormat($archive)->setFile(Registry::get('current'))->factory(); if ($if) { echo $factory->lookFile($_GET['f']); } else { echo $factory->listArchive($idown); $f = 1; } } elseif ($archive == Archive::FORMAT_GZ) { echo Gmanager::getInstance()->gz(Registry::get('current')) . '<div class="ch"><form action="?gmanager_action=change&c=' . Registry::get('rCurrent') . '&go=1" method="post"><div><input type="submit" name="gz_extract" value="' . Language::get('extract_archive') . '"/></div></form></div>'; $if = true; } else { echo Gmanager::getInstance()->look(Registry::get('current'), $itype, $idown); } if (Gmanager::getInstance()->file_exists(Registry::get('current')) || Registry::get('currentType') == 'link') { if ($archive) { $d = Helper_View::getRawurl(dirname(Registry::get('current')));
} $start = isset($_POST['start']) ? intval($_POST['start']) - 1 : 0; $end = isset($_POST['end']) ? intval($_POST['end']) : Config::get('LineEditor', 'lines'); if (isset($_POST['editorReplace']) && isset($_POST['from']) && isset($_POST['to'])) { if ($archive == Archive::FORMAT_ZIP) { $data = Gmanager::getInstance()->replaceZip(Registry::get('current'), $_GET['f'], $_POST['from'], $_POST['to'], isset($_POST['regexp']), isset($_POST['case'])); } else { $data = Gmanager::getInstance()->replace(Registry::get('current'), $_POST['from'], $_POST['to'], isset($_POST['regexp']), isset($_POST['case'])); } echo $data['message']; unset($data['message']); } else { $data = array(); if ($archive == Archive::FORMAT_ZIP) { $obj = new Archive(); $archData = $obj->setFormat(Archive::FORMAT_ZIP)->setFile(Registry::get('current'))->factory()->getEditFile($_GET['f']); $data['content'] = $archData['text']; } else { $data['content'] = Gmanager::getInstance()->file_get_contents(Registry::get('current')); } } if ($archive == Archive::FORMAT_ZIP) { $f = '&f=' . rawurlencode($_GET['f']); } else { $f = ''; } if ($charset[0] && $data['content']) { $data['content'] = mb_convert_encoding($data['content'], $charset[1], $charset[0]); } if ($_GET['beautify']) { $data['content'] = Gmanager::getInstance()->beautify($data['content']);
echo Gmanager::getInstance()->frename(Registry::get('current'), $_POST['name'], isset($_POST['chmod']) ? $_POST['chmod'] : null, isset($_POST['del']), $_POST['name'], isset($_POST['overwrite'])); if (isset($_POST['chmod']) && $_POST['chmod']) { echo Gmanager::getInstance()->rechmod($_POST['name'], $_POST['chmod']); } } } else { echo Helper_View::message(Language::get('filename_empty'), Helper_View::MESSAGE_ERROR); } break; case 'del_zip_archive': $obj = new Archive(); echo $obj->setFormat(Archive::FORMAT_ZIP)->setFile($_GET['c'])->factory()->delFile($_GET['f']); break; case 'del_tar_archive': $obj = new Archive(); echo $obj->setFormat(Archive::FORMAT_TAR)->setFile($_GET['c'])->factory()->delFile($_GET['f']); break; case 'upload': if ((!isset($_POST['url']) || $_POST['url'] == 'http://' || $_POST['url'] == '') && (!isset($_FILES['f']) || $_FILES['f']['error'][0]) && !isset($_POST['f']) || !isset($_POST['name']) || !isset($_POST['chmod'])) { echo '<div class="input"><form action="change.php?go=upload&c=' . Registry::get('rCurrent') . '" method="post" enctype="multipart/form-data"><div>' . Language::get('url') . '<br/><textarea class="lines" name="url" rows="3" cols="48" wrap="off">http://</textarea><br/>' . Language::get('headers') . '<br/><textarea class="lines" rows="3" cols="32" name="headers">User-Agent: ' . (isset($_SERVER['HTTP_USER_AGENT']) ? htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_NOQUOTES) : '') . "\r\n" . 'Cookie: ' . "\n" . 'Referer: ' . "\n" . 'Accept: ' . (isset($_SERVER['HTTP_ACCEPT']) ? htmlspecialchars($_SERVER['HTTP_ACCEPT'], ENT_NOQUOTES) : '') . "\r\n" . 'Accept-Charset: ' . (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? htmlspecialchars($_SERVER['HTTP_ACCEPT_CHARSET'], ENT_NOQUOTES) : '') . "\r\n" . 'Accept-Language: ' . (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? htmlspecialchars($_SERVER['HTTP_ACCEPT_LANGUAGE'], ENT_NOQUOTES) : '') . "\n" . 'Connection: Close' . "\r\n" . '</textarea><br/>' . Language::get('file') . ' (' . ini_get('upload_max_filesize') . ') <a title="' . Language::get('add') . '" href="javascript:void(0);" onclick="Gmanager.filesAdd();">[+]</a> / <a title="' . Language::get('dl') . '" href="javascript:void(0);" onclick="Gmanager.filesDel();">[-]</a><br/><div id="fl"><input type="file" name="f[]"/><br/></div>' . Language::get('name') . '<br/><input type="text" name="name" value="' . Registry::get('hCurrent') . '"/><br/><input onkeypress="return Gmanager.number(event)" type="text" name="chmod" value="0644" size="4" maxlength="4" style="-wap-input-format:\'4N\';width:28pt;"/>' . Language::get('change_chmod') . '<br/><input type="text" name="set_time_limit" value="3600" size="5" style="-wap-input-format:\'*N\';width:28pt;"/>' . Language::get('set_time_limit') . '<br/><input type="checkbox" name="ignore_user_abort" id="ignore_user_abort" checked="checked" /><label for="ignore_user_abort">' . Language::get('ignore_user_abort') . '</label><br/><br/><input type="submit" value="' . Language::get('upload') . '"/></div></form></div>'; } else { if (!$_FILES['f']['error'][0]) { $all = sizeof($_FILES['f']['tmp_name']); if ($all > 1) { if (mb_substr($_POST['name'], -1) != '/') { $_POST['name'] .= '/'; } } for ($i = 0; $i < $all; ++$i) { echo Gmanager::getInstance()->uploadFiles($_FILES['f']['tmp_name'][$i], $_FILES['f']['name'][$i], $_POST['name'], $_POST['chmod']); }
/** * replaceZip * * @param string $current * @param string $f * @param string $from * @param string $to * @param bool $regexp * @param bool $caseLess * @return array array('message' => '', 'content' => '') */ public function replaceZip($current = '', $f = '', $from = '', $to = '', $regexp = false, $caseLess = true) { $archive = new Archive(); $c = $archive->setFormat(Archive::FORMAT_ZIP)->setFile($current)->factory()->getEditFile($f); return $this->_replace($c['text'], $from, $to, $regexp, $caseLess); }