|
From: <kr...@us...> - 2007-04-18 18:38:11
|
Revision: 854
http://svn.sourceforge.net/astlinux/?rev=854&view=rev
Author: krisk84
Date: 2007-04-18 11:38:03 -0700 (Wed, 18 Apr 2007)
Log Message:
-----------
make minihttpd use a directory for webroot, not a tar archive
Modified Paths:
--------------
trunk/package/minihttpd/minihttpd.mk
Added Paths:
-----------
trunk/package/minihttpd/www/
trunk/package/minihttpd/www/admin/
trunk/package/minihttpd/www/admin/.htpasswd
trunk/package/minihttpd/www/admin/about.php
trunk/package/minihttpd/www/admin/asterisk.php
trunk/package/minihttpd/www/admin/backup.php
trunk/package/minihttpd/www/admin/credits.php
trunk/package/minihttpd/www/admin/default.css
trunk/package/minihttpd/www/admin/dir.php
trunk/package/minihttpd/www/admin/dirphp_class.php
trunk/package/minihttpd/www/admin/exec.php
trunk/package/minihttpd/www/admin/footer.php
trunk/package/minihttpd/www/admin/general.php
trunk/package/minihttpd/www/admin/graphics/
trunk/package/minihttpd/www/admin/graphics/blank.gif
trunk/package/minihttpd/www/admin/graphics/box-bottomleft.gif
trunk/package/minihttpd/www/admin/graphics/box-bottomright.gif
trunk/package/minihttpd/www/admin/graphics/box-left.gif
trunk/package/minihttpd/www/admin/graphics/box-right.gif
trunk/package/minihttpd/www/admin/graphics/box-topright.gif
trunk/package/minihttpd/www/admin/graphics/logo.jpg
trunk/package/minihttpd/www/admin/header.php
trunk/package/minihttpd/www/admin/index.php
trunk/package/minihttpd/www/admin/log.php
trunk/package/minihttpd/www/admin/network.php
trunk/package/minihttpd/www/admin/password.php
trunk/package/minihttpd/www/admin/phpinfo.php
trunk/package/minihttpd/www/index.html
Removed Paths:
-------------
trunk/package/minihttpd/www.tar.gz
Modified: trunk/package/minihttpd/minihttpd.mk
===================================================================
--- trunk/package/minihttpd/minihttpd.mk 2007-04-18 18:30:56 UTC (rev 853)
+++ trunk/package/minihttpd/minihttpd.mk 2007-04-18 18:38:03 UTC (rev 854)
@@ -33,7 +33,7 @@
$(INSTALL) -D $(MINIHTTPD_DIR)/$(MINIHTTPD_BINARY) $(TARGET_DIR)/usr/$(MINIHTTPD_TARGET_BINARY)
$(INSTALL) -D $(MINIHTTPD_DIR)/htpasswd $(TARGET_DIR)/usr/bin/htpasswd
mkdir -p $(TARGET_DIR)/stat/var
- $(MINIHTTPD_CAT) package/minihttpd/www.tar.gz | tar -C $(TARGET_DIR)/stat/var $(TAR_OPTIONS) -
+ cp -a package/minihttpd/www $(TARGET_DIR)/stat/var/
$(INSTALL) -D -m 0755 package/minihttpd/mini_httpd.init $(TARGET_DIR)/etc/init.d/mini_httpd
ln -sf /tmp/etc/mini_httpd.conf $(TARGET_DIR)/etc/mini_httpd.conf
Added: trunk/package/minihttpd/www/admin/.htpasswd
===================================================================
--- trunk/package/minihttpd/www/admin/.htpasswd (rev 0)
+++ trunk/package/minihttpd/www/admin/.htpasswd 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1 @@
+admin:6kERs0/UltqFI
Property changes on: trunk/package/minihttpd/www/admin/.htpasswd
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/about.php
===================================================================
--- trunk/package/minihttpd/www/admin/about.php (rev 0)
+++ trunk/package/minihttpd/www/admin/about.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,60 @@
+<?php include "header.php"; ?>
+
+AstLinux was originally created by Kristian Kielhofner. Over the years
+contributors from all over the world have worked together to make AstLinux
+what it is today. Please check the credits page for more information and
+thank you for using AstLinux!<BR>
+<BR>
+For support, please join the AstLinux-Users mailing list at
+<a href="http://sourceforge.net/mail/?group_id=170462">SourceForge.net.</a>
+<BR><BR>
+<?php
+ echo "<table border=0 width=100%><tr><td align=center>";
+
+ box_header(100, "AstLinux");
+ echo "<center>";
+
+ system("cat /etc/astlinux-release");
+
+ echo "</center><BR>";
+ box_footer();
+
+ echo "</td><td align=center>";
+
+ box_header(200, "Linux Kernel");
+ echo "<center>";
+
+ system("uname -a");
+
+ echo "</center><BR>";
+ box_footer();
+
+ echo "</td><td align=center>";
+
+ box_header(150, "Asterisk");
+ echo "<center>";
+
+ system("/usr/sbin/asterisk -V");
+
+ echo "</center><BR>";
+ box_footer();
+
+ echo "</td></tr></table>";
+
+?>
+
+<br>
+
+If you find AstLinux useful, please consider making a donation. <br>
+I work very hard on making AstLinux all that it can be, and compensation never hurts :) <br>
+<br>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
+<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----">
+</form>
+
+<?php include "footer.php"; ?>
+
+
+
Property changes on: trunk/package/minihttpd/www/admin/about.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/asterisk.php
===================================================================
--- trunk/package/minihttpd/www/admin/asterisk.php (rev 0)
+++ trunk/package/minihttpd/www/admin/asterisk.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,65 @@
+<?php
+
+include "header.php";
+
+// Function: is Blank
+// Returns true or false depending on blankness of argument.
+
+function isBlank( $arg ) { return ereg( "^\s*$", $arg ); }
+
+?>
+
+<form action="<?=$HTTP_SERVER_VARS['SCRIPT_NAME']; ?>" method="POST" enctype="multipart/form-data" name="frmExecPlus">
+ <table>
+ <tr>
+ <td class="label" align="right">Command:</td>
+ <td class="type"><input name="txtCommand" type="text" size="70" value="<?=htmlspecialchars($_POST['txtCommand']);?>"></td>
+ </tr>
+ <tr>
+ <td valign="top"> </td>
+ <td valign="top" class="label">
+ <input type="submit" class="button" value="Execute">
+ </td>
+ </tr>
+ <tr>
+ <td height="8"></td>
+ <td></td>
+ </tr>
+ </table>
+</form>
+
+<p>
+<?php if (isBlank($_POST['txtCommand'])): ?>
+</p>
+<?php endif; ?>
+<?php if ($ulmsg) echo "<p><strong>" . $ulmsg . "</strong></p>\n"; ?>
+<?php
+
+if (!isBlank($_POST['txtCommand']))
+ {
+ echo "<pre>";
+ putenv("TERM=vt100");
+ putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
+ putenv("SCRIPT_FILENAME=" . strtok(stripslashes($_POST['txtCommand']), " ")); /* PHP scripts */
+ $ph = popen(stripslashes("asterisk -rx \"" . $_POST['txtCommand'] . "\""), "r" );
+ while ($line = fgets($ph))
+ echo htmlspecialchars($line);
+ pclose($ph);
+ echo "</pre>";
+ }
+
+?>
+
+<?php
+include "footer.php";
+?>
+
+
+
+
+
+
+
+
+
+
Property changes on: trunk/package/minihttpd/www/admin/asterisk.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/backup.php
===================================================================
--- trunk/package/minihttpd/www/admin/backup.php (rev 0)
+++ trunk/package/minihttpd/www/admin/backup.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,19 @@
+<?php
+
+@system("/usr/sbin/astback /tmp/backup.tar.gz", $result);
+if ($result != 0)
+ {
+ include "header.php";
+ echo "<center><font color=red>Unable to create backup file.</font></center><BR>";
+ include "footer.php";
+ }
+else
+ {
+ header('Content-type: application/binary');
+ header('Content-Disposition: attachment; filename="backup.tar.gz"');
+ $fp = @fopen("/tmp/backup.tar.gz","rb");
+ fpassthru($fp);
+ fclose($fp);
+ }
+@system("rm /tmp/backup.tar.gz", $result);
+?>
Property changes on: trunk/package/minihttpd/www/admin/backup.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/credits.php
===================================================================
--- trunk/package/minihttpd/www/admin/credits.php (rev 0)
+++ trunk/package/minihttpd/www/admin/credits.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,31 @@
+<?php include "header.php"; ?>
+
+AstLinux would not be possible without the many contributions of the following
+software projects: <br>
+<br>
+- <a href="http://www.kernel.org/">Linux kernel</a><br>
+- <a href="http://www.asterisk.org/">Asterisk</a><br>
+- <a href="http://www.acme.com/software/mini_httpd/">mini_httpd</a><br>
+- <a href="http://www.openssh.org/">openssh</a><br>
+- <a href="http://vsftpd.beasts.org/">vsftpd</a><br>
+- <a href="http://www.busybox.net/">busybox</a><br>
+- <a href="http://www.php.net/">php</a><br>
+- <a href="http://www.pengutronix.de/software/ptxdist_en.html">PTXDist</a><br>
+- <a href="http://www.m0n0.ch/wall/">m0n0wall</a><br>
+- and many, many more...<br><br>
+
+PHP Interface, AstLinux Logo:<br>
+- <a href="http://www.analogx.com/">Mark Thompson</a><br><br>
+
+Hardware:<br>
+- <a href="http://www.digium.com/">Digium</a><br>
+- <a href="http://www.sangoma.com/">Sangoma</a><br>
+- <a href="http://www.pikatechnologies.com/">Pika Technologies</a><br>
+- <a href="http://www.rhinoequipment.com/">Rhino Equipment</a><br>
+- Jon Bebeau<br>
+- David Davies<br><br>
+
+<?php include "footer.php"; ?>
+
+
+
Property changes on: trunk/package/minihttpd/www/admin/credits.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/default.css
===================================================================
--- trunk/package/minihttpd/www/admin/default.css (rev 0)
+++ trunk/package/minihttpd/www/admin/default.css 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,132 @@
+div.astlinux
+{
+ color: #000000;
+ font-weight: normal;
+ font-size: 12px;
+ font-family: Verdana, Arial, Helvetica;
+ text-decoration: none;
+ letter-spacing: 0px
+}
+
+.astlinux a:link , .astlinux a:visited , .astlinux a:active
+{
+ text-decoration: none;
+ color: #0000FF;
+}
+
+.astlinux a:hover
+{
+ text-decoration: underline;
+}
+
+.astlinux a:link .directory , .astlinux a:visited .directory , .astlinux a:active .directory
+{
+ text-decoration: none;
+ color: #006600;
+}
+
+.astlinux a:hover .directory
+{
+ text-decoration: underline;
+ color: #006600;
+}
+
+.astlinux a:link .dir-view , .astlinux a:visited .dir-view , .astlinux a:active .dir-view
+{
+ color: #000000;
+}
+
+.astlinux a:hover .dir-view
+{
+ color: #009900;
+}
+
+.astlinux td.file
+{
+ padding: 1px;
+ border-bottom: 1px
+ dashed #CCCCCC;
+}
+
+.astlinux span.dir-view
+{
+ height: 18px;
+ width: 20px;
+ background-color: #99FFCC;
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-top: 2px;
+ padding-bottom: 3px;
+ font-size: 10px;
+ text-decoration: none;
+}
+
+.astlinux .error_msg
+{
+ color: #FF0000;
+}
+
+.astlinux tr.header
+{
+ background-color: #EEEEEE;
+ font-weight: bold;
+}
+
+.astlinux td.file-property
+{
+ text-align: right;
+ padding-right: 5px;
+ padding: 1px;
+ border-bottom: 1px dashed #CCCCCC;
+}
+
+.astlinux td.file-options
+{
+ text-align: center;
+ padding-right: 5px;
+ padding: 1px;
+ border-bottom: 1px dashed #CCCCCC;
+ background-color: #F6F6F6;
+}
+
+input
+{
+ font-family: courier new, courier;
+ font-weight: normal;
+ font-size: 9pt;
+}
+
+pre
+{
+ border: 1px solid #435370;
+ background: #F3F3F3;
+ padding: 1em;
+ font-family: courier new, courier;
+ white-space: pre;
+ line-height: 10pt;
+ font-size: 10pt;
+}
+
+.label
+{
+ font-size: 11px;
+ font-weight: bold;
+}
+
+.button
+{
+ font-weight: bold;
+ font-size: 11px;
+}
+
+body,td
+{
+ color: #000000;
+ font-weight: normal;
+ font-size: 12px;
+ font-family: Verdana, Arial, Helvetica;
+ text-decoration: none;
+ letter-spacing: 0px
+}
+
+
Property changes on: trunk/package/minihttpd/www/admin/default.css
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/dir.php
===================================================================
--- trunk/package/minihttpd/www/admin/dir.php (rev 0)
+++ trunk/package/minihttpd/www/admin/dir.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,12 @@
+<?php
+
+require("dirphp_class.php");
+
+// CREATE AN INSTANCE OF DirPHP TO WORK WITH.
+$dirphp = new DirPHP("m/d/y", $header, $footer);
+
+// THIS FUNCTION DOES ALL THE WORK
+$dirphp->handle_events();
+
+?>
+
Property changes on: trunk/package/minihttpd/www/admin/dir.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/dirphp_class.php
===================================================================
--- trunk/package/minihttpd/www/admin/dirphp_class.php (rev 0)
+++ trunk/package/minihttpd/www/admin/dirphp_class.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,257 @@
+<?php
+/************************************************************ GENERAL INFO ***\
+| DirPHP version 1.0 |
+| Created by Stuart Montgomery as a simple solution for |
+| easy directory printing and uploading. |
+|*****************************************************************************|
+| Copyright 2004 Stuart Montgomery |
+| GNU General Public License notice: |
+| |
+| 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+| |
+| Place this file on any PHP capable server to view its containing |
+| directory's contents and upload to it (if allowed by server). There |
+| are several configurable options to control all functions of the script |
+| to customize it to your needs. The script is written as a PHP class |
+| and should be called from another PHP file. Refer to the documentation |
+| (dirphp_readme.htm) for installation and configuration instructions. |
+| |
+| http://scripts.ensitehosting.com/ |
+| st...@en... |
+\*****************************************************************************/
+
+class DirPHP {
+
+ var $version;
+ var $dir;
+ var $use_dir;
+ var $parent_dir;
+ var $date_format;
+ var $msg;
+
+ function DirPHP($date_format, $time_limit = 300)
+ {
+ $this->version = "1.0";
+ $this->date_format = $date_format;
+ $use_dir = $this->find_use_dir();
+ error_reporting(E_ALL ^ E_NOTICE); // Turn of annoying error notices (comment-out line for debugging)
+ set_time_limit($time_limit);
+ if ($use_dir == FALSE) {
+ $this->dir = opendir(".");
+ $this->use_dir = "";
+ } else {
+ $this->dir = opendir($use_dir);
+ $this->use_dir = $use_dir;
+ }
+ array_pop($dirtree = explode("/", $this->use_dir));
+ $num_levels = count($dirtree) - 1;
+ $this->parent_dir = "?dir=";
+ for ($i = 0; $i < $num_levels; $i++) {
+ $this->parent_dir .= $dirtree[$i]."/";
+ }
+ if ($this->parent_dir == "?dir=") $this->parent_dir = "";
+ } // End of DirPHP function (class constructor)
+
+ function display_header()
+ {
+ include "header.php";
+ $header = "Current Path: <B>" . $this->find_use_dir() . "</B><br><BR>";
+
+ // For editing file page
+ if (isset($_GET['edit']) && is_file($_GET['edit'])) {
+ $header .= "\xA0\xA0\xA0\xA0\xA0<span style=\"font-style: italic; color: green\">Editing:</span>\xA0" . $_GET['edit'] . "</a> \xA0\xA0\xA0\xA0\xA0<a href=\"" . $_SERVER['PHP_SELF'];
+ if (isset($_GET['dir']))
+ $header .= "?dir=" . $_GET['dir'];
+ $header .= "\">< Return to directory</a>";
+ }
+ $header .= "\n";
+ echo $header;
+ }
+
+ function display_footer()
+ {
+ include "footer.php";
+ }
+
+ function find_use_dir()
+ {
+ if (isset($_GET['dir'])) $use_dir = $_GET['dir'];
+ if (isset($_POST['dir'])) $use_dir = $_POST['dir'];
+ if (!isset($use_dir)) {
+ $use_dir = FALSE;
+ }
+ return $use_dir;
+ }
+
+ function display_dir()
+ {
+ echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
+ echo "<tr class=\"header\"><td class=\"file\" style=\"padding: 2px\">File</td><td width=\"90\" class=\"file-property\">Size</td><td width=\"78\" class=\"file-property\">Modified</td></tr>\n";
+ // Show parent directory link, if applicable
+ if ($this->use_dir != "")
+ echo "<tr height=\"24\"><td colspan=\"3\" class=\"file\" align=\"left\"><a href=\"" .$_SERVER['PHP_SELF'] . $this->parent_dir . "\"><span class=\"directory\">> .. (parent)</span></a></td></tr>";
+ // Show error message
+ $this->show_msg();
+ // Begin directory read loop
+ while (($file = readdir($this->dir)) != FALSE) {
+ $filename = $file; // $filename will be unedited, while $file will have $use_dir tacked onto the front of it
+ $file = $this->use_dir . $file;
+ if ($filename == "." || $filename == "..") continue; // Ignore self and parent directory links (first two entries in each directory)
+ $fsize = $this->file_property("size", $file);
+ $fmtime = $this->file_property("modified", $file);
+ // Check if it's a directory or not
+ if (is_dir($file)) {
+ $dir_files[$filename] = "<tr><td class=\"file\"><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $file . "/\"><span class=\"directory\">> " . $filename . "/</span></a></td><td class=\"file\">\xA0</td><td class=\"file\">\xA0</td></tr>\n";
+ // Check if it's a php file
+ }
+ else
+ {
+ $non_dir_files[$filename] = "<tr style=\"border-top: 1px solid #000000\"><td class=\"file\"><a href=\"" . $_SERVER['PHP_SELF'] . "?edit=" . $file;
+ if ($this->use_dir != "")
+ $non_dir_files[$filename] .= "&dir=" . $this->use_dir;
+ $non_dir_files[$filename] .= "\" title=\"Edit " . $file . "\">" . $filename . "</a></td><td class=\"file-property\">" . $fsize . "</td><td class=\"file-property\">" . $fmtime . "</td></tr>\n";
+ }
+ }
+ // Sort the arrays alphabetically and output them
+ if (isset($dir_files)) {
+ ksort($dir_files);
+ foreach ($dir_files as $value) echo $value;
+ }
+ if (isset($non_dir_files)) {
+ ksort($non_dir_files);
+ foreach ($non_dir_files as $value) echo $value;
+ }
+ echo "</table>\n";
+
+ closedir($this->dir);
+ } // End of display_dir function
+
+ function cleanup_text_file($file)
+ {
+ // chr(13) = CR (carridge return) = Macintosh
+ // chr(10) = LF (line feed) = Unix
+ // Win line break = CRLF
+ $new_file = '';
+ $old_file = '';
+ $fcontents = file($file);
+ while (list ($line_num, $line) = each($fcontents))
+ {
+ $old_file .= $line;
+ $new_file .= str_replace(chr(13), chr(10), $line);
+ }
+ if ($old_file != $new_file)
+ {
+ // Open the uploaded file, and re-write it with the new changes
+ $fp = fopen($file, "w");
+ fwrite($fp, $new_file);
+ fclose($fp);
+ }
+ }
+
+
+ function edit_file($file, $change_file = 0, $newfile = 0)
+ {
+ if ($change_file == 1) {
+ $fp = fopen($file, "w");
+ $newfile = stripslashes($newfile);
+ $newfile = str_replace(chr(13), '', $newfile);
+
+ if (fwrite($fp, $newfile))
+ $this->msg = "File <u>" . $filename . "</u> successfully edited.";
+ fclose($fp);
+ } else {
+ if (is_writable($file)) {
+ $ret = "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"POST\">\n";
+ $ret .= "<p><text" . "area cols=\"80\" rows=\"30\" wrap=\"off\" name=\"newfile\">\n";
+
+ $contents = file_get_contents($file);
+ $contents = str_replace(" ", "&nbsp;", $contents); // <--- Check for non-breaking space characters and maintain them
+ $contents = str_replace(">", "&gt;", $contents);
+ $contents = str_replace("<", "&lt;", $contents);
+
+ $ret .= $contents;
+ $ret .= "</text" . "area>\n";
+ $ret .= "<p>Save As: <br><input type=\"text\" name=\"filename\" value=\"" . $file . "\">";
+ $ret .= "<input type=\"hidden\" name=\"edit\" value=\"true\">\n";
+ $ret .= "<input type=\"hidden\" name=\"dir\" value=\"" . $this->use_dir . "\">\n";
+ $ret .= "<p><input type=\"submit\" name=\"submit\" value=\"Submit Changes\">\n";
+ $ret .= "</form></p>\n";
+ } else {
+ $ret .= "<p>Cannot edit file: system permission denied.</p>\n";
+ }
+ return $ret;
+ }
+ } // End of edit_file function
+
+ function file_property($property, $file)
+ {
+ $prev_display_errors = ini_get("display_errors");
+ ini_set("display_errors", "0");
+ if ($property == "size") { // File size property
+ $size = filesize($file);
+ if ($size > 1024 && $size < 1048576) {
+ $size = round($size / 1024, 2) . " KB";
+ } elseif ($size > 1048576) {
+ $size = round($size / 1048576, 1) . " MB";
+ } elseif ($size > 1073741824) {
+ $size = round($size / 1073741824, 1) . " GB";
+ } else {
+ $size = $size . " B";
+ }
+ ini_set("display_errors", $prev_display_errors);
+
+ return $size;
+ } elseif ($property == "modified") { // Last modified date of file
+ $modtime = date($this->date_format, filemtime($file));
+ $modtime .= " ";
+ ini_set("display_errors", $prev_display_errors);
+
+ return $modtime;
+ }
+ ini_set("display_errors", $prev_display_errors);
+ } // End of file_property function
+
+ function show_msg()
+ {
+ if (isset($this->msg))
+ echo "<tr height=\"24\"><td colspan=\"3\" class=\"file\" align=\"center\"><span class=\"error_msg\">" . $this->msg . "</span></td></td><td class=\"file-options\">\xA0</td></tr>";
+ }
+
+ function handle_events()
+ {
+ // Handle normal events
+
+ $this->display_header();
+ if (isset($_GET['edit'])) {
+ echo $this->edit_file($_GET['edit']);
+ } elseif (isset($_POST['edit'], $_POST['dir'])) {
+ $this->edit_file($_POST['filename'], 1, $_POST['newfile']);
+ $this->use_dir = $_POST['dir'];
+ $this->display_dir();
+ } else {
+ $this->display_dir();
+ }
+
+ $this->display_footer();
+ } // End of handle_events function
+
+
+} // End of DirPHP class
+
+
+?>
+
+
+
Property changes on: trunk/package/minihttpd/www/admin/dirphp_class.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/exec.php
===================================================================
--- trunk/package/minihttpd/www/admin/exec.php (rev 0)
+++ trunk/package/minihttpd/www/admin/exec.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,203 @@
+<?php
+if (($_POST['submit'] == "Download") && file_exists($_POST['dlPath'])) {
+ session_cache_limiter('public');
+ $fd = fopen($_POST['dlPath'], "rb");
+ header("Content-Type: application/octet-stream");
+ header("Content-Length: " . filesize($_POST['dlPath']));
+ header("Content-Disposition: attachment; filename=\"" .
+ trim(htmlentities(basename($_POST['dlPath']))) . "\"");
+
+ fpassthru($fd);
+ exit;
+} else if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
+ move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tmp/" . $_FILES['ulfile']['name']);
+ $ulmsg = "Uploaded file to /tmp/" . htmlentities($_FILES['ulfile']['name']);
+ unset($_POST['txtCommand']);
+}
+
+include "header.php";
+
+/*
+ Exec+ v1.02-000 - Copyright 2001-2003, All rights reserved
+ Created by technologEase (http://www.technologEase.com).
+
+ (modified for m0n0wall by Manuel Kasper <mk...@ne...>)
+ (further modified for AstLinux)
+*/
+
+// Function: is Blank
+// Returns true or false depending on blankness of argument.
+
+function isBlank( $arg ) { return ereg( "^\s*$", $arg ); }
+
+
+// Function: Puts
+// Put string, Ruby-style.
+
+function puts( $arg ) { echo "$arg\n"; }
+
+
+// "Constants".
+
+$Version = '';
+$ScriptName = $HTTP_SERVER_VARS['SCRIPT_NAME'];
+$Title = 'AstLinux: execute command';
+
+// Get year.
+
+$arrDT = localtime();
+$intYear = $arrDT[5] + 1900;
+
+?>
+<script language="javascript">
+
+
+ // Create recall buffer array (of encoded strings).
+
+<?php
+
+if (isBlank( $_POST['txtRecallBuffer'] )) {
+ puts( " var arrRecallBuffer = new Array;" );
+} else {
+ puts( " var arrRecallBuffer = new Array(" );
+ $arrBuffer = explode( "&", $_POST['txtRecallBuffer'] );
+ for ($i=0; $i < (count( $arrBuffer ) - 1); $i++) puts( " '" . $arrBuffer[$i] . "'," );
+ puts( " '" . $arrBuffer[count( $arrBuffer ) - 1] . "'" );
+ puts( " );" );
+}
+
+?>
+
+ // Set pointer to end of recall buffer.
+ var intRecallPtr = arrRecallBuffer.length-1;
+
+ // Functions to extend String class.
+ function str_encode() { return escape( this ) }
+ function str_decode() { return unescape( this ) }
+
+ // Extend string class to include encode() and decode() functions.
+ String.prototype.encode = str_encode
+ String.prototype.decode = str_decode
+
+ // Function: is Blank
+ // Returns boolean true or false if argument is blank.
+ function isBlank( strArg ) { return strArg.match( /^\s*$/ ) }
+
+ // Function: frmExecPlus onSubmit (event handler)
+ // Builds the recall buffer from the command string on submit.
+ function frmExecPlus_onSubmit( form ) {
+
+ if (!isBlank(form.txtCommand.value)) {
+ // If this command is repeat of last command, then do not store command.
+ if (form.txtCommand.value.encode() == arrRecallBuffer[arrRecallBuffer.length-1]) { return true }
+
+ // Stuff encoded command string into the recall buffer.
+ if (isBlank(form.txtRecallBuffer.value))
+ form.txtRecallBuffer.value = form.txtCommand.value.encode();
+ else
+ form.txtRecallBuffer.value += '&' + form.txtCommand.value.encode();
+ }
+
+ return true;
+ }
+
+ // Function: btnRecall onClick (event handler)
+ // Recalls command buffer going either up or down.
+ function btnRecall_onClick( form, n ) {
+
+ // If nothing in recall buffer, then error.
+ if (!arrRecallBuffer.length) {
+ alert( 'Nothing to recall!' );
+ form.txtCommand.focus();
+ return;
+ }
+
+ // Increment recall buffer pointer in positive or negative direction
+ // according to <n>.
+ intRecallPtr += n;
+
+ // Make sure the buffer stays circular.
+ if (intRecallPtr < 0) { intRecallPtr = arrRecallBuffer.length - 1 }
+ if (intRecallPtr > (arrRecallBuffer.length - 1)) { intRecallPtr = 0 }
+
+ // Recall the command.
+ form.txtCommand.value = arrRecallBuffer[intRecallPtr].decode();
+ }
+
+ // Function: Reset onClick (event handler)
+ // Resets form on reset button click event.
+ function Reset_onClick( form ) {
+
+ // Reset recall buffer pointer.
+ intRecallPtr = arrRecallBuffer.length;
+
+ // Clear form (could have spaces in it) and return focus ready for cmd.
+ form.txtCommand.value = '';
+ form.txtCommand.focus();
+
+ return true;
+ }
+//-->
+</script>
+<p>
+<?php if (isBlank($_POST['txtCommand'])): ?>
+</p>
+<?php endif; ?>
+<?php if ($ulmsg) echo "<p><strong>" . $ulmsg . "</strong></p>\n"; ?>
+<?php
+
+// pre { border: 2px solid #435370; background: #F0F0F0; padding: 1em; font-family: courier new, courier; line-height: 10pt; font-size: 10pt; }
+
+if (!isBlank($_POST['txtCommand'])) {
+ puts("<pre>");
+ puts("\$ " . htmlspecialchars(stripslashes($_POST['txtCommand'])));
+ putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
+ putenv("SCRIPT_FILENAME=" . strtok(stripslashes($_POST['txtCommand']), " ")); /* PHP scripts */
+ $ph = popen(stripslashes($_POST['txtCommand']), "r" );
+ while ($line = fgets($ph)) echo htmlspecialchars($line);
+ pclose($ph);
+ puts("</pre>");
+}
+
+?>
+
+<form action="<?=$ScriptName ?>" method="POST" enctype="multipart/form-data" name="frmExecPlus" onSubmit="return frmExecPlus_onSubmit( this );">
+ <table>
+ <tr>
+ <td class="label" align="right">Command:</td>
+ <td class="type"><input name="txtCommand" type="text" size="70" value="<?=htmlspecialchars($_POST['txtCommand']);?>"></td>
+ </tr>
+ <tr>
+ <td valign="top"> </td>
+ <td valign="top" class="label">
+ <input type="hidden" name="txtRecallBuffer" value="<?=$_POST['txtRecallBuffer'] ?>">
+ <input type="button" class="button" name="btnRecallPrev" value="<" onClick="btnRecall_onClick( this.form, -1 );">
+ <input type="submit" class="button" value="Execute">
+ <input type="button" class="button" name="btnRecallNext" value=">" onClick="btnRecall_onClick( this.form, 1 );">
+ <input type="button" class="button" value="Clear" onClick="return Reset_onClick( this.form );">
+ </td>
+ </tr>
+ <tr>
+ <td height="8"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td align="right">Download:</td>
+ <td>
+ <input name="dlPath" type="text" id="dlPath" size="50">
+ <input name="submit" type="submit" class="button" id="download" value="Download">
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Upload:</td>
+ <td valign="top" class="label">
+<input name="ulfile" type="file" class="button" id="ulfile">
+ <input name="submit" type="submit" class="button" id="upload" value="Upload"></td>
+ </tr>
+ </table>
+</form>
+<?php
+include "footer.php";
+?>
+
+
Property changes on: trunk/package/minihttpd/www/admin/exec.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/footer.php
===================================================================
--- trunk/package/minihttpd/www/admin/footer.php (rev 0)
+++ trunk/package/minihttpd/www/admin/footer.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,18 @@
+ </TD>
+ </TR>
+ </TABLE>
+
+ </td>
+ </tr>
+ <tr>
+ <TD bgcolor="#FFFFFF" width=10></td>
+ <TD colspan=2></td>
+ <TD colspan=2></td>
+ </tr>
+ </table>
+
+ </TD>
+</TR>
+</TABLE>
+</BODY>
+</HTML>
Property changes on: trunk/package/minihttpd/www/admin/footer.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/general.php
===================================================================
--- trunk/package/minihttpd/www/admin/general.php (rev 0)
+++ trunk/package/minihttpd/www/admin/general.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,118 @@
+<?php
+$message = "";
+
+if ($_POST['submit'] == "Reload")
+ {
+ @system("/usr/sbin/asterisk -rx reload > /dev/null", $result);
+ if ($result == 0)
+ $message = "<center><font color=green>Asterisk settings successfully reloaded.</font></center><BR>";
+ else
+ $message = "<center><font color=red>Asterisk settings failed to reload.</font></center><BR>";
+ }
+else if ($_POST['submit'] == "Reboot")
+ {
+ @system("/sbin/reboot", $result);
+ if ($result == 0)
+ $message = "<center><font color=green>The system is rebooting...</font></center><BR>";
+ else
+ $message = "<center><font color=red>The system was unable to reboot.</font></center><BR>";
+ }
+else if ($_POST['submit'] == "Mount Read/Write")
+ {
+ @system("mount -o rw,remount /", $result);
+ if ($result == 0)
+ $message = "<center><font color=green>Filesystem is now set to read/write.</font></center><BR>";
+ else
+ $message = "<center><font color=red>Unable to set filesystem to read/write.</font></center><BR>";
+ }
+else if ($_POST['submit'] == "Mount Read Only")
+ {
+ @system("mount -o ro,remount /", $result);
+ if ($result == 0)
+ $message = "<center><font color=green>Filesystem is now set to read only.</font></center><BR>";
+ else
+ $message = "<center><font color=red>Unable to set filesystem to read only.</font></center><BR>";
+ }
+?>
+
+
+<?php include "header.php"; ?>
+
+Keep in mind that any changes will more than likely not take effect until the next reboot<br>
+<br>
+
+
+
+<?php
+ echo $message;
+?>
+
+<center>
+
+
+<TABLE width="90%" border=0 cellpadding=4>
+<TR><TD width="70%" bgcolor="#EEEEEE"><B>Description</B></TD><TD width="30%" bgcolor="#EEEEEE"><B>Execute</B></TD></TR>
+
+<TR><TD valign=top>
+<I><U>Reload asterisk settings:</U></I> Before any changes to the Asterisk config files are processed, the
+settings must be reloaded.
+</TD><TD valign=top bgcolor="#E0E0E0">
+<form action="<?=$ScriptName ?>" method="POST"><input name="submit" type="submit" class="button" value="Reload"></form></TD>
+</TR>
+
+<TR><TD valign=top>
+<I><U>Edit rc.conf:</U></I> The file rc.conf contains descriptive information about the local host
+name, configuration details for any potential network interfaces and which services should be started
+up at system initial boot time.
+</TD><TD valign=top bgcolor="#E0E0E0">
+<a href="dir.php?edit=/etc/rc.conf&dir=/etc/">Edit rc.conf</a>
+</TD></TR>
+
+<TR><TD valign=top>
+<I><U>View phpinfo():</U></I> Outputs a large amount of information about the current state of PHP.
+This includes information about PHP compilation options and extensions, the PHP version, server
+information and environment (if compiled as a module), the PHP environment, OS version information,
+paths, master and local values of configuration options, HTTP headers, and the PHP License.
+</TD><TD valign=top bgcolor="#E0E0E0">
+<a href="phpinfo.php">phpinfo()</a>
+</TD></TR>
+
+<TR><TD valign=top>
+<I><U>Backup:</U></I> Backup key files used in AstLinux, including all the files contained in the
+Asterisk configuration, rc.conf, and others. Output is in the form of a tar'd gzipped archive, for
+storage on your local machine.
+</TD><TD valign=top bgcolor="#E0E0E0">
+<a href="backup.php">Backup</a>
+</TD></TR>
+
+<TR><TD valign=top>
+<I><U>Change Password:</U></I> Change the password used to access the web administration interface.
+Keep in mind that this does <B>NOT</B> change the console password, only the web interface.
+</TD><TD valign=top bgcolor="#E0E0E0">
+<a href="password.php">Change Password</a>
+</TD></TR>
+
+<TR><TD valign=top>
+<I><U>Reboot:</U></I> Reboot the entire AstLinux system. While not necessary, it never hurts to reboot
+the system to make sure everything is dialed in after a hard day of making changes.
+</TD><TD valign=top bgcolor="#E0E0E0">
+<form action="<?=$ScriptName ?>" method="POST"><input name="submit" type="submit" class="button" value="Reboot"></form></TD>
+</TR>
+
+<TR><TD valign=top>
+<I><U>Mount Read/Write:</U></I> By default the boot filesystem (hda1) is mounted as read only, to ensure
+a long life for the compact flash based boot drive. If any changes need to be made to the boot filesystem,
+the drive must first be mounted as read/write.
+</TD><TD valign=top bgcolor="#E0E0E0">
+<form action="<?=$ScriptName ?>" method="POST"><input name="submit" type="submit" class="button" value="Mount Read/Write"></form>
+<form action="<?=$ScriptName ?>" method="POST"><input name="submit" type="submit" class="button" value="Mount Read Only"></form></TD>
+</TR>
+
+
+</table>
+
+</center>
+
+<?php include "footer.php"; ?>
+
+
Property changes on: trunk/package/minihttpd/www/admin/general.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/graphics/blank.gif
===================================================================
(Binary files differ)
Property changes on: trunk/package/minihttpd/www/admin/graphics/blank.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/package/minihttpd/www/admin/graphics/box-bottomleft.gif
===================================================================
(Binary files differ)
Property changes on: trunk/package/minihttpd/www/admin/graphics/box-bottomleft.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/package/minihttpd/www/admin/graphics/box-bottomright.gif
===================================================================
(Binary files differ)
Property changes on: trunk/package/minihttpd/www/admin/graphics/box-bottomright.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/package/minihttpd/www/admin/graphics/box-left.gif
===================================================================
(Binary files differ)
Property changes on: trunk/package/minihttpd/www/admin/graphics/box-left.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/package/minihttpd/www/admin/graphics/box-right.gif
===================================================================
(Binary files differ)
Property changes on: trunk/package/minihttpd/www/admin/graphics/box-right.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/package/minihttpd/www/admin/graphics/box-topright.gif
===================================================================
(Binary files differ)
Property changes on: trunk/package/minihttpd/www/admin/graphics/box-topright.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/package/minihttpd/www/admin/graphics/logo.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/package/minihttpd/www/admin/graphics/logo.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/package/minihttpd/www/admin/header.php
===================================================================
--- trunk/package/minihttpd/www/admin/header.php (rev 0)
+++ trunk/package/minihttpd/www/admin/header.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,116 @@
+<?php
+
+ function box_header($width, $title)
+ {
+ $fullsize = $width + 13;
+ echo "<TABLE cellSpacing=0 cellPadding=0 width=".$fullsize." border=0>";
+ echo "<TR>";
+ echo " <TD colspan=2 bgcolor=#A0A0A0><B><font color=#FFFFFF> ".$title."</FONT></B></TD>";
+ echo " <TD background=\"graphics/box-topright.gif\" width=8><img src=\"graphics/blank.gif\" width=1 height=14></TD>";
+ echo "</TR>";
+ echo "<TR>";
+ echo " <TD background=\"graphics/box-left.gif\" width=5></TD>";
+ echo " <TD width=".$width."><BR>";
+ }
+
+ function box_footer()
+ {
+ echo " </td>";
+ echo " <TD background=\"graphics/box-right.gif\" width=8></TD>";
+ echo "</TR>";
+ echo "<TR>";
+ echo " <TD colspan=2 background=\"graphics/box-bottomleft.gif\"><img src=\"graphics/blank.gif\" width=1 height=14></TD>";
+ echo " <TD background=\"graphics/box-bottomright.gif\"></TD>";
+ echo "</tr>";
+ echo "</TABLE>";
+ }
+
+?>
+
+<HTML>
+<HEAD>
+ <META http-equiv="Content-Style-Type" content="text/css">
+ <link href="default.css" rel="stylesheet" type="text/css">
+ <title>AstLinux Web Admin</title>
+</HEAD>
+<body bgcolor="#ffffff" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" class="astlinux">
+
+<TABLE cellSpacing=0 cellPadding=0 width=760 border=0>
+<TR>
+ <TD>
+ <a href="http://www.astlinux.org">
+ <img src="graphics/logo.jpg" width=600 height=120 border=0>
+ </a>
+ </TD>
+</TR>
+<TR>
+ <TD>
+
+ <TABLE cellSpacing=0 cellPadding=0 width=740 border=0>
+ <TR>
+ <TD bgcolor="#FFFFFF" width=10></td>
+ <TD bgcolor="#A9A9A9" width=128><img src="graphics/blank.gif" width=1 height=20></td>
+ <TD bgcolor="#000000" width=7></td>
+ <TD bgcolor="#000000" width=445 align=right>
+<B><font color="#666666">Filesystem:</font>
+<?php
+ if (is_writable("/var/www/admin/header.php"))
+ echo "<font color=#DD0000>Read/Write</font>";
+ else
+ echo "<font color=#00DD00>Read Only</font>";
+?>
+</B>
+ </td>
+ <TD bgcolor="#FFFFFF" width=150></td>
+ </tr>
+ <tr>
+ <TD bgcolor="#FFFFFF" width=10></td>
+ <TD colspan=2 width=135 align=left valign=top>
+ <TABLE cellSpacing=0 cellPadding=0 width=135 border=0>
+ <TR>
+ <TD background="graphics/box-left.gif" width=5></TD>
+ <TD width=122><BR>
+
+ <B>Asterisk:</B><BR>
+ <a href="dir.php?dir=/etc/asterisk/">Config</a><BR>
+ <a href="asterisk.php">Shell</a><BR>
+ <a href="log.php">Log</a><BR>
+<BR>
+
+<B>Boot:</B><BR>
+ <a href="dir.php?dir=/tftpboot/">TFTP</a><BR>
+<?
+if (file_exists("/home/ftp")) {
+echo " <a href=\"dir.php?dir=/home/ftp/\">FTP</a><BR>";}
+?>
+<BR>
+
+<B>General:</B><BR>
+ <a href="about.php">About</a><BR>
+ <a href="credits.php">Credits</a><BR>
+ <a href="index.php">Status</a><BR>
+ <a href="network.php">Network</a><BR>
+<?
+if (file_exists("nistnet.php")) {
+echo " <a href=\"nistnet.php\">WanSimulator</a><BR>";}
+?>
+ <a href="exec.php">Shell</a><BR>
+ <a href="general.php">Setup</a><BR>
+<BR>
+
+ </td>
+ <TD background="graphics/box-right.gif" width=8></TD>
+ </TR>
+ <TR>
+ <TD colspan=2 background="graphics/box-bottomleft.gif"><img src="graphics/blank.gif" width=1 height=14></TD>
+ <TD background="graphics/box-bottomright.gif"></TD>
+ </tr>
+ </TABLE>
+ </td>
+ <TD colspan=2 width=595 bgcolor="#FFFFFF" align=left valign=top><BR>
+
+ <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
+ <TR>
+ <TD width="1%"></TD>
+ <TD align=left valign=top>
+
Property changes on: trunk/package/minihttpd/www/admin/header.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/index.php
===================================================================
--- trunk/package/minihttpd/www/admin/index.php (rev 0)
+++ trunk/package/minihttpd/www/admin/index.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,157 @@
+<?php include "header.php"; ?>
+
+Welcome to the AstLinux <B><I>VERY</I></B> Basic Web Interface.<br>
+<br>
+
+<CENTER>
+<TABLE border=0>
+<TR><TD>
+<?php
+ function linuxUptime()
+ {
+ $ut = strtok( exec( "cat /proc/uptime" ), "." );
+ $days = sprintf( "%2d", ($ut/(3600*24)) );
+ $hours = sprintf( "%2d", ( ($ut % (3600*24)) / 3600) );
+ $min = sprintf( "%2d", ($ut % (3600*24) % 3600)/60 );
+ $sec = sprintf( "%2d", ($ut % (3600*24) % 3600)%60 );
+ return array( $days, $hours, $min, $sec );
+ }
+
+ box_header(250, "Server uptime");
+
+ $uptime = linuxUptime();
+ echo "<center>";
+ if ($uptime[0] >= 1)
+ {
+ echo $uptime[0]." day";
+ if ($uptime[0] != 1)
+ echo "s";
+ echo " ";
+ }
+
+ if ($uptime[1] >= 1)
+ {
+ echo $uptime[1]." hour";
+ if ($uptime[1] != 1)
+ echo "s";
+ echo " ";
+ }
+
+ echo $uptime[2]." min";
+ if ($uptime[2] != 1)
+ echo "s";
+ echo " ";
+
+ echo $uptime[3]." sec";
+ if ($uptime[3] != 1)
+ echo "s";
+ echo " ";
+
+ echo "</center><BR>";
+ box_footer();
+
+ echo "</td><td>";
+
+
+ box_header(250, "Server load");
+ echo "<center>";
+
+ $data = shell_exec('cat /proc/loadavg');
+ $dataArray = explode(' ', $data);
+
+ $procArray = explode('/', $dataArray[3]);
+ echo "<table border=0 width=100%><tr><td align=center>1 min avg</td><td align=center>5 min avg</td><td align=center>15 min avg</td></tr>";
+ echo "<tr><td align=center>".$dataArray[0]."</td><td align=center>".$dataArray[1]."</td><td align=center>".$dataArray[2]."</td></tr>";
+
+ echo "</table></center><BR>";
+ box_footer();
+
+?>
+</TD></TR>
+</TABLE>
+
+<?php
+ function checkd($daemon,$name)
+ {
+ $ps ="ps | grep ".$daemon." | grep -v grep | wc -l";
+ $origps = exec($ps);
+ echo "<TR><TD><B>" . $name . "</B></TD>";
+
+ if ($origps < 1)
+ {
+ echo "<TD><font color=red>DOWN</font></TD>";
+ echo "<TD>0</TD>";
+ }
+ else
+ {
+ echo "<TD><font color=green>UP</font></TD>";
+ echo "<TD>" . $origps . "</TD>";
+ }
+ }
+
+ box_header(500, "Service status");
+
+ echo "<TABLE width=\"90%\">";
+ echo "<TR><TD>Service</TD><TD>Status</TD><TD>Process Count</TD></TR>";
+
+ echo checkd("asterisk","Asterisk");
+ echo checkd("mini_httpd","HTTP Daemon");
+ echo checkd("sshd","SSH Daemon");
+ echo checkd("ntpd","NTP Daemon");
+ echo checkd("dnsmasq","DNSMasq Daemon");
+ echo checkd("inetd","Inet Daemon");
+ echo checkd("syslogd","Syslog Daemon");
+
+ echo "</table>";
+
+ box_footer();
+
+?>
+
+
+<BR>
+
+
+<?php
+
+ box_header(550, "Drive usage");
+
+echo "<TABLE border=0 width=100%><TR><TD>Drive</TD><TD align=right>Size</TD><TD align=right>Used</TD><TD align=right>Avail</TD><TD align=right>Percent</TD><TD>Mount</TD></TR>";
+
+exec ("df -h", $x);
+$count = 1;
+while ($count < sizeof($x))
+ {
+ list($drive, $size, $used, $avail, $percent, $mount) = split(" +", $x[$count]);
+
+ echo "<TR><TD>".$drive."</TD><TD align=right>".$size."</TD><TD align=right>".$used."</TD><TD align=right>".$avail."</TD><TD align=right>".$percent."</TD><TD>".$mount."</TD><TR>";
+
+ $count++;
+ }
+
+ echo "</table>";
+
+ box_footer();
+?>
+
+</CENTER>
+
+
+<?php include "footer.php"; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: trunk/package/minihttpd/www/admin/index.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/log.php
===================================================================
--- trunk/package/minihttpd/www/admin/log.php (rev 0)
+++ trunk/package/minihttpd/www/admin/log.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,99 @@
+<?php include "header.php"; ?>
+
+<?php
+
+ function isBlank( $arg ) { return ereg( "^\s*$", $arg ); }
+
+ echo "<form method=\"post\" action=\"".$self."\">";
+
+ $search = $_POST['search'];
+
+ if (!isBlank($_POST['returns']))
+ $returns = $_POST['returns'];
+ else
+ $returns = 20;
+ if ($returns > 500)
+ $returns = 500;
+
+ $submit = $_POST['submit'];
+
+ echo "Number of entries to display: <input type=\"text\" name=\"returns\" value=\"".$returns."\"></input>";
+ echo "<input type=\"submit\" name=\"submit\" value=\"List\"></input><br>";
+ echo "Search string: <input type=\"text\" name=\"search\" value=\"".$search."\"></input>";
+ echo "<input type=\"submit\" name=\"submit\" value=\"Search\"></input><br>";
+?>
+
+ </form>
+
+<?php
+
+ if (($submit == "Search") && (!isBlank($search)))
+ {
+ $command = "grep ".$search." /var/log/asterisk/cdr-csv/Master.csv | tail -n ".$returns."";
+ box_header(550, "Search results (max ".$returns." returns)");
+ }
+ else
+ {
+ $command = "tail -n ".$returns." /var/log/asterisk/cdr-csv/Master.csv";
+ box_header(550, "Call history (last ".$returns." calls)");
+ }
+
+ putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
+ putenv("SCRIPT_FILENAME=".$command); /* PHP scripts */
+ $handle = popen($command, "r" );
+
+ while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
+ {
+ $num = count($data);
+ $row++;
+
+/*
+ 0 Account
+ 1 Source
+ 2 Destination
+ 3 Context
+ 4 CallerID
+ 5 Source Channel
+ 6 Destination Channel
+ 7 Last App
+ 8 Last Data
+ 9 Call Date
+ 10 Call Pickup
+ 11 Call Hangup
+ 12 Duration
+ 13 Billable
+ 14 Status
+ 15 User
+
+*/
+
+ echo "<table border=0 cellPadding=0 cellSpacing=2 width=100%>";
+ echo "<tr><td width=20%><b>Time:</b></td><td width=40%>".$data[9]." start</td><td width=40%>".$data[11]." end</td></tr>";
+ echo "<tr><td><b>Duration:</b></td><td>".$data[12]." total</td><td>".$data[13]." billable</td></tr>";
+ echo "<tr><td><b>Status:</b></td><td>".$data[14]."</td><td><b>".$data[3]."</b></td></tr>";
+ echo "<tr><td><b>Source:</b></td><td>".$data[1]."</td><td>".$data[5]."</td></tr>";
+ echo "<tr><td><b>Destination:</b></td><td>".$data[2]."</td><td>".$data[6]."</td></tr>";
+ echo "</table><br>";
+ }
+ pclose($handle);
+
+ box_footer();
+
+?>
+
+<?php include "footer.php"; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: trunk/package/minihttpd/www/admin/log.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/network.php
===================================================================
--- trunk/package/minihttpd/www/admin/network.php (rev 0)
+++ trunk/package/minihttpd/www/admin/network.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,46 @@
+<?php include "header.php"; ?>
+
+<?php
+
+ $submit = $_POST['submit'];
+ $host = $_POST['host'];
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $self = $_SERVER['PHP_SELF'];
+ $count = 4;
+
+ echo "This server's current IP address is ".$ip.".<BR>";
+ echo "<form method=\"post\" action=\"".$self."\">";
+ echo "Enter IP address or domain name <input type=\"text\" name=\"host\" value=\"".$host."\"></input>";
+ echo "<input type=\"submit\" name=\"submit\" value=\"Ping\"></input>";
+ echo "<input type=\"submit\" name=\"submit\" value=\"Trace\"></input>";
+ echo "</form>";
+
+
+ if ($submit == "Ping")
+ {
+ $host = preg_replace ("/[^A-Za-z0-9.-]/","",$host);
+ echo("Ping:");
+ echo "<pre>";
+
+ $ps = "ping -c ".$count." ".$host;
+
+ system($ps);
+ echo "</pre>";
+ }
+ if ($submit == "Trace")
+ {
+ $host = preg_replace ("/[^A-Za-z0-9.-]/","",$host);
+ echo("Traceroute:");
+ echo "<pre>";
+
+ $ps = "traceroute -m 30 -w 2 ".$host;
+
+ system($ps);
+ echo "</pre>";
+ }
+
+?>
+
+<?php include "footer.php"; ?>
+
+
Property changes on: trunk/package/minihttpd/www/admin/network.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/password.php
===================================================================
--- trunk/package/minihttpd/www/admin/password.php (rev 0)
+++ trunk/package/minihttpd/www/admin/password.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,51 @@
+<?php include "header.php"; ?>
+
+<?
+ if (isset($_POST['password1'])) $password1 = $_POST['password1'];
+ if (isset($_POST['password2'])) $password2 = $_POST['password2'];
+
+ if (isset($password1))
+ {
+ if ($password1 == $password2)
+ {
+ $jumble = md5(time() . getmypid());
+ $salt = substr($jumble, 0, 2);
+ $htpasswd_text .= "admin:".crypt($password1, $salt)."\n";
+
+ @system("mount -o rw,remount /", $result);
+
+ if (($fp = @fopen("/var/www/admin/.htpasswd","wb")) != NULL)
+ {
+ fwrite($fp, $htpasswd_text);
+ fclose($fp);
+
+ echo "<center><font color=green>Web password changed!</font></center><BR>";
+ }
+ else
+ {
+ echo "<center><font color=red>Unable to change web password.</font></center><BR>";
+ }
+
+ @system("mount -o ro,remount /", $result);
+ }
+ else
+ {
+ echo "<center><font color=red>Passwords do not match.</font></center><BR>";
+ }
+ }
+
+?>
+
+<CENTER>
+<FORM METHOD="POST" ACTION="<? echo $PHP_SELF; ?>">
+<table>
+<tr><td>Password:</td><td><INPUT TYPE="PASSWORD" NAME="password1"></td></tr>
+<tr><td>Password again:</td><td><INPUT TYPE="PASSWORD" NAME="password2"></td></tr>
+<tr><td><INPUT type=submit name="submit" VALUE="Change">
+</FORM>
+</td></tr>
+</table>
+</center>
+
+<?php include "footer.php"; ?>
+
Property changes on: trunk/package/minihttpd/www/admin/password.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/admin/phpinfo.php
===================================================================
--- trunk/package/minihttpd/www/admin/phpinfo.php (rev 0)
+++ trunk/package/minihttpd/www/admin/phpinfo.php 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,3 @@
+<?php
+phpinfo()
+?>
Property changes on: trunk/package/minihttpd/www/admin/phpinfo.php
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/package/minihttpd/www/index.html
===================================================================
--- trunk/package/minihttpd/www/index.html (rev 0)
+++ trunk/package/minihttpd/www/index.html 2007-04-18 18:38:03 UTC (rev 854)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>AstLinux Admin Redirect</title>
+<meta http-equiv="REFRESH" content="2;url=admin/"></HEAD>
+<BODY>
+Redirecting to admin site...<br>
+</BODY>
+</HTML>
Deleted: trunk/package/minihttpd/www.tar.gz
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|