Web
Web
php
/*
* webadmin.php - a simple Web-based file manager
* Copyright (C) 2004 Daniel Wacker <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* -------------------------------------------------------------------------
* While using this script, do NOT navigate with your browser's back and
* forward buttons! Always open files in a new browser tab!
* -------------------------------------------------------------------------
*
* This is Version 0.9, revision 10
* =========================================================================
*
* Changes of revision 10
* <[email protected]>
* added Russian translation
* <[email protected]>
* added </td> to achieve valid XHTML (thanks to Marc Magos)
* improved delete function
* <[email protected]>
* new list order: folders first
*
* Changes of revision 9
* <[email protected]>
* added workaround for directory listing, if lstat() is disabled
* fixed permisson of uploaded files (thanks to Stephan Duffner)
*
* Changes of revision 8
* <[email protected]>
* added Turkish translation
* <[email protected]>
* added Czech translation
* <[email protected]>
* improved charset handling
*
* Changes of revision 7
* <[email protected]>
* added Spanish translation
* <[email protected]>
* added Danish translation
* <[email protected]>
* improved rename dialog
*
* Changes of revision 6
* <[email protected]>
* added Dutch translation
*
* Changes of revision 5
* <[email protected]>
* added language auto select
* fixed symlinks in directory listing
* removed word-wrap in edit textarea
*
* Changes of revision 4
* <[email protected]>
* added French translation
* <[email protected]>
* added Swedish translation
*
* Changes of revision 3
* <[email protected]>
* improved Italian translation
*
* Changes of revision 2
* <[email protected]>
* got images work in some old browsers
* fixed creation of directories
* fixed files deletion
* improved path handling
* added missing word 'not_created'
* <[email protected]>
* improved human readability of file sizes
* <[email protected]>
* added Italian translation
*
* Changes of revision 1
* <[email protected]>
* webadmin.php completely rewritten:
* - clean XHTML/CSS output
* - several files selectable
* - support for windows servers
* - no more treeview, because
* - webadmin.php is a >simple< file manager
* - performance problems (too much additional code)
* - I don't like: frames, java-script, to reload after every treeview-click
* - execution of shell scripts
* - introduced revision numbers
*
/* ------------------------------------------------------------------------- */
/* Your language:
* 'en' - English
* 'de' - German
* 'fr' - French
* 'it' - Italian
* 'nl' - Dutch
* 'se' - Swedish
* 'sp' - Spanish
* 'dk' - Danish
* 'tr' - Turkish
* 'cs' - Czech
* 'ru' - Russian
* 'auto' - autoselect
*/
$lang = 'auto';
/* Charset of output:
* possible values are described in the charset table at
* http://www.php.net/manual/en/function.htmlentities.php
* 'auto' - use the same charset as the words of my language are encoded
*/
$site_charset = 'auto';
/* Homedir:
* For example: './' - the script's directory
*/
$homedir = './';
/* -------------------------------------------
* Optional configuration (remove # to enable)
*/
/* ------------------------------------------------------------------------- */
if (get_magic_quotes_gpc()) {
array_walk($_GET, 'strip');
array_walk($_POST, 'strip');
array_walk($_REQUEST, 'strip');
}
if (array_key_exists('image', $_GET)) {
header('Content-Type: image/gif');
die(getimage($_GET['image']));
}
if (!function_exists('lstat')) {
function lstat ($filename) {
return stat($filename);
}
}
$delim = DIRECTORY_SEPARATOR;
if (function_exists('php_uname')) {
$win = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
} else {
$win = ($delim == '\\') ? true : false;
}
if (!empty($_SERVER['PATH_TRANSLATED'])) {
$scriptdir = dirname($_SERVER['PATH_TRANSLATED']);
} elseif (!empty($_SERVER['SCRIPT_FILENAME'])) {
$scriptdir = dirname($_SERVER['SCRIPT_FILENAME']);
} elseif (function_exists('getcwd')) {
$scriptdir = getcwd();
} else {
$scriptdir = '.';
}
$homedir = relative2absolute($homedir, $scriptdir);
$directory = simplify_path(addslash($dir));
$files = array();
$action = '';
if (!empty($_POST['submit_all'])) {
$action = $_POST['action_all'];
for ($i = 0; $i < $_POST['num']; $i++) {
if (array_key_exists("checked$i", $_POST) && $_POST["checked$i"] ==
'true') {
$files[] = $_POST["file$i"];
}
}
} elseif (!empty($_REQUEST['action'])) {
$action = $_REQUEST['action'];
$files[] = relative2absolute($_REQUEST['file'], $directory);
} elseif (!empty($_POST['submit_upload']) && !empty($_FILES['upload']['name'])) {
$files[] = $_FILES['upload'];
$action = 'upload';
} elseif (array_key_exists('num', $_POST)) {
for ($i = 0; $i < $_POST['num']; $i++) {
if (array_key_exists("submit$i", $_POST)) break;
}
if ($i < $_POST['num']) {
$action = $_POST["action$i"];
$files[] = $_POST["file$i"];
}
}
if (empty($action) && (!empty($_POST['submit_create']) ||
(array_key_exists('focus', $_POST) && $_POST['focus'] == 'create')) && !
empty($_POST['create_name'])) {
$files[] = relative2absolute($_POST['create_name'], $directory);
switch ($_POST['create_type']) {
case 'directory':
$action = 'create_directory';
break;
case 'file':
$action = 'create_file';
}
}
if (sizeof($files) == 0) $action = ''; else $file = reset($files);
if ($lang == 'auto') {
if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) &&
strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2) {
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
} else {
$lang = 'en';
}
}
$words = getwords($lang);
if ($site_charset == 'auto') {
$site_charset = $word_charset;
}
$cols = ($win) ? 4 : 7;
if (!isset($dirpermission)) {
$dirpermission = (function_exists('umask')) ? (0777 & ~umask()) : 0755;
}
if (!isset($filepermission)) {
$filepermission = (function_exists('umask')) ? (0666 & ~umask()) : 0644;
}
if (!empty($_SERVER['SCRIPT_NAME'])) {
$self = html(basename($_SERVER['SCRIPT_NAME']));
} elseif (!empty($_SERVER['PHP_SELF'])) {
$self = html(basename($_SERVER['PHP_SELF']));
} else {
$self = '';
}
if (!empty($_SERVER['SERVER_SOFTWARE'])) {
if (strtolower(substr($_SERVER['SERVER_SOFTWARE'], 0, 6)) == 'apache') {
$apache = true;
} else {
$apache = false;
}
} else {
$apache = true;
}
switch ($action) {
case 'view':
if (is_script($file)) {
/* highlight_file is a mess! */
ob_start();
highlight_file($file);
$src = ereg_replace('<font color="([^"]*)">', '<span style="color:
\1">', ob_get_contents());
$src = str_replace(array('</font>', "\r", "\n"), array('</span>', '',
''), $src);
ob_end_clean();
html_header();
echo '<h2 style="text-align: left; margin-bottom: 0">' . html($file) .
'</h2>
<hr />
<table>
<tr>
<td style="text-align: right; vertical-align: top; color: gray; padding-right:
3pt; border-right: 1px solid gray">
<pre style="margin-top: 0"><code>';
echo '</code></pre>
</td>
<td style="text-align: left; vertical-align: top; padding-left: 3pt">
<pre style="margin-top: 0">' . $src . '</pre>
</td>
</tr>
</table>
';
html_footer();
} else {
readfile($file);
break;
case 'download':
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Type: ' . getmimetype($file));
header('Content-Disposition: attachment; filename=' . basename($file) .
';');
header('Content-Length: ' . filesize($file));
readfile($file);
break;
case 'upload':
if (@file_exists($dest)) {
listing_page(error('already_exists', $dest));
} elseif (@move_uploaded_file($file['tmp_name'], $dest)) {
@chmod($dest, $filepermission);
listing_page(notice('uploaded', $file['name']));
} else {
listing_page(error('not_uploaded', $file['name']));
}
break;
case 'create_directory':
if (@file_exists($file)) {
listing_page(error('already_exists', $file));
} else {
$old = @umask(0777 & ~$dirpermission);
if (@mkdir($file, $dirpermission)) {
listing_page(notice('created', $file));
} else {
listing_page(error('not_created', $file));
}
@umask($old);
}
break;
case 'create_file':
if (@file_exists($file)) {
listing_page(error('already_exists', $file));
} else {
$old = @umask(0777 & ~$filepermission);
if (@touch($file)) {
edit($file);
} else {
listing_page(error('not_created', $file));
}
@umask($old);
}
break;
case 'execute':
chdir(dirname($file));
$output = array();
$retval = 0;
exec('echo "./' . basename($file) . '" | /bin/sh', $output, $retval);
if ($error) {
listing_page(error('not_executed', $file, implode("\n", $output)));
} else {
listing_page(notice('executed', $file, implode("\n", $output)));
}
break;
case 'delete':
if (!empty($_POST['no'])) {
listing_page();
} elseif (!empty($_POST['yes'])) {
$failure = array();
$success = array();
$message = '';
if (sizeof($failure) > 0) {
$message = error('not_deleted', implode("\n", $failure));
}
if (sizeof($success) > 0) {
$message .= notice('deleted', implode("\n", $success));
}
listing_page($message);
} else {
html_header();
request_dump();
';
html_footer();
break;
case 'rename':
if (!empty($_POST['destination'])) {
} else {
$name = basename($file);
html_header();
<table class="dialog">
<tr>
<td class="dialog">
<input type="hidden" name="action" value="rename" />
<input type="hidden" name="file" value="' . html($file) . '" />
<input type="hidden" name="dir" value="' . html($directory) . '" />
<b>' . word('rename_file') . '</b>
<p>' . html($file) . '</p>
<b>' . substr($file, 0, strlen($file) - strlen($name)) . '</b>
<input type="text" name="destination" size="' . textfieldsize($name) . '"
value="' . html($name) . '" />
<hr />
<input type="submit" value="' . word('rename') . '" />
</td>
</tr>
</table>
</form>
';
html_footer();
break;
case 'move':
if (!empty($_POST['destination'])) {
$failure = array();
$success = array();
$message = '';
if (sizeof($failure) > 0) {
$message = error('not_moved', implode("\n", $failure), $dest);
}
if (sizeof($success) > 0) {
$message .= notice('moved', implode("\n", $success), $dest);
}
listing_page($message);
} else {
html_header();
<table class="dialog">
<tr>
<td class="dialog">
';
request_dump();
</form>
';
html_footer();
break;
case 'copy':
if (!empty($_POST['destination'])) {
if (@is_dir($dest)) {
$failure = array();
$success = array();
$message = '';
if (sizeof($failure) > 0) {
$message = error('not_copied', implode("\n", $failure),
$dest);
}
if (sizeof($success) > 0) {
$message .= notice('copied', implode("\n", $success),
$dest);
}
listing_page($message);
} else {
} else {
html_header();
<table class="dialog">
<tr>
<td class="dialog">
';
request_dump();
</form>
';
html_footer();
break;
case 'create_symlink':
if (!empty($_POST['destination'])) {
$dest = relative2absolute($_POST['destination'], $directory);
if (!empty($_POST['relative'])) $file =
absolute2relative(addslash(dirname($dest)), $file);
} else {
html_header();
</form>
';
html_footer();
break;
case 'edit':
if (!empty($_POST['save'])) {
$content = str_replace("\r\n", "\n", $_POST['content']);
} else {
break;
case 'permission':
if (!empty($_POST['set'])) {
$mode = 0;
if (!empty($_POST['ur'])) $mode |= 0400; if (!empty($_POST['uw']))
$mode |= 0200; if (!empty($_POST['ux'])) $mode |= 0100;
if (!empty($_POST['gr'])) $mode |= 0040; if (!empty($_POST['gw']))
$mode |= 0020; if (!empty($_POST['gx'])) $mode |= 0010;
if (!empty($_POST['or'])) $mode |= 0004; if (!empty($_POST['ow']))
$mode |= 0002; if (!empty($_POST['ox'])) $mode |= 0001;
if (@chmod($file, $mode)) {
listing_page(notice('permission_set', $file, decoct($mode)));
} else {
listing_page(error('permission_not_set', $file, decoct($mode)));
}
} else {
html_header();
$mode = fileperms($file);
<table class="dialog">
<tr>
<td class="dialog">
<hr />
<table id="permission">
<tr>
<td></td>
<td style="border-right: 1px solid black">' . word('owner') . '</td>
<td style="border-right: 1px solid black">' . word('group') . '</td>
<td>' . word('other') . '</td>
</tr>
<tr>
<td style="text-align: right">' . word('read') . ':</td>
<td><input type="checkbox" name="ur" value="1"'; if ($mode & 00400)
echo ' checked="checked"'; echo ' /></td>
<td><input type="checkbox" name="gr" value="1"'; if ($mode & 00040)
echo ' checked="checked"'; echo ' /></td>
<td><input type="checkbox" name="or" value="1"'; if ($mode & 00004)
echo ' checked="checked"'; echo ' /></td>
</tr>
<tr>
<td style="text-align: right">' . word('write') . ':</td>
<td><input type="checkbox" name="uw" value="1"'; if ($mode & 00200)
echo ' checked="checked"'; echo ' /></td>
<td><input type="checkbox" name="gw" value="1"'; if ($mode & 00020)
echo ' checked="checked"'; echo ' /></td>
<td><input type="checkbox" name="ow" value="1"'; if ($mode & 00002)
echo ' checked="checked"'; echo ' /></td>
</tr>
<tr>
<td style="text-align: right">' . word('execute') . ':</td>
<td><input type="checkbox" name="ux" value="1"'; if ($mode & 00100)
echo ' checked="checked"'; echo ' /></td>
<td><input type="checkbox" name="gx" value="1"'; if ($mode & 00010)
echo ' checked="checked"'; echo ' /></td>
<td><input type="checkbox" name="ox" value="1"'; if ($mode & 00001)
echo ' checked="checked"'; echo ' /></td>
</tr>
</table>
<hr />
</td>
</tr>
</table>
</form>
';
html_footer();
break;
default:
listing_page();
/* ------------------------------------------------------------------------- */
if ($d = @opendir($directory)) {
if ($stat = @lstat($path)) {
$file = array(
'filename' => $filename,
'path' => $path,
'is_file' => @is_file($path),
'is_dir' => @is_dir($path),
'is_link' => @is_link($path),
'is_readable' => @is_readable($path),
'is_writable' => @is_writable($path),
'size' => $stat['size'],
'permission' => $stat['mode'],
'owner' => $stat['uid'],
'group' => $stat['gid'],
'mtime' => @filemtime($path),
'atime' => @fileatime($path),
'ctime' => @filectime($path)
);
if ($file['is_dir']) {
$file['is_executable'] = @file_exists($path . $delim
. '.');
} else {
if (!$win) {
$file['is_executable'] = @is_executable($path);
} else {
$file['is_executable'] = true;
}
}
if (function_exists('posix_getpwuid')) $file['owner_name']
= @reset(posix_getpwuid($file['owner']));
if (function_exists('posix_getgrgid')) $file['group_name']
= @reset(posix_getgrgid($file['group']));
$files[] = $file;
}
}
return $files;
} else {
return false;
}
$dirs = array();
$files = array();
$l = $first;
$r = $last;
$tmp = $array[$l];
$array[$l] = $array[$r];
$array[$r] = $tmp;
$l++;
$r--;
}
quicksort($array, $first, $r, $key);
quicksort($array, $l, $last, $key);
// return 'application/octet-stream';
return 'text/plain';
$success = false;
if (@rmdir($file)) {
$success = true;
$success = true;
return $success;
return @unlink($file);
if (path_is_relative($string)) {
return simplify_path(addslash($directory) . $string);
} else {
return simplify_path($string);
}
if ($win) {
return (substr($path, 1, 1) != ':');
} else {
return (substr($path, 0, 1) != '/');
}
$path = '';
while ($directory != $target) {
if ($directory == substr($target, 0, strlen($directory))) {
$path .= substr($target, strlen($directory));
break;
} else {
$path .= '..' . $delim;
$directory = substr($directory, 0, strrpos(substr($directory, 0,
-1), $delim) + 1);
}
}
if ($path == '') $path = '.';
return $path;
if (@is_dir($path)) {
$path = addslash($path);
}
$e = addslashes($delim);
$regex = $e . '((\.[^\.' . $e . '][^' . $e . ']*)|(\.\.[^' . $e . ']+)|
([^\.][^' . $e . ']*))' . $e . '\.\.' . $e;
return $path;
$suffices = 'kMGTPE';
$n = 0;
while ($filesize >= 1000) {
$filesize /= 1024;
$n++;
}
/* ------------------------------------------------------------------------- */
function listing_page ($message = null) {
global $self, $directory, $sort, $reverse;
html_header();
$list = getlist($directory);
<table id="main">
';
directory_choice();
if (!empty($message)) {
spacer();
echo $message;
}
if (@is_writable($directory)) {
upload_box();
create_box();
} else {
spacer();
}
if ($list) {
listing($list);
} else {
echo error('not_readable', $directory);
}
echo '</table>
</form>
';
html_footer();
if (!$win) {
column_title('permission', $sort, $reverse);
column_title('owner', $sort, $reverse);
column_title('group', $sort, $reverse);
}
if ($file['is_link']) {
if (@is_readable($real_file)) {
if (@is_dir($real_file)) {
echo '[ <a href="' . $self . '?dir=' .
urlencode($real_file) . '">' . html($file['target']) . '</a> ]';
} else {
echo '<a href="' . $self . '?action=view&file=' .
urlencode($real_file) . '">' . html($file['target']) . '</a>';
}
} else {
echo html($file['target']);
}
} elseif ($file['is_dir']) {
} else {
if (substr($file['filename'], 0, 1) == '.') {
echo '<img src="' . $self . '?image=hidden_file"
alt="hidden file" /> ';
} else {
echo '<img src="' . $self . '?image=file" alt="file" /> ';
}
echo "</td>\n";
if (!$win) {
echo "</td>\n";
if (array_key_exists('owner_name', $file)) {
echo "\t<td class=\"owner\" title=\"uid:
{$file['owner']}\">{$file['owner_name']}</td>\n";
} else {
echo "\t<td class=\"owner\">{$file['owner']}</td>\n";
}
if (array_key_exists('group_name', $file)) {
echo "\t<td class=\"group\" title=\"gid:
{$file['group']}\">{$file['group_name']}</td>\n";
} else {
echo "\t<td class=\"group\">{$file['group']}</td>\n";
}
$actions = array();
if (function_exists('symlink')) {
$actions[] = 'create_symlink';
}
if (@is_writable(dirname($file['path']))) {
$actions[] = 'delete';
$actions[] = 'rename';
$actions[] = 'move';
}
if ($file['is_file'] && $file['is_readable']) {
$actions[] = 'copy';
$actions[] = 'download';
if ($file['is_writable']) $actions[] = 'edit';
}
if (!$win && function_exists('exec') && $file['is_file'] &&
$file['is_executable'] && file_exists('/bin/sh')) {
$actions[] = 'execute';
}
if (sizeof($actions) > 0) {
$actions = array();
if (@is_writable(dirname($file['path']))) {
$actions[] = 'delete';
$actions[] = 'move';
}
$actions[] = 'copy';
if ($sort == $column) {
if (!$reverse) {
$r = '&reverse=true';
$arr = ' ∧';
} else {
$arr = ' ∨';
}
} else {
$r = '';
}
echo "\t<th class=\"$column\"><a href=\"$self?{$d}sort=$column$r\">" .
word($column) . "</a>$arr</th>\n";
function directory_choice () {
global $directory, $homedir, $cols, $self;
echo '<tr>
<td colspan="' . $cols . '" id="directory">
<a href="' . $self . '?dir=' . urlencode($homedir) . '">' .
word('directory') . '</a>:
<input type="text" name="dir" size="' . textfieldsize($directory) . '"
value="' . html($directory) . '" onfocus="activate(\'directory\')" />
<input type="submit" name="changedir" value="' . word('change') . '"
onfocus="activate(\'directory\')" />
</td>
</tr>
';
}
function upload_box () {
global $cols;
echo '<tr>
<td colspan="' . $cols . '" id="upload">
' . word('file') . ':
<input type="file" name="upload" onfocus="activate(\'other\')" />
<input type="submit" name="submit_upload" value="' . word('upload') .
'" onfocus="activate(\'other\')" />
</td>
</tr>
';
function create_box () {
global $cols;
echo '<tr>
<td colspan="' . $cols . '" id="create">
<select name="create_type" size="1" onfocus="activate(\'create\')">
<option value="file">' . word('file') . '</option>
<option value="directory">' . word('directory') . '</option>
</select>
<input type="text" name="create_name" onfocus="activate(\'create\')" />
<input type="submit" name="submit_create" value="' . word('create') .
'" onfocus="activate(\'create\')" />
</td>
</tr>
';
html_header();
<table class="dialog">
<tr>
<td class="dialog">
if (array_key_exists('content', $_POST)) {
echo $_POST['content'];
} else {
$f = fopen($file, 'r');
while (!feof($f)) {
echo html(fread($f, 8192));
}
fclose($f);
}
if (!empty($_POST['user'])) {
echo "\n" . $_POST['user'] . ':' . crypt($_POST['password']);
}
if (!empty($_POST['basic_auth'])) {
if ($win) {
$authfile = str_replace('\\', '/', $directory) . $htpasswd;
} else {
$authfile = $directory . $htpasswd;
}
echo "\nAuthType Basic\nAuthName "Restricted Directory"\n";
echo 'AuthUserFile "' . html($authfile) . ""\n";
echo 'Require valid-user';
}
echo '</textarea>
<hr />
';
<hr />
';
<hr />
';
echo '
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="file" value="' . html($file) . '" />
<input type="hidden" name="dir" value="' . html($directory) . '" />
<input type="reset" value="' . word('reset') . '" id="red_button" />
<input type="submit" name="save" value="' . word('save') . '"
id="green_button" style="margin-left: 50px" />
</td>
</tr>
</table>
';
html_footer();
function spacer () {
global $cols;
echo '<tr>
<td colspan="' . $cols . '" style="height: 1em"></td>
</tr>
';
$size = strlen($content) + 5;
if ($size < 30) $size = 30;
return $size;
function request_dump () {
/* ------------------------------------------------------------------------- */
switch ($lang) {
case 'de':
return array(
'directory' => 'Verzeichnis',
'file' => 'Datei',
'filename' => 'Dateiname',
case 'fr':
return array(
'directory' => 'R?pertoire',
'file' => 'Fichier',
'filename' => 'Nom fichier',
return array(
'directory' => 'Directory',
'file' => 'File',
'filename' => 'Nome File',
case 'nl':
return array(
'directory' => 'Directory',
'file' => 'Bestand',
'filename' => 'Bestandsnaam',
case 'se':
return array(
'directory' => 'Mapp',
'file' => 'Fil',
'filename' => 'Filnamn',
case 'sp':
return array(
'directory' => 'Directorio',
'file' => 'Archivo',
'filename' => 'Nombre Archivo',
case 'dk':
return array(
'directory' => 'Mappe',
'file' => 'Fil',
'filename' => 'Filnavn',
case 'tr':
return array(
'directory' => 'Klas?r',
'file' => 'Dosya',
'filename' => 'dosya adi',
case 'cs':
return array(
'directory' => 'Adres�r',
'file' => 'Soubor',
'filename' => 'Jm�no souboru',
case 'ru':
return array(
'directory' => '???????',
'file' => '????',
'filename' => '??? ?????',
case 'en':
default:
return array(
'directory' => 'Directory',
'file' => 'File',
'filename' => 'Filename',
function html_header () {
global $site_charset;
echo <<<END
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>webadmin.php</title>
<style type="text/css">
body { font: small sans-serif; text-align: center }
img { width: 17px; height: 13px }
a, a:visited { text-decoration: none; color: navy }
hr { border-style: none; height: 1px; background-color: silver; color: silver }
#main { margin-top: 6pt; margin-left: auto; margin-right: auto; border-spacing:
1px }
#main th { background: #eee; padding: 3pt 3pt 0pt 3pt }
.listing th, .listing td { padding: 1px 3pt 0 3pt }
.listing th { border: 1px solid silver }
.listing td { border: 1px solid #ddd; background: white }
.listing .checkbox { text-align: center }
.listing .filename { text-align: left }
.listing .size { text-align: right }
.listing th.permission { text-align: left }
.listing td.permission { font-family: monospace }
.listing .owner { text-align: left }
.listing .group { text-align: left }
.listing .functions { text-align: left }
.listing_footer td { background: #eee; border: 1px solid silver }
#directory, #upload, #create, .listing_footer td, #error td, #notice td { text-
align: left; padding: 3pt }
#directory { background: #eee; border: 1px solid silver }
#upload { padding-top: 1em }
#create { padding-bottom: 1em }
.small, .small option { font-size: x-small }
textarea { border: none; background: white }
table.dialog { margin-left: auto; margin-right: auto }
td.dialog { background: #eee; padding: 1ex; border: 1px solid silver; text-align:
center }
#permission { margin-left: auto; margin-right: auto }
#permission td { padding-left: 3pt; padding-right: 3pt; text-align: center }
td.permission_action { text-align: right }
#symlink { background: #eee; border: 1px solid silver }
#symlink td { text-align: left; padding: 3pt }
#red_button { width: 120px; color: #400 }
#green_button { width: 120px; color: #040 }
#error td { background: maroon; color: white; border: 1px solid silver }
#notice td { background: green; color: white; border: 1px solid silver }
#notice pre, #error pre { background: silver; color: black; padding: 1ex; margin-
left: 1ex; margin-right: 1ex }
code { font-size: 12pt }
td { white-space: nowrap }
</style>
<script type="text/javascript">
<!--
function activate (name) {
if (document && document.forms[0] && document.forms[0].elements['focus']) {
document.forms[0].elements['focus'].value = name;
}
}
//-->
</script>
</head>
<body>
END;
function html_footer () {
echo <<<END
</body>
</html>
END;
$args = func_get_args();
array_shift($args);
$args = func_get_args();
array_shift($args);
?>