# HG changeset patch # User Michiel Broek # Date 1425840773 -3600 # Node ID f687396e571bbd43113202458e754554703b3f09 # Parent 32ee2be19354f64efbc9adee79889ba91f1b13bc Added archives web page diff -r 32ee2be19354 -r f687396e571b www-thermferm/archives.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www-thermferm/archives.php Sun Mar 08 19:52:53 2015 +0100 @@ -0,0 +1,93 @@ + + * + * This file is part of ThermFerm + * + * This 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, or (at your option) any + * later version. + * + * ThermFerm 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 ThermFerm; see the file COPYING. If not, write to the Free + * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + *****************************************************************************/ + +require_once('utilities.php'); + +if (isset($_GET['action'])) { + switch ($_GET['action']) { + case 'dl': archive_dl(); + break; + case 'view': archive_view(); + break; + default: break; + } +} else { + archive_dir(); +} + +exit; + +/**************************************************************************** + * + */ + + + + +/* + * + */ +function archive_dir() { + + $answer = send_cmd("ARCHIVE DIR"); + $reply = explode("\r\n", $answer); + + $outstr = build_header("Archived logfiles"); + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + + if (startsWith($reply[0], "212")) { + $j = 1; + while (1) { + if (strcmp($reply[$j], ".") == 0) + break; + $f = explode(",", $reply[$j]); + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $outstr .= ' '.PHP_EOL; + $j++; + } + } + + $outstr .= '
File nameModeSizeDateAction
'.$f[0].''.$f[1].''.$f[2].''.$f[3].'Download'; + $outstr .= ' View
'.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= build_footer(); + echo $outstr; +} + + + diff -r 32ee2be19354 -r f687396e571b www-thermferm/maintenance.php --- a/www-thermferm/maintenance.php Sun Mar 08 17:57:21 2015 +0100 +++ b/www-thermferm/maintenance.php Sun Mar 08 19:52:53 2015 +0100 @@ -73,6 +73,9 @@ $outstr .= '
'.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= '
'.PHP_EOL; +$outstr .= '
'.PHP_EOL; +$outstr .= ' '.PHP_EOL; +$outstr .= '
'.PHP_EOL; /* * See if the server supports simulators */