From: Rene R. <ren...@us...> - 2003-12-29 02:43:39
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv25408 Modified Files: admin.php index.php Log Message: Adding rsync_ssh backup_method from Jochen Metzger. Added admin help page. Index: admin.php =================================================================== RCS file: /cvsroot/bobs/bobs/admin.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- admin.php 28 Jun 2003 06:45:49 -0000 1.24 +++ admin.php 29 Dec 2003 02:43:28 -0000 1.25 @@ -71,7 +71,7 @@ exit; // Make sure that code below does not get executed break; case ('help'): - echo "Help function is not yet implemented."; + admin_help(); // Build the admin help page break; case ('logout'): admin_login(); // Build login screen @@ -146,6 +146,22 @@ $t->FastPrint(); // and send it to stdout. } + +// ---------------------------------------------------------------- +// Server selection +// ---------------------------------------------------------------- +function admin_help () { + + $t = new rFastTemplate('inc/templates'); // Instantiate new template + $t->define(array('admin_help' => 'admin_help.thtml')); + // Tell rfasttemplate the template file name + $t->assign('HEADER', implode("", file('inc/header.pinc'))); + $t->assign('ADMINHELP', implode("", file('winc/adminhelp.html'))); + $t->parse('ADMIN_HELP', 'admin_help'); // Prepare the final output + $t->FastPrint(); // and send it to stdout. + // Load the page header + +} // ---------------------------------------------------------------- // Server selection // ---------------------------------------------------------------- @@ -278,6 +294,9 @@ if ($share == ""){ return "Share name is required."; } + // avoid that "/" is used in Share name + if (substr_count($share,"/") > 0) + return "'/' is not allowed in the Share name (suggestion: use '_' instead)"; } } @@ -356,6 +375,13 @@ && (trim($settings['rsync_share']) == "")){ return "Please specify the name of the rsync share."; } + + if (($settings['backup_method'] =='rsync_ssh') + && (trim($settings['rsync_ssh_path']) == "")){ + return "Please specify the directory to backup on the rsync Remote Server."; + + } + if ((($settings['backup_method'] == 'nfs') || ($settings['restore_method'] == 'nfs')) && (trim($settings['nfs_share']) == "")){ Index: index.php =================================================================== RCS file: /cvsroot/bobs/bobs/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.php 26 Oct 2002 02:01:35 -0000 1.5 +++ index.php 29 Dec 2003 02:43:28 -0000 1.6 @@ -66,19 +66,37 @@ </td> <td width="400" align="center"> <?php - echo '<form name="loginform" method="POST">'; - echo "<p><big>Select the server and share you wish to use</big><br><br>"; - echo '<select name="server">'; - foreach ( $srvcfg->servers as $server ) { - echo '<option value="' . $server["server"] . '.' . $server["share"] . '">' . $server["server"] . ' / ' . $server["share"]; - } - echo '</select></p>'; - echo '<p><big>Type the login name for the selected server</big><br><br> <input type="text" value="login name" name="loginname"></p>'; - echo '<p><big>Type the password for the selected server</big><br><br> <input type="password" name="password"></p>'; - echo '<p><big>Press the Login button to continue</big><br><br><input type="submit" name="login" value="Login"></p>'; - echo '<input type="hidden" name="trylogin">'; - echo '</form>'; - ?> + if (is_array($srvcfg->servers)){ + + echo '<form name="loginform" method="POST">'; + echo "<p><big>Select the server and share you wish to use</big><br><br>"; + + echo '<select name="server">'; + foreach ( $srvcfg->servers as $server ) { + if ($server["restore_method"] != "none") + $options.='<option value="' . $server["server"] . '.' . $server["share"] . '">' . $server["server"] . ' / ' . $server["share"]."</option>"; + } + + if ($options == ""){ + $options.='<option value="">No Servers with Restore Ability present</option>'; + } + + echo $options; + + echo '</select></p>'; + echo '<p><big>Type the login name for the selected server</big><br><br> <input type="text" value="login name" name="loginname"></p>'; + echo '<p><big>Type the password for the selected server</big><br><br> <input type="password" name="password"></p>'; + echo '<p><big>Press the Login button to continue</big><br><br><input type="submit" name="login" value="Login"></p>'; + echo '<input type="hidden" name="trylogin">'; + echo '</form>'; + + } + // show up when no servers are configured yet + else { + echo '<big>No servers configured yet.<br><a href="admin.php">Configure Servers</a></big>'; + } + + ?> </td> <td> </td> |