From: Joe Z. <jz...@us...> - 2004-06-01 06:18:46
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2771 Modified Files: RELEASE-NOTES TODO admin.php systemcheck.php Added Files: excludes.php Log Message: New interface for editing list of files to exclude from backups. --- NEW FILE: excludes.php --- <?php // excludes.php - Edit list of files to exclude from backups require_once ('inc/class_rfasttemplate.php'); // Template class require_once("inc/class_config.php"); // configuration class require_once("inc/class_admin.php"); // Administration interface class require_once("inc/class_server.php"); // Make sure we logged in session_start(); $admin = &$_SESSION['admin']; $servercfg = &$_SESSION['servercfg']; if ($admin->check_admin("") != "yes"){ echo "Oops! You're not logged in.\n"; exit; } // Register variables for use across refreshes session_register("excludes"); $excludes = &$_SESSION['excludes']; // Global vars $errmsg = ""; // What to do? switch ($_POST['exbutton']){ case ('Confirm'): // Update the exclude list if (!confirm()){ $errmsg = "Error occured."; loadpage(); } else { session_unregister("excludes"); $bobsdir = dirname($_SERVER['PHP_SELF']); header("Location: $bobsdir/admin.php?menu=servers"); } break; case ('Cancel'); // Go back to the server list session_unregister("excludes"); $bobsdir = dirname($_SERVER['PHP_SELF']); header("Location: $bobsdir/admin.php?menu=servers"); break; default: // Load this web page loadpage(); break; } // ---------------------------- // End of program // ---------------------------- return; // -------------------------------- // Load this web page // Input: server and share post fields // Output: A nicely formatted html page sent to stdout // -------------------------------- function loadpage(){ global $servercfg, $errmsg, $excludes; // Initialize variables $PHPSELF = $_SERVER['PHP_SELF']; // This web page location $server = $excludes['server'] = $_GET['server']; // Selected server name $share = $excludes['share'] = $_GET['share']; // Selected share name // Build the list name for this web page heading if ($server == "") $listname = "default.excludelist"; else $listname = "$server / $share"; // Retrieve the exclude list file contents $exclude_list = $servercfg->get_excludes($server, $share); // Display the exclude list $t = new rFastTemplate('inc/templates'); // Instantiate new template $t->define(array('content' => 'excludes.thtml')); // Tell rfasttemplate the template file name $t->assign('HEADER', implode("", file('inc/header.pinc'))); // Load the page header $t->assign('PHPSELF', $PHPSELF); // Replace PHPSELF with the current URL $t->assign('ERRMSG', $errmsg); // Error message (if any) $t->assign('BORDER', "0"); // No border $t->assign('LISTNAME', "$listname"); // The selection list and buttons $t->assign('EXCLUDELIST', $exclude_list); // Prepare the final output $t->parse ('CONTENT', 'content'); $t->FastPrint(); // and send it to stdout. echo "</body></html>\n"; } // -------------------------------- // Write the exclude list to a file // Input: server and share post fields, exlist textarea post field // Output: TRUE on successful write, FALSE on error // -------------------------------- function confirm(){ global $servercfg, $excludes; $server = $excludes['server']; // Selected server name $share = $excludes['share']; // Selected share name $text = stripslashes($_POST['exlist']); // Get text without added \slashes\ return $servercfg->set_excludes($server, $share, "$text"); } // THE END ?> Index: RELEASE-NOTES =================================================================== RCS file: /cvsroot/bobs/bobs/RELEASE-NOTES,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- RELEASE-NOTES 29 May 2004 23:43:29 -0000 1.6 +++ RELEASE-NOTES 1 Jun 2004 06:18:37 -0000 1.7 @@ -48,6 +48,9 @@ --- Implement cleanup of old incremental files. Use the database to determine file age. +--- +Created an interface for creating and editing excludes lists. If no +server selected, edit the default exclude list. ------------------------- Changes in release 0.6.2 Index: TODO =================================================================== RCS file: /cvsroot/bobs/bobs/TODO,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- TODO 29 May 2004 23:43:29 -0000 1.25 +++ TODO 1 Jun 2004 06:18:37 -0000 1.26 @@ -14,10 +14,6 @@ This should go into the "make_incremental" part of function.php The bash script would have to be modified to perform this check. -Create an interface for creating and editing excludeslists - Priority: Medium - Administration should be done from the browser interface. - Create an interface for creating and editing "file links" configurations Priority: Low File links are things like icons and special files like ".AppleDouble" Index: admin.php =================================================================== RCS file: /cvsroot/bobs/bobs/admin.php,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- admin.php 23 May 2004 21:25:37 -0000 1.27 +++ admin.php 1 Jun 2004 06:18:37 -0000 1.28 @@ -185,6 +185,8 @@ $serverlist->setadd(); // Show the "Add" button $serverlist->setchange(); // Show the "Change" button $serverlist->setdelete(); // Show the "Delete" button + $serverlist->addbutton("Edit Excludes"); + // Edit the list of files to exclude from backups $serverlist->addbutton("Check Configuration"); // Test the system and server configuration $serverlist->addbutton("Backup Now"); // Backup selected server now button @@ -268,6 +270,12 @@ // Redirect browser exit; break; + case ("Edit Excludes"): // "Edit Excludes" button pressed + $bobsdir = dirname($_SERVER['PHP_SELF']); + header("Location: $bobsdir/excludes.php?server=$server&share=$share"); + // Redirect browser to "Edit Excludes" page + exit; + break; default: $servercfg->set_config($server . '.' . $share); server_details($action, $server, $share, NULL, NULL); Index: systemcheck.php =================================================================== RCS file: /cvsroot/bobs/bobs/systemcheck.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- systemcheck.php 23 May 2004 21:25:37 -0000 1.9 +++ systemcheck.php 1 Jun 2004 06:18:37 -0000 1.10 @@ -2,11 +2,11 @@ // systemcheck.php - Verify bobs is configured properly and working -if (isset($_GET['menu_bobs'])){ // BOBS menu button pushed - $bobsdir = dirname($_SERVER['PHP_SELF']); - header("Location: $bobsdir"); // Redirect browser to BOBS main index - exit; // Make sure that code below does not get executed -} +//if (isset($_GET['menu_bobs'])){ // BOBS menu button pushed +// $bobsdir = dirname($_SERVER['PHP_SELF']); +// header("Location: $bobsdir"); // Redirect browser to BOBS main index +// exit; // Make sure that code below does not get executed +//} require_once ('inc/class_rfasttemplate.php'); // Template class require_once("inc/class_config.php"); // configuration class |