You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(26) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(3) |
Feb
(38) |
Mar
(11) |
Apr
(38) |
May
(21) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2004 |
Jan
(8) |
Feb
(1) |
Mar
(21) |
Apr
(16) |
May
(9) |
Jun
(20) |
Jul
|
Aug
(19) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
2005 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
(7) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joe Z. <jz...@us...> - 2004-01-04 03:45:25
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv14169 Modified Files: NEWS systemcheck.php Log Message: Added: Test rsync over ssh in systemcheck.php. Fixed: Was using incorrect share field in rsync test. Index: NEWS =================================================================== RCS file: /cvsroot/bobs/bobs/NEWS,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- NEWS 4 May 2003 19:51:59 -0000 1.2 +++ NEWS 4 Jan 2004 03:45:22 -0000 1.3 @@ -15,3 +15,10 @@ 05-04-2003 Released version 0.6.0pre2. + + 06-22-2003 + Released version 0.6.0. + + 01-03-2004 + Jochen Metzger joins bobs as a developer. + Jochen created a patch to allow rsync over ssh as a backup method. Index: systemcheck.php =================================================================== RCS file: /cvsroot/bobs/bobs/systemcheck.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- systemcheck.php 10 May 2003 17:37:50 -0000 1.4 +++ systemcheck.php 4 Jan 2004 03:45:22 -0000 1.5 @@ -427,9 +427,8 @@ // Try to mount the selected share. $config = $srvcfg->get_config(); - $method = $config['backup_method']; - if ($method != "rsync"){ + if (($method != "rsync") && ($method != "rsync_ssh")){ $mntcmd = $srvcfg->get_mount_cmd('backup'); $t->assign ('ITEM', "Attempting to mount for backup method type \"$method\" using this command:<br> $mntcmd"); @@ -496,7 +495,8 @@ // See if rsync works if ($method == "rsync"){ - $rsync = "rsync -n " . $server . '::' . $share; + $rsync_share = $config['rsync_share']; + $rsync = "rsync -n " . $server . '::' . $rsync_share; $t->assign ('ITEM', "Using rsync to list files for backup method \"$method\" using this command:<br> $rsync"); $srvtmpl->assign ('COMMAND', "$rsync"); // the mount command @@ -514,12 +514,34 @@ } } + // Test rsync over ssh + + if ($method == "rsync_ssh"){ + $rsync_ssh_path = $config['rsync_ssh_path']; + $rsync = "rsync -n -e ssh " . $server . ':' . $rsync_ssh_path; + $t->assign ('ITEM', "Testing rsync over ssh for backup method \"$method\" using this command:<br> + $rsync"); + $srvtmpl->assign ('COMMAND', "$rsync"); // the mount command + $srvtmpl->parse ('ROW', 'cmdwoutput'); + $rtnval = submit(); // submit the mount cmd + $srvtmpl->clear_dynamic ('cmdwoutput'); + $cmdoutput = getcmdout($rtnval); // Get the command's output + if ($rtnval[0] == 0) { + $t->assign ('STATUS', 'PASS'); + putpass(); + } else { + $t->assign ('STATUS', 'FAIL'); + $t->assign ('HELP', "Rsync over ssh failed with this message:<br>$cmdoutput"); + putfail(); + } + } + // Test mounting and unmounting the 'restore' method // and reading and writing a file. sleep(5); // Allow time for last operation to finish $method = $config['restore_method']; - if ($method != "rsync"){ + if (($method != "rsync") && ($method != "rsync_ssh") && ($method != "none")){ $mntcmd = $srvcfg->get_mount_cmd('restore'); $t->assign ('ITEM', "Attempting to mount for restore method type \"$method\" using this command:<br> $mntcmd"); |
From: Joe Z. <jz...@us...> - 2004-01-04 02:18:19
|
Update of /cvsroot/bobs/bobs/winc In directory sc8-pr-cvs1:/tmp/cvs-serv2411/winc Modified Files: adminhelp.html Log Message: FIX: sftp instruction to use '!' enters shell of bobs server rather than remote server. Index: adminhelp.html =================================================================== RCS file: /cvsroot/bobs/bobs/winc/adminhelp.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- adminhelp.html 29 Dec 2003 02:43:28 -0000 1.1 +++ adminhelp.html 4 Jan 2004 02:18:16 -0000 1.2 @@ -21,7 +21,7 @@ "<b>Help</b>" is this help.<br> <br> <h4><a name="2"></a>2. Making backups.</h4> -To make a backup you have to create servers. Click the "Servers" tab to do that.<br> +To make a backup you have to create servers. Click the "Servers" tab to configure what you want to backup.<br> There is an example server called "testserver" which you can safely ignore.<br> When you have created a server you should check if the settings are correct. Select the server and click the "Check configuration" button.<br> A new page will appear with information about the check being run. Red text indicates errors. Correct the errors and try again. Repeat until you have no red text.<br> @@ -65,8 +65,14 @@ mypassword [ENTER]<br> # Transfer the public key now<br> <p><i>cd .ssh</i></p> - put id_dsa.pub # Jump to Shell by just entering "!"<br> - <p><i>!</i></p> + <p><i>put id_dsa.pub</i></p> + # exit the connection<br> + <p><i>exit</i></p> + # Login to the remote server and change to the ssh directory.<br> + <p><i>ssh ro...@re...</i></p> + <p><i>cd .ssh</i></p> + # Note: If the ssh directory doesn't exist you can create it this way.<br> + <p><i>ssh someserver.com</i><p> # Create a file authorized_keys2 or just add a line with the public<br> # key of the BOBS server to it <br> <p><i>cat id_dsa.pub >> authorized_keys2</i></p> @@ -93,7 +99,8 @@ Go to the "Servers" tab and click on the "Change Admin Password" link. <br> <h4><a name="7"></a>7. You found a bug in BOBS.</h4> -For help please contact the developers of BOBS on <a href="http://bobs.sourceforge.net/">http://bobs.sourceforge.net/</a><br> +For help please search or post to the bobs-devel mailing list at <a href="http://sourceforge.net/mailarchive/forum.php?forum_id=9561"> +http://sourceforge.net/projects/bobs/</a><br> <br> <h4><a name="8"></a>8. About BOBS.</h4> BOBS was developed as an alternative to traditional tape based backup systems.<br> @@ -105,7 +112,7 @@ - It must be multiplatform (Windows, Linux, Mac).<br> - It must use standard software. No special software should be needed.<br> <br> -BOBS was born. It was named when I put the project on Sourceforge. <br> +BOBS was born. It was named when I <i>(Rene Rask)</i> put the project on Sourceforge. <br> <br> <i>Joe Zacky</i> joined development and made a much improved configuration tool.<br> Later feature additions include NFS and SMB functionality.<br> |
From: Rene R. <ren...@us...> - 2003-12-29 02:49:01
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv26121 Modified Files: look.css Log Message: Fixed css. it had double curly braces in some sections Index: look.css =================================================================== RCS file: /cvsroot/bobs/bobs/look.css,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- look.css 24 Aug 2002 20:33:09 -0000 1.3 +++ look.css 29 Dec 2003 02:48:50 -0000 1.4 @@ -1,10 +1,10 @@ body { color: black; font-style: normal; font-size: 11px; font-family: Verdana, Helvetica, Arial } td { color: #000000; font-size: 11px; font-family: Verdana, Helvetica, Arial } tr { color: #000000; font-size: 11px; font-family: Verdana, Helvetica, Arial } -a:link { color: #000000; text-decoration: none; font-size: 11px; font-family: Verdana, Helvetica, Arial } } -a:visited { color: #000000; text-decoration: none; font-size: 11px; font-family: Verdana, Helvetica, Arial } } -a:hover { color: #000000; text-decoration: underline; font-size: 11px; font-family: Verdana, Helvetica, Arial } } -a:active { color: #000000; text-decoration: none; font-size: 11px; font-family: Verdana, Helvetica, Arial } } +a:link { color: #000000; text-decoration: none; font-size: 11px; font-family: Verdana, Helvetica, Arial } +a:visited { color: #000000; text-decoration: none; font-size: 11px; font-family: Verdana, Helvetica, Arial } +a:hover { color: #000000; text-decoration: underline; font-size: 11px; font-family: Verdana, Helvetica, Arial } +a:active { color: #000000; text-decoration: none; font-size: 11px; font-family: Verdana, Helvetica, Arial } img { border-width: 0px } img { border: 0px } div.instruction {text-align: left; font-size: 14px;} |
From: Rene R. <ren...@us...> - 2003-12-29 02:43:41
|
Update of /cvsroot/bobs/bobs/inc In directory sc8-pr-cvs1:/tmp/cvs-serv25408/inc Modified Files: class_backup.php class_server.php config.php.in Log Message: Adding rsync_ssh backup_method from Jochen Metzger. Added admin help page. Index: class_backup.php =================================================================== RCS file: /cvsroot/bobs/bobs/inc/class_backup.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- class_backup.php 3 Apr 2003 00:23:31 -0000 1.8 +++ class_backup.php 29 Dec 2003 02:43:28 -0000 1.9 @@ -26,6 +26,15 @@ var $session_id = ''; // unique session id var $filelinks = ''; // files that are linked (depend on each other) var $rsync_share = ''; // name of the rsync share + + /* new stuff for rsync_ssh */ + var $rsync_ssh_path = ''; // name of the rsync path on the remote server + // ssh only works with pathes and not share on the remote server + var $rsync_ssh_user = 'root'; // 'root' is default + // user used for connection by ssh + // additional a public (on remote server)/ private key (on backup server) + // pair must be given + var $smb_share = ''; // name of the smb share var $backup_method = ''; // backup method (smb/nfs/rsync) var $restore_method = ''; // restore method (smb/nfs) @@ -59,9 +68,15 @@ $this->password = $vol_conf["password"]; $this->login = $vol_conf["login"]; $this->rsync_share = $vol_conf["rsync_share"]; - $this->restore_method = $vol_conf["restore_method"]; - + /* new stuff for rsync_ssh */ + $this->rsync_ssh_path = $vol_conf["rsync_ssh_path"]; + + /* only use when set, else stay default */ + if (trim($vol_conf["rsync_ssh_user"]) != "") + $this->rsync_ssh_user = $vol_conf["rsync_ssh_user"]; + + $this->restore_method = $vol_conf["restore_method"]; $this->filelinks = parse_ini_file($this->siteroot . '/inc/filelinks.ini', process_sections); @@ -145,6 +160,11 @@ case "rsync": $this->rsync_backup($exclude_from); break; + + case "rsync_ssh": + $this->rsync_ssh_backup($exclude_from); + break; + case "nfs"; $this->nfs_backup($exclude_from); break; @@ -152,7 +172,9 @@ } - + /* classic way -> rsync using an daemon + * which has to run !!! on the remote side (backuped side) + */ function rsync_backup ($exclude_from) { // make backup using rsync @@ -170,7 +192,7 @@ */ // put together the script we need to execute - $backupcommand = 'rsync -e ssh --archive --verbose --delete --backup ' ; + $backupcommand = 'rsync --archive --verbose --delete --backup ' ; $backupcommand .= $exclude_from; $backupcommand .= '--backup-dir="' . $this->incomingdir . '/' . $this->server . '/' . $this->share . '/"' ; @@ -194,6 +216,53 @@ $this->add_queue_command($shell, "bash"); return $result; + } + + + /* rsync_ssh used to backup with rsync over ssh */ + function rsync_ssh_backup($exclude_from){ + + // make backup using rsync over ssh + + // command to run, put ' > /dev/null &' at the end to free the process and block output + + /* + options used for rsync + --archive = archive mode + --verbose = verbose execution + --delete = delete files from backup when deleted on the original site + --backup = make backups + --backup-dir=DIR = move backups into this dir + --exclude-from=FILE = exclude files listed in this file + */ + + // put together the script we need to execute + $backupcommand = 'rsync -e ssh --archive --verbose --delete --backup ' ; + $backupcommand .= $exclude_from; + $backupcommand .= '--backup-dir="' . $this->incomingdir . '/' . $this->server . '/' . $this->share . '/"' ; + + // need to check if we are using IP or DNS!!!! + if ( $this->server_ip != '' ) { + $backupcommand .= ' ' . $this->rsync_ssh_user.'@'.$this->server_ip; + } else { + $backupcommand .= ' ' . $this->rsync_ssh_user.'@'.$this->server; + } + + // only one ":" when we use ssh + $backupcommand .= ':' . $this->rsync_ssh_path . ' "' . $this->backupdir . '/' . $this->server . '/' . $this->share . '/"'; + + $shell = "#!/bin/sh\n"; + $shell .= "# Description: Backup files from server\n"; + $shell .= $backupcommand . "\n"; + + + $this->command = $shell ; + + // add the script to command queue + $this->add_queue_command($shell, "bash"); + + return $result; + } Index: class_server.php =================================================================== RCS file: /cvsroot/bobs/bobs/inc/class_server.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- class_server.php 19 May 2003 00:11:39 -0000 1.6 +++ class_server.php 29 Dec 2003 02:43:28 -0000 1.7 @@ -31,7 +31,8 @@ foreach ( $this->servers as $server ) { $cur_server = $server["server"] . '.' . $server["share"]; - if ( $cur_server == $login_server && $server["password"] == $login_password ) { + if ( $cur_server == $login_server && $server["password"] == $login_password + && $server["restore_method"] != "none") { // not allowed to login, when restore_method == "none" $this->login_ok = 'yes'; $this->config = $server; return; Index: config.php.in =================================================================== RCS file: /cvsroot/bobs/bobs/inc/config.php.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- config.php.in 28 Jun 2003 06:45:49 -0000 1.8 +++ config.php.in 29 Dec 2003 02:43:28 -0000 1.9 @@ -49,13 +49,18 @@ $server_defs["backup_method"]["type"] = "list"; $server_defs["backup_method"]["desc"] = "Method for creating backups"; $server_defs["backup_method"]["list"]["0"] = "rsync"; -$server_defs["backup_method"]["list"]["1"] = "nfs"; -$server_defs["backup_method"]["list"]["2"] = "smb"; +$server_defs["backup_method"]["list"]["1"] = "rsync_ssh"; +$server_defs["backup_method"]["list"]["2"] = "nfs"; +$server_defs["backup_method"]["list"]["3"] = "smb"; + + + $server_defs["restore_method"]["type"] = "list"; $server_defs["restore_method"]["desc"] = "Method for restoring files"; $server_defs["restore_method"]["list"]["0"] = "nfs"; $server_defs["restore_method"]["list"]["1"] = "smb"; +$server_defs["restore_method"]["list"]["2"] = "none"; $server_defs["smb_share"]["type"] = "text"; $server_defs["smb_share"]["desc"] = "Name of the smb share"; @@ -87,6 +92,21 @@ $server_defs["rsync_share"]["depends"]["name"]["0"] = "backup_method"; $server_defs["rsync_share"]["depends"]["value"]["0"] = "rsync"; $server_defs["rsync_share"]["depends"]["rule"]["0"] = TRUE; + + +/* START OF ADDINGS for rsync_ssh */ +$server_defs["rsync_ssh_path"]["type"] = "path"; +$server_defs["rsync_ssh_path"]["desc"] = "Directory on rsync Remote Host to backup (absolute / starting with '/')"; +$server_defs["rsync_ssh_path"]["depends"]["name"]["0"] = "backup_method"; +$server_defs["rsync_ssh_path"]["depends"]["value"]["0"] = "rsync_ssh"; +$server_defs["rsync_ssh_path"]["depends"]["rule"]["0"] = TRUE; + +$server_defs["rsync_ssh_user"]["type"] = "text"; +$server_defs["rsync_ssh_user"]["desc"] = "SSH-Connect with User (use 'root' by default)"; +$server_defs["rsync_ssh_user"]["depends"]["name"]["0"] = "backup_method"; +$server_defs["rsync_ssh_user"]["depends"]["value"]["0"] = "rsync_ssh"; +$server_defs["rsync_ssh_user"]["depends"]["rule"]["0"] = TRUE; +/* END OF ADDINGS for rsync_ssh */ $server_defs["incrementals"]["type"] = "number"; $server_defs["incrementals"]["desc"] = "How many incremental backups to keep (0 = infinite)"; |
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> |
From: Rene R. <ren...@us...> - 2003-12-29 02:43:39
|
Update of /cvsroot/bobs/bobs/winc In directory sc8-pr-cvs1:/tmp/cvs-serv25408/winc Added Files: adminhelp.html Log Message: Adding rsync_ssh backup_method from Jochen Metzger. Added admin help page. --- NEW FILE: adminhelp.html --- <br><br> <div align="center"><big><big><b>Browseable Online Backup System (BOBS)<br> Admin help page<br> </b></big></big></div> <br> <h4>Overview:</h4><br> <a href="#1">1. Explanation of the menus</a><br> <a href="#2">2. Making backups</a><br> <a href="#3">3. Checking BOBS setup</a><br> <a href="#4">4. Adding servers</a><br> <a href="#5">5. Changing server settings</a><br> <a href="#6">6. Changing admin password</a><br> <a href="#7">7. You found a bug in BOBS</a><br> <a href="#8">8. About BOBS</a><br> <br> <h4><a name="1"></a>1. Explanation of the menus.</h4> "<b>Logout</b>" will end this session. Do it when before you leave the computer.<br> "<b>Servers</b>" is where you administer the settings for the servers you create backups off.<br> "<b>Access</b>" is not implemented yet.<br> "<b>Restore</b>" is the user interface for browsing, searching and restoring files from the backup. It has its own help file.<br> "<b>Help</b>" is this help.<br> <br> <h4><a name="2"></a>2. Making backups.</h4> To make a backup you have to create servers. Click the "Servers" tab to do that.<br> There is an example server called "testserver" which you can safely ignore.<br> When you have created a server you should check if the settings are correct. Select the server and click the "Check configuration" button.<br> A new page will appear with information about the check being run. Red text indicates errors. Correct the errors and try again. Repeat until you have no red text.<br> To create a backup you can either wait until the backup is automatically run or you can select the server/share and click "Backup now". <br> "Backup now" is only meant for testing that you can create a succesful backup. <br> <br> <h4><a name="3"></a>3. Check BOBS setup.</h4> Under the "Servers" tab, make sure you have no servers selected, then click "Check Configuration"<br> <br> <h4><a name="4"></a>4. Adding servers.</h4> Fill in "Server name" and "Share name" and click the "Add" button.<br> Special cases:<br> <b>Backup method: rsync_ssh</b><br> This method requires that you follow these additional steps<br> ======<br> 1. <br> Login as root on the BOBS server.<br> <br> 2. <p><i> ssh-keygen -t dsa </i></p> (it can take a while)<br> Press Return (without entering a password) when prompted for passphrase<br> Press Return a 2nd time (without entering a password) when prompted for passphrase a second time ( If additional questions are given always press return without further input)<br> <br> 3.<br> The DSA-pair is created in ~/.ssh/<br> The following files can be found there now:<br> id_dsa (private key - has to remain - and only there - on the BOBS server)<br> id_dsa.pub (public - has to be transfered to all the remote servers you wish to use "rsync_ssh" with )<br> <br> 4. <br> <p><i>cd .ssh</p></i> 5.<br> Now make a sftp connection to remote server as root<br> ( you have to use the same user both on the BOBS server and the remote server )<br> # NOTE: The "remoteserver.com" should be exactly the same as defined in the BOBS setup and in the id_dsa.pub file.<br> # That also applies if you are using IP instead of DNS names and to other places in these steps.<br> <p><i> sftp ro...@re...</i></p> #Now you are prompted for the password:<br> mypassword [ENTER]<br> # Transfer the public key now<br> <p><i>cd .ssh</i></p> put id_dsa.pub # Jump to Shell by just entering "!"<br> <p><i>!</i></p> # Create a file authorized_keys2 or just add a line with the public<br> # key of the BOBS server to it <br> <p><i>cat id_dsa.pub >> authorized_keys2</i></p> # remove the public key - just for nicer clean up<br> <p><i>rm -f id_dsa.pub</i></p> # exit the connection<br> <p><i>exit</i></p> 6.<br> Make a test connection<br> <p><i>ssh ro...@re... </i></p> # you should now not be prompted for the password anymore<br> <br> 7.<br> Everything should work beautifully now<br> <br> REMARK:Doing it this way, only the BOBS server can connect to the<br> remote server BUT NOT vice versa, which is great.<br> <br> <h4><a name="5"></a>5. Changing server settings.</h4> Select the server you want to change and click the "Change" button.<br> <br> <h4><a name="6"></a>6. Changing admin password.</h4> Go to the "Servers" tab and click on the "Change Admin Password" link. <br> <h4><a name="7"></a>7. You found a bug in BOBS.</h4> For help please contact the developers of BOBS on <a href="http://bobs.sourceforge.net/">http://bobs.sourceforge.net/</a><br> <br> <h4><a name="8"></a>8. About BOBS.</h4> BOBS was developed as an alternative to traditional tape based backup systems.<br> The basic thought was something like this:<br> - I need an easy to setup backup system.<br> - It must be able to make backup from several servers and do it every day while keeping incremental files.<br> - Access to the files must be simple enough for anybody to figure out. <br> - I should not have to be contacted because a file is needed.<br> - It must be multiplatform (Windows, Linux, Mac).<br> - It must use standard software. No special software should be needed.<br> <br> BOBS was born. It was named when I put the project on Sourceforge. <br> <br> <i>Joe Zacky</i> joined development and made a much improved configuration tool.<br> Later feature additions include NFS and SMB functionality.<br> <br> For more information on BOBS go the following webpage.<br> <a href="http://bobs.sourceforge.net/">http://bobs.sourceforge.net/</a><br> <br> <br> </body> </html> |
From: Rene R. <ren...@us...> - 2003-12-29 02:43:39
|
Update of /cvsroot/bobs/bobs/inc/templates In directory sc8-pr-cvs1:/tmp/cvs-serv25408/inc/templates Added Files: admin_help.thtml Log Message: Adding rsync_ssh backup_method from Jochen Metzger. Added admin help page. --- NEW FILE: admin_help.thtml --- <!-- rfasttemplate: Server Selection --> {HEADER} {ADMINHELP} </body></html> |
From: Joe Z. <jz...@us...> - 2003-07-01 05:01:47
|
Update of /cvsroot/bobs/bobs/doc In directory sc8-pr-cvs1:/tmp/cvs-serv11259/doc Modified Files: list.php Log Message: Fix list class documentation and example to work with register_globals = on, the default since php 4.2.0. Index: list.php =================================================================== RCS file: /cvsroot/bobs/bobs/doc/list.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- list.php 1 Sep 2002 02:23:38 -0000 1.2 +++ list.php 1 Jul 2003 05:01:43 -0000 1.3 @@ -7,20 +7,16 @@ // the path to class_list.php. // ======================================================================= -if (!include("class_list.php")){ // the list class definition - $thisfile = getenv("DOCUMENT_ROOT") . "$PHP_SELF"; +$PHPSELF = $_SERVER['PHP_SELF']; + +if (!include("inc/class_list.php")){ // the list class definition exit("<hr>The file <b>class_list.php</b> was not found.<br> It is needed for this document to work properly.<br> - It should be in the same directory as this file: $thisfile<br>"); + It should be in the same directory as this file: $PHPSELF<br>"); } -// Uncomment the following line to turn on debug. -$debug = TRUE; - // Start the session -if(!session_is_registered("mylist")) { - session_register("mylist", "mylist2", "mylist3", "mylist4"); // Store $mylist variable in session -} +session_start(); ?> <html> @@ -70,42 +66,41 @@ </pre> <p> In order to reference the <em>selectlist</em> object between web pages, you must create a session. - The variables that will be stored in the session are parameters to the - <em>session_register()</em> function. Note: By default, php stores session variables in - files in the <em>/tmp</em> directory. + The session variables will be stored in a global <em>$_SESSION</em> array. + Note: By default, php stores session variables in files in the <em>/tmp</em> directory. </p> <pre> // Start the session - if(!session_is_registered("mylist")) { - session_register("mylist"); // Store $mylist variable in session - } + session_start(); </pre> <p> You can also end the session. </p> <pre> - session_unregister("mylist"); session_destroy(); </pre> <p> - Create the <em>selectlist</em> object and store it in a variable (<em>$mylist</em> in this case). - Note that the variable must be also specified in the <em>session_register()</em> function. + Create the <em>selectlist</em> object and store it in a session + variable (<em>mylist</em> in this case). </p> <pre> - $mylist = new selectlist("list1"); + $_SESSION['mylist'] = new selectlist("list1"); </pre> <p> - You can also delete the <em>selectlist</em> object by setting the object variable - to another value. + You can also delete the <em>selectlist</em> object by setting the variable + to another value or unsetting it. </p> <pre> - $mylist = ""; + $_SESSION['mylist'] = ""; + or + unset($_SESSION['mylist']); + </pre> -<form action="<?$PHP_SELF?>#section1" method="post"> +<form action="<?PHP $PHPSELF?>#section1" method="post"> <input type="submit" name="button" value="Create selectlist"> <input type="submit" name="button" value="Refresh"> <input type="submit" name="button" value="Delete selectlist"> @@ -113,31 +108,23 @@ <input type="hidden" name="section" value="1"> </form> -<? -if ($section == "1"){ - switch ($button){ +<?PHP +if ($_POST['section'] == "1"){ + switch ($_POST['button']){ case ("Create selectlist"): - $mylist = new selectlist("list1"); + $_SESSION['mylist'] = new selectlist("list1"); break; case ("Delete selectlist"): - $mylist = ""; + unset($_SESSION['mylist']); break; case ("Refresh"): break; case ("End session"): - session_unregister("mylist"); - session_unregister("mylist2"); - session_unregister("mylist3"); - session_unregister("mylist4"); - $mylist = ""; - $mylist2 = ""; - $mylist3 = ""; - unset($mylist4); session_destroy(); break; } } - +$mylist = $_SESSION['mylist']; if (get_class($mylist)){ echo "<pre>\n"; print_r($mylist); echo "</pre>\n"; } else { @@ -158,15 +145,15 @@ function. </p> <pre> - session_register("mylist"); // store list object in session - $mylist = new selectlist("list2"); // create the list object - $mylist->additem("one item"); // add 1 item + $_SESSION['mylist'] = new selectlist("list2"); // store list object in session + $mylist =& $_SESSION['mylist']; // create a convenient variable reference to the session variable + $mylist->additem("one item"); // add 1 item $items = array("banana", "apple", "peach"); - $mylist->additem($items); // add 3 items + $mylist->additem($items); // add 3 items </pre> -<form action="<?$PHP_SELF?>#section2" method="post"> +<form action="<?PHP $PHPSELF?>#section2" method="post"> <input type="submit" name="button" value="Add 1 item"> <input type="submit" name="button" value="Add 3 items"> <input type="submit" name="button" value="Add 5 items"> @@ -174,12 +161,13 @@ <input type="hidden" name="section" value="2"> </form> -<? -if ($section == "2"){ - if (!get_class($mylist2)) { // create list if not exist - $mylist2 = new selectlist("list2"); +<?PHP +if ($_POST['section'] == "2"){ + if (!get_class($_SESSION['mylist2'])) { // create list if not exist + $_SESSION['mylist2'] = new selectlist("list2"); } - switch ($button){ // Add items to the list + $mylist2 =& $_SESSION['mylist2']; // create convenient reference + switch ($_POST['button']){ // Add items to the list case ("Add 1 item"): $mylist2->additem("one item"); break; @@ -217,8 +205,9 @@ table within a form. Just echo the output of <em>gethtml()</em>. </p> <pre> - session_register("mylist"); // store list object in session - $mylist = new selectlist("list3"); // Create the selectlist object + $_SESSION['mylist'] = new selectlist("list"); + // Create and store list object in session + $mylist =& $_SESSION['mylist']; // create convenient reference $mylist->setadd(); // Show the "Add" button $mylist->setchange(); // Show the "Change" button $mylist->setdelete(); // Show the "Delete" button @@ -240,18 +229,19 @@ // 1 array of values $mylist->additem("Santana"); // A single value - $html = $mylist->gethtml($PHP_SELF); // Generate the html + $html = $mylist->gethtml($_SERVER['PHPSELF']); // Generate the html echo "$html"; // Output the html </pre> -<form action="<?$PHP_SELF?>#section3" method="post"> +<form action="<?PHP $PHPSELF?>#section3" method="post"> <input type="submit" name="button" value="Show html code"> <input type="hidden" name="section" value="3"> </form> -<? -if (!get_class($mylist3)) { // Create list if not exist - $mylist3 = new selectlist("list3"); +<?PHP +if (!get_class($_SESSION['mylist3'])) { // Create list if not exist + $_SESSION['mylist3'] = new selectlist("list3"); + $mylist3 =& $_SESSION['mylist3']; $mylist3->setadd(); // Show the "Add" button $mylist3->setchange(); // Show the "Change" button $mylist3->setdelete(); // Show the "Delete" button @@ -271,11 +261,12 @@ $mylist3->additem(array("Fontana", "nirvana")); $mylist3->additem("Santana"); } -$url = "$PHP_SELF" . "#section3"; +$url = "$PHPSELF" . "#section3"; +$mylist3 =& $_SESSION['mylist3']; $html = $mylist3->gethtml($url); // Generate the html -if ($section == "3"){ - switch ($button){ // "Show html code" button pressed +if ($_POST['section'] == "3"){ + switch ($_POST['button']){ // "Show html code" button pressed case ("Show html code"): $htmlcode = htmlspecialchars($html); echo "\n<pre>\n"; @@ -302,10 +293,10 @@ Functions are provided to process the information from the list form. Briefly, they are: <pre> - $selectlist['name'] Hidden form field containg the list name. - getname Get the name of the list. - getaction Get the value of the button pressed. - getvalue Get the values of the selected list items. + $_POST['selectlist']['name'] Hidden form field containg the list name. + getname Get the name of the list. + getaction Get the value of the button pressed. + getvalue Get the values of the selected list items. </pre> All the list information is contained in an array named <em>selectlist[].</em> by passing the <em>selectlist[]</em> array @@ -326,6 +317,8 @@ <pre> This is the code this example uses to add the items to the list when you click "Add". + $selectlist =& $_POST['selectlist']; // Create local references for convenience + $mylist =& $_SESSION['mylist']; if ($selectlist['name'] == 'list4'){ // if mylist4 object exists switch ($mylist->getaction($selectlist)){ // switch is "action" button case ("Add"): // If "Add" button pressed @@ -339,18 +332,20 @@ } </pre> -<? -if ($selectlist['name'] == 'list4'){ // if mylist4 is the active list - switch ($mylist4->getaction($selectlist)){ +<?PHP +if ($_POST['selectlist']['name'] == 'list4'){ // if mylist4 is the active list + $mylist4 =& $_SESSION['mylist4']; // Reference with local variable + switch ($mylist4->getaction($_POST['selectlist'])){ case ("Add"): - $value = $mylist4->getvalue($selectlist); + $value = $mylist4->getvalue($_POST['selectlist']); $mylist4->additem($value[0]); break; } } -if (!get_class($mylist4)) { - $mylist4 = new selectlist("list4"); // Create list if not exist +if (!get_class($_SESSION['mylist4'])) { + $_SESSION['mylist4'] = new selectlist("list4"); // Create list if not exist + $mylist4 =& $_SESSION['mylist4']; // Reference with local variable $mylist4->setadd(); // Show the "Add" button $mylist4->setchange(); // Show the "Change" button $mylist4->setdelete(); // Show the "Delete" button @@ -366,7 +361,9 @@ $mylist4->additem("Montana", "The state of Montana"); $mylist4->additem(array("red planet", "green martians", "blue sea", "outer space")); } -$url = "$PHP_SELF" . "#section4"; +$mylist4 =& $_SESSION['mylist4']; // Reference with local variable +$selectlist = $_POST['selectlist']; // Reference with local variable +$url = "$PHPSELF" . "#section4"; $html = $mylist4->gethtml($url); // Generate the html // table will contain list form and output of functions @@ -619,7 +616,7 @@ <hr> <pre> -string <b>gethtml</b> ( string $PHP_SELF ) +string <b>gethtml</b> ( string $_SERVER['PHPSELF'] ) <b>Description</b> @@ -627,9 +624,10 @@ <b>Parameters</b> - $PHP_SELF Required for the form "action". + $_SERVER['PHPSELF'] + Required for the form "action". You can substitute the web page url another way, - but using $PHP_SELF is easy. + but using $_SERVER['PHPSELF'] is easy. <b>Returns</b> @@ -697,4 +695,19 @@ </body> </html> + +<?php +//--------------------------------------------------------------------------- +// Functions +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Print a variable for debug +function dump($var, $text = ""){ + echo "\n<pre>*********************************************\n"; + echo "$text \n"; + var_dump($var); + echo "\n</pre>*********************************************\n"; +} +?> |
From: Joe Z. <jz...@us...> - 2003-06-28 06:45:54
|
Update of /cvsroot/bobs/bobs/inc In directory sc8-pr-cvs1:/tmp/cvs-serv24020/inc Modified Files: config.php.in Log Message: Change text of "share" input field to show it's a name, not a description. Index: config.php.in =================================================================== RCS file: /cvsroot/bobs/bobs/inc/config.php.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- config.php.in 8 May 2003 05:46:51 -0000 1.7 +++ config.php.in 28 Jun 2003 06:45:49 -0000 1.8 @@ -32,7 +32,7 @@ $server_defs["server"]["desc"] = "Network name of computer to be backed up"; $server_defs["share"]["type"] = "text"; -$server_defs["share"]["desc"] = "Descriptive name of the shared directory to be backed up"; +$server_defs["share"]["desc"] = "Name of shared directory to be backed up"; $server_defs["active"]["type"] = "checkbox"; $server_defs["active"]["desc"] = "Create backups of this server"; |
From: Joe Z. <jz...@us...> - 2003-06-28 06:45:54
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv24020 Modified Files: admin.php Log Message: Change text of "share" input field to show it's a name, not a description. Index: admin.php =================================================================== RCS file: /cvsroot/bobs/bobs/admin.php,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- admin.php 19 May 2003 00:11:39 -0000 1.23 +++ admin.php 28 Jun 2003 06:45:49 -0000 1.24 @@ -174,7 +174,7 @@ $serverlist->addbutton("Backup Now"); // Backup selected server now button $serverlist->addinput("Server name : ", 20); // Input fields for "Add" button - $serverlist->addinput("Share description : ", 20); + $serverlist->addinput("Share name : ", 20); // Load the list of servers if (is_array($servercfg->servers)){ // in case there's no servers defined yet |
From: Joe Z. <jz...@us...> - 2003-06-22 23:50:42
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv24324 Modified Files: bobs.spec configure.in configure Log Message: Prepare for release 0.6.0 Index: bobs.spec =================================================================== RCS file: /cvsroot/bobs/bobs/bobs.spec,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- bobs.spec 4 May 2003 19:51:59 -0000 1.4 +++ bobs.spec 22 Jun 2003 23:50:34 -0000 1.5 @@ -1,6 +1,6 @@ Summary: Browseable Online Backup System (BOBS). Name: bobs -Version: 0.6.0pre2 +Version: 0.6.0 Release: 1 License: GPL Group: Applications/Archiving @@ -73,7 +73,7 @@ /var/bobsdata %changelog -* Fri Mar 21 2003 Joe Zacky <jz...@at...> -- Make this work with existing install scripts. +* Sun Jun 22 2003 Joe Zacky <jz...@at...> +- Release 0.6.0 * Tue Oct 15 2002 Rene Rask <re...@gr...> - Initial RPM release. Index: configure.in =================================================================== RCS file: /cvsroot/bobs/bobs/configure.in,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- configure.in 8 May 2003 05:46:51 -0000 1.13 +++ configure.in 22 Jun 2003 23:50:34 -0000 1.14 @@ -13,13 +13,13 @@ dnl> 02-03-2003 Provide destination for crontab for 'make rpm'. PACKAGE=bobs -VERSION=0.6.0pre2 +VERSION=0.6.0 dnl> dnl> Verify we're in the right directory by looking for a unique file. dnl> -AC_INIT(bobs, 0.6.0pre2) +AC_INIT(bobs, 0.6.0) AC_CONFIG_SRCDIR(admin.php) AM_INIT_AUTOMAKE Index: configure =================================================================== RCS file: /cvsroot/bobs/bobs/configure,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- configure 8 May 2003 05:46:51 -0000 1.11 +++ configure 22 Jun 2003 23:50:34 -0000 1.12 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for bobs 0.6.0pre2. +# Generated by GNU Autoconf 2.57 for bobs 0.6.0. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -266,8 +266,8 @@ # Identity of this package. PACKAGE_NAME='bobs' PACKAGE_TARNAME='bobs' -PACKAGE_VERSION='0.6.0pre2' -PACKAGE_STRING='bobs 0.6.0pre2' +PACKAGE_VERSION='0.6.0' +PACKAGE_STRING='bobs 0.6.0' PACKAGE_BUGREPORT='' ac_unique_file="admin.php" @@ -721,7 +721,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bobs 0.6.0pre2 to adapt to many kinds of systems. +\`configure' configures bobs 0.6.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -783,7 +783,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bobs 0.6.0pre2:";; + short | recursive ) echo "Configuration of bobs 0.6.0:";; esac cat <<\_ACEOF @@ -856,7 +856,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -bobs configure 0.6.0pre2 +bobs configure 0.6.0 generated by GNU Autoconf 2.57 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @@ -871,7 +871,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bobs $as_me 0.6.0pre2, which was +It was created by bobs $as_me 0.6.0, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ @@ -1462,7 +1462,7 @@ # Define the identity of the package. PACKAGE=bobs - VERSION=0.6.0pre2 + VERSION=0.6.0 cat >>confdefs.h <<_ACEOF @@ -2165,7 +2165,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by bobs $as_me 0.6.0pre2, which was +This file was extended by bobs $as_me 0.6.0, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2220,7 +2220,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -bobs config.status 0.6.0pre2 +bobs config.status 0.6.0 configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" |
From: Joe Z. <jz...@us...> - 2003-06-22 23:17:17
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv20612 Modified Files: ChangeLog Log Message: Prepare to release 0.6.0 Index: ChangeLog =================================================================== RCS file: /cvsroot/bobs/bobs/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ChangeLog 19 May 2003 00:11:38 -0000 1.12 +++ ChangeLog 22 Jun 2003 23:17:14 -0000 1.13 @@ -3,6 +3,17 @@ Version ? (edit as you go) +Version 0.6.0 + -- 5-10-2003 + Convert admin.php to use rfasttemplate class. + -- 5-17-2003 + Restructure admin.php to add some basic input validation. + -- 5-18-2003 bug fix + Special characters in samba passwords are now quoted in the + ini file and the smbmount command. + -- 5-26-2003 bug fix + Sort by date causes "select for restore" error. + Version 0.6.0pre2 Rene Rask (re...@gr...) -- Bug fix 4-02-2003 @@ -22,13 +33,6 @@ bobs data directory (/var/bobsdata). I fixed this bug after deleting 3 years of my kid's homework. 'make uninstall' also kills the cmdloop script. - -- 5-10-2003 - Convert admin.php to use rfasttemplate class. - -- 5-17-2003 - Restructure admin.php to add some basic input validation. - -- 5-18-2003 bug fix - Special characters in samba passwords are now quoted in the - ini file and the smbmount command. Version 0.6.0pre1 Rene Rask (re...@gr...) |
From: Rene R. <ren...@us...> - 2003-05-26 15:33:01
|
Update of /cvsroot/bobs/bobs/inc In directory sc8-pr-cvs1:/tmp/cvs-serv13573/inc Modified Files: class_files.php Log Message: This fixes the "sort files" error in the files view. Bug ID: 708499 Index: class_files.php =================================================================== RCS file: /cvsroot/bobs/bobs/inc/class_files.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- class_files.php 29 Oct 2002 03:15:42 -0000 1.6 +++ class_files.php 26 May 2003 15:30:20 -0000 1.7 @@ -12,6 +12,7 @@ var $data = ''; // input data var $sort = ''; // what should files be sorted by (name|namerev|size|sizerev|date|daterev) var $config; + var $where; function files ($config) { @@ -31,6 +32,8 @@ // $string defines the path to show files for // $where defines which db to search. + + $this->where = $where; //create a new database object $db = new database($this->config); @@ -214,7 +217,7 @@ $html .= '<img src=images/bar/bar_name.gif>'; $html .= '<img src=images/bar/bar_spacer.gif height="19" width="25">'; - $link = '<a href=files.php?show=&sort='; + $link = '<a href=files.php?show=&where=' . $this->where .'&sort='; if ( $this->sort == 1 ) { $link .= 'namerev><img src=images/bar/arrow_selected_down.gif>'; } elseif ( $this->sort == 4 ) { @@ -240,7 +243,7 @@ $html .= '<img src=images/bar/bar_size.gif>'; $html .= '<img src=images/bar/bar_spacer.gif height="19" width="25">'; - $link = '<a href=files.php?show=&sort='; + $link = '<a href=files.php?show=&where=' . $this->where .'&sort='; if ( $this->sort == 3 ) { $link .= 'sizerev><img src=images/bar/arrow_selected_up.gif>'; } elseif ( $this->sort == 6 ) { @@ -264,7 +267,7 @@ $html .= '<img src=images/bar/bar_spacer.gif height="19" width="20">'; $html .= '<img src=images/bar/bar_date.gif>'; $html .= '<img src=images/bar/bar_spacer.gif height="19" width="25">'; - $link = '<a href=files.php?show=&sort='; + $link = '<a href=files.php?show=&where=' . $this->where .'&sort='; if ( $this->sort == 2 ) { $link .= 'daterev><img src=images/bar/arrow_selected_up.gif>'; } elseif ( $this->sort == 5 ) { |
From: Rene R. <ren...@us...> - 2003-05-26 13:38:35
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv25541 Modified Files: tree.php Log Message: Added a check for being in the http root Index: tree.php =================================================================== RCS file: /cvsroot/bobs/bobs/tree.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tree.php 26 Oct 2002 02:01:35 -0000 1.5 +++ tree.php 26 May 2003 13:38:31 -0000 1.6 @@ -24,8 +24,14 @@ $config["where"] = $_GET['where']; } -$treehref = dirname($_SERVER['PHP_SELF']) . "/tree.php"; -$filehref = dirname($_SERVER['PHP_SELF']) . "/files.php"; +// Make sure we don't get "//" in the start of the path +$location = dirname($_SERVER['PHP_SELF']); +if ( $location == '/' ) { + $location = ""; +} +$treehref = $location . "/tree.php"; +$filehref = $location . "/files.php"; + // target frame $target = "files"; |
From: Joe Z. <jz...@us...> - 2003-05-19 00:11:42
|
Update of /cvsroot/bobs/bobs/inc/templates In directory sc8-pr-cvs1:/tmp/cvs-serv19698/bobs/inc/templates Added Files: admin_login.thtml confirm_server.thtml select_server.thtml server_details.thtml Log Message: Allow special characters in passwords. --- NEW FILE: admin_login.thtml --- <!-- rfasttemplate: Admin Login --> {HEADER} <center><h2> Administrator Login </h2></center> <div class="errmsg">{ERRMSG}</div> <div class="instruction"> Type the BOBS administrator password and click OK.</div> <br> <form name="admin_login" action="{PHPSELF}" method="post"> <input type="hidden" name="form_name" value="login"> <table align="center" border="{BORDER}" > <tbody> <tr> <td align="right"><p><big>BOBS administrator password: </big></td> <td align="left"><input type="password" name="password"></td> </tr> <tr> <td align="center" colspan="2"> <br><input type="submit" name="login_button_OK" value="OK"></td> </tr> </tbody> </table> </form> </body></html> --- NEW FILE: confirm_server.thtml --- <!-- rfasttemplate: Confirm Server Settings --> {HEADER} <center><h2>Confirm Server Settings</h2></center> <table align="center" width="90%" border="{BORDER}"> <tr> <td><div class="instruction">Verify the settings are correct before you save.</div> </td> <td><div class="servermode">Mode: <b>{MODE}</b></div> </td> </tr> <tr> <table align="center" border="{BORDER}"><tbody> <tr> <td align = "center"> <form name="confirm_settings" method="POST"> <input type="hidden" name="form_name" value="confirm_settings"> <!-- BEGIN DYNAMIC BLOCK: detail --> {NAME} = {VALUE} <br> <!-- END DYNAMIC BLOCK: detail --> <input type="hidden" name="mode_name" value="{MODE}"> <br> <input type="submit" name="commit_changes" value="Confirm {MODE}"> </p> </form> </td> </tr> </tbody></table> </tr> </tbody></table> </body> </html> --- NEW FILE: select_server.thtml --- <!-- rfasttemplate: Server Selection --> {HEADER} <center><h2>Server Selection</h2></center> <div class="errmsg">{ERRMSG}</div> <p><div class="instruction">Select a server to Change or Delete, or type the name of a new Server/Share and click Add</div></p> <center> {SELECTLIST} </center> <a href="chgadminpwd.php">Change Admin Password</a> </body></html> --- NEW FILE: server_details.thtml --- <!-- rfasttemplate: Edit Server --> {HEADER} <center><h2>Server Details</h2></center> <div class="errmsg">{ERRMSG}</div> <table align="center" width="90%" border="{BORDER}"> <tr> <td><div class="instruction">Type the server information and click OK.</div> </td> <td><div class="servermode">Mode: <b>{MODE}</b></div> </td> </tr> <table border="{BORDER}" cellspacing="2" cellpadding="2" align="center"> <tbody> <form action="{PHPSELF}" method="post"> <input type="hidden" name="form_name" value="server_details"> {DETAILS} <tr> <td align="center" colspan="2"> <br> <input type="submit" name="server_details_OK" value="Next"> <!-- Save the server/share key in hidden screen fields --> <input type="hidden" name="server_key" value="{SERVERKEY}"> <input type="hidden" name="server_name" value="{SERVER}"> <input type="hidden" name="share_name" value="{SHARE}"> <input type="hidden" name="mode_name" value="{MODE}"> </td> </form> </tbody> </table> </body> </html> |
From: Joe Z. <jz...@us...> - 2003-05-19 00:11:42
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv19698/bobs Modified Files: ChangeLog TODO admin.php Log Message: Allow special characters in passwords. Index: ChangeLog =================================================================== RCS file: /cvsroot/bobs/bobs/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChangeLog 18 May 2003 06:37:41 -0000 1.11 +++ ChangeLog 19 May 2003 00:11:38 -0000 1.12 @@ -26,6 +26,9 @@ Convert admin.php to use rfasttemplate class. -- 5-17-2003 Restructure admin.php to add some basic input validation. + -- 5-18-2003 bug fix + Special characters in samba passwords are now quoted in the + ini file and the smbmount command. Version 0.6.0pre1 Rene Rask (re...@gr...) Index: TODO =================================================================== RCS file: /cvsroot/bobs/bobs/TODO,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- TODO 18 May 2003 06:37:41 -0000 1.18 +++ TODO 19 May 2003 00:11:39 -0000 1.19 @@ -29,7 +29,7 @@ Add security. Priority: Medium Backup directories (/var/bobsdata/) should not be world readable. - Encrypt passwords. + Encrypt passwords, but what if they need to be sent in plain text? User and group administration Priority: Medium Index: admin.php =================================================================== RCS file: /cvsroot/bobs/bobs/admin.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- admin.php 18 May 2003 06:37:41 -0000 1.22 +++ admin.php 19 May 2003 00:11:39 -0000 1.23 @@ -398,7 +398,7 @@ $html .= parse_edit_type( // convert server config field to html $name, // name - $servercfg->config["$name"], // value + $servercfg->config["$name"], // value $io, // input/output mode $server_defs); // server field definitions } |
From: Joe Z. <jz...@us...> - 2003-05-19 00:11:42
|
Update of /cvsroot/bobs/bobs/inc In directory sc8-pr-cvs1:/tmp/cvs-serv19698/bobs/inc Modified Files: class_server.php Log Message: Allow special characters in passwords. Index: class_server.php =================================================================== RCS file: /cvsroot/bobs/bobs/inc/class_server.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class_server.php 18 May 2003 06:37:41 -0000 1.5 +++ class_server.php 19 May 2003 00:11:39 -0000 1.6 @@ -183,10 +183,9 @@ fputs($fp, $header); // Create the .ini file - foreach ( $this->config as $name => $value ) { // careate 'name = value' pairs - $ini_conf .= $name . ' = ' . $value . "\n"; + foreach ( $this->config as $name => $value ) { // create 'name = value' pairs + $ini_conf .= $name . ' = "' . $value . "\"\n"; } - fputs($fp, $ini_conf); // write it to disk fclose($fp); } @@ -226,8 +225,8 @@ break; case 'smb': $mntcmd = 'smbmount "//' . $server_handle . '/' . $this->config['smb_share'] . '" "' . $mountdir . '" -o username=' . - $this->config['login'] . ',password=' . $this->config['password'] . - ' &>/dev/null'; + $this->config['login'] . ',password=\'' . $this->config['password'] . + '\' &>/dev/null'; break; case 'nfs': $mntcmd = 'mount -t nfs ' . '"' . $server_handle . ':' . $this->config['nfs_share'] . '" "' . $mountdir . '"'; |
From: Joe Z. <jz...@us...> - 2003-05-18 06:37:44
|
Update of /cvsroot/bobs/bobs/inc In directory sc8-pr-cvs1:/tmp/cvs-serv9236/bobs/inc Modified Files: class_server.php gui.pinc header.pinc Log Message: Convert admin.php to use rfasttemplate class Restructure admin.php to add some basic input validation. Index: class_server.php =================================================================== RCS file: /cvsroot/bobs/bobs/inc/class_server.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class_server.php 8 May 2003 05:46:51 -0000 1.4 +++ class_server.php 18 May 2003 06:37:41 -0000 1.5 @@ -171,7 +171,7 @@ // build the config file name $configfile = $this->serverdir . $this->config["server"] . '.' . $this->config["share"] . '.ini'; - if ($mode == "delete"){ // delete the config + if ($mode == "Delete"){ // delete the config unlink($configfile); } else { // add/update the config Index: gui.pinc =================================================================== RCS file: /cvsroot/bobs/bobs/inc/gui.pinc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gui.pinc 1 Sep 2002 02:25:04 -0000 1.2 +++ gui.pinc 18 May 2003 06:37:41 -0000 1.3 @@ -11,7 +11,7 @@ $type = $server_defs["$name"]["type"]; // field type $desc = $server_defs["$name"]["desc"]; // field description - $html = "<tr><td align=\"right\">$desc</td>\n"; // left side description + $html = "<tr><td align=\"right\">$desc: </td>\n"; // left side description $html .= "<td>\n"; switch ( $type ) { @@ -60,7 +60,7 @@ if ($io == 'i'){ $html = "<input type=\"text\" name=\"settings[$name]\" value=\"$value\">\n"; } else { - $html = "$value <input type=\"hidden\" name=\"settings[$name]\" value=\"$value\">\n"; + $html = "<b>$value</b> <input type=\"hidden\" name=\"settings[$name]\" value=\"$value\">\n"; } return $html; } Index: header.pinc =================================================================== RCS file: /cvsroot/bobs/bobs/inc/header.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- header.pinc 26 Apr 2003 22:39:43 -0000 1.6 +++ header.pinc 18 May 2003 06:37:41 -0000 1.7 @@ -9,19 +9,19 @@ <table width="100%" border="0" align="center" cellspacing="2" cellpadding="2"> <tr> <td align="center" bgcolor="#707070" width="20%"> - <a href=admin.php?menu_logout=1> + <a href=admin.php?menu=logout> <img src="images/menu/menu_logout.png" border="0"></a></td> <td align="center" bgcolor="#707070" width="20%"> - <a href=admin.php?menu_servers=1> + <a href=admin.php?menu=servers> <img src="images/menu/menu_servers.png" border="0"></a></td> <td align="center" bgcolor="#707070" width="20%"> - <a href=admin.php?menu_access=1> + <a href=admin.php?menu=access> <img src="images/menu/menu_access.png" border="0"></a></td> <td align="center" bgcolor="#707070" width="20%"> - <a href=admin.php?menu_bobs=1> + <a href=admin.php?menu=bobs> <img src="images/menu/menu_restore.png" border="0"></a></td> <td align="center" bgcolor="#707070" width="20%"> - <a href=admin.php?menu_help=1> + <a href=admin.php?menu=help> <img src="images/menu/menu_help.png" border="0"></a></td> </tr> </table> |
From: Joe Z. <jz...@us...> - 2003-05-18 06:37:44
|
Update of /cvsroot/bobs/bobs/inc/templates In directory sc8-pr-cvs1:/tmp/cvs-serv9236/bobs/inc/templates Modified Files: chgadminpwd.thtml Log Message: Convert admin.php to use rfasttemplate class Restructure admin.php to add some basic input validation. Index: chgadminpwd.thtml =================================================================== RCS file: /cvsroot/bobs/bobs/inc/templates/chgadminpwd.thtml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- chgadminpwd.thtml 8 May 2003 05:46:51 -0000 1.1 +++ chgadminpwd.thtml 18 May 2003 06:37:41 -0000 1.2 @@ -6,6 +6,8 @@ <div class="errmsg">{ERRMSG}</div> <form action="{PHPSELF}" method="post"> + <input type="hidden" name="form_name" value="chgadminpwd"> + <table align="center" border="0" > <tbody> <tr> @@ -17,9 +19,6 @@ <tr> <td align="right"><p>new password (again): </td> <td align="left"><input type="password" name="newpwd2"></td> - - <!-- pressing Enter will not set "chg_pwd_OK", but this will--> - <td align="left"><input type="hidden" name="chg_pwd_OK" value="OK"></td> </tr> <tr> <td align="center" colspan="2"> |
From: Joe Z. <jz...@us...> - 2003-05-18 06:37:44
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv9236/bobs Modified Files: ChangeLog TODO admin.php Log Message: Convert admin.php to use rfasttemplate class Restructure admin.php to add some basic input validation. Index: ChangeLog =================================================================== RCS file: /cvsroot/bobs/bobs/ChangeLog,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ChangeLog 9 May 2003 05:39:53 -0000 1.10 +++ ChangeLog 18 May 2003 06:37:41 -0000 1.11 @@ -22,6 +22,10 @@ bobs data directory (/var/bobsdata). I fixed this bug after deleting 3 years of my kid's homework. 'make uninstall' also kills the cmdloop script. + -- 5-10-2003 + Convert admin.php to use rfasttemplate class. + -- 5-17-2003 + Restructure admin.php to add some basic input validation. Version 0.6.0pre1 Rene Rask (re...@gr...) Index: TODO =================================================================== RCS file: /cvsroot/bobs/bobs/TODO,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- TODO 9 May 2003 05:39:53 -0000 1.17 +++ TODO 18 May 2003 06:37:41 -0000 1.18 @@ -53,6 +53,7 @@ Priority: High It's important to know if the systems are getting backed up properly each day. + Have backups write to optional log file. How is /bobsdata going to get cleaned up? Priority: Medium @@ -60,12 +61,6 @@ Write man/info pages Priority: Low - -Add "Backup Now" button under "Check Configuration" button. - Priority: Medium - This will add the final touch to testing the server setup - and allow people to run backups on demand. - Use interprocess communication like systemcheck.php does. --- End of Murray's Suggestions --- ----- WISHLIST ------ Index: admin.php =================================================================== RCS file: /cvsroot/bobs/bobs/admin.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- admin.php 10 May 2003 17:38:52 -0000 1.21 +++ admin.php 18 May 2003 06:37:41 -0000 1.22 @@ -2,12 +2,6 @@ // BOBS Administration Interface -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_config.php"); // configuration class require_once("inc/class_admin.php"); // admin configuration class require_once("inc/class_server.php"); // admin configuration class @@ -18,7 +12,7 @@ // Logout selected, close the session -if (isset($_GET['menu_logout'])){ +if ($_GET['menu'] == 'logout'){ session_start(); session_unregister("admin"); session_unregister("serverlist"); @@ -43,9 +37,10 @@ $serverlist = &$_SESSION['serverlist']; // Uncomment the following line for debugging -//$debug = 1; -// disable debug for now. It's not safe to do it this way, since user can add $debug without even logging in. (it reveals all passwords!) -unset($debug); +// $debug = 1; +// disable debug for now. It's not safe to do it this way +// since user can add $debug without even logging in. (it reveals all passwords!) +// unset($debug); // Table border variable. Set to 1 for testing, otherwise set to 0. if (isset($debug)) { @@ -54,104 +49,77 @@ $tableborder = "0"; } -// Don't output http header if going to redirect web page -// Yes, this is sloppy. +// ------------------ +// Main Control Loop +// ------------------ -if (! ($_POST['selectlist']['action'] == "Check Configuration") ){ - include_once("inc/header.pinc"); -} +// There are 3 types of fields controlling program flow. +// GET['menu_...'] Menu items from the menu on the header of the page. +// form_name A hidden field on each form. +// selectlist[name] The hidden field on forms built by the selectlist class. +// And overriding all of them is if admin is not logged in. -// ---------------------- -// Display error message -// ---------------------- -// $admin->puterrmsg(); +if ($admin->check_admin($_POST['password']) != "yes"){ + admin_login(); // --- Don't proceed further if not logged in + exit; +} -// ------------------ -// Main control loop -// ------------------ -switch (TRUE) { -// case ($admin->iserror()): // FIXME: Error message is set -// $admin->puterrmsg(); -// break; - case (isset($_GET['menu_logout'])): // logout button pressed - case ($admin->check_admin($_POST['password']) != "yes"): // not logged in - admin_login(); // login screen - break; - case (isset($_GET['menu_servers'])): // servers button pressed - case (isset($_POST['login_button_OK'])): // login OK button pressed - select_server(); // Server selection screen +switch ($_GET['menu']){ // --- A menu button was pressed +case ('bobs'): + $bobsdir = dirname($_SERVER['PHP_SELF']); + header("Location: $bobsdir"); // Redirect browser to BOBS main index + exit; // Make sure that code below does not get executed + break; +case ('help'): + echo "Help function is not yet implemented."; + break; +case ('logout'): + admin_login(); // Build login screen + break; +case ('servers'): + select_server(""); // Build server selection screen + break; +case ('access'): + echo "Access function is not yet implemented."; + break; +default: + switch ($_POST['form_name']){ // --- A form needs to be processed + case ('login'): // Just logged in + select_server(""); // Build server selection screen break; - case ($_POST['selectlist']['name'] == "serverlist"): // Server list form action - $itemval = $serverlist->getvalue($_POST['selectlist']); // Get value of selected item - list($server_key, $server_name, $share_name)= split(",", $itemval[0], 3); - switch ($serverlist->getaction($_POST['selectlist'])) { - case ("Add"): // Create server button pressed - $servercfg->init_new_server($itemval[0], $itemval[1]); - // Init fields for new server - edit_server("create", $itemval[0], $itemval[1], $_POST['settings']); - // Server detail: create mode - break; - case ("Change"): // Change server button pressed - edit_server("change", $server_name, $share_name, $_POST['settings']); - // Server detail: change mode - break; - case ("Delete"): // Delete server button pressed - edit_server("delete", $server_name, $share_name, $_POST['settings']); - // Server detail: delete mode - break; - case ("Check Configuration"): // Test server config - $bobsdir = dirname($_SERVER['PHP_SELF']); - header("Location: $bobsdir/systemcheck.php?server=$server_name&share=$share_name"); - // Redirect browser - exit; - break; - case ("Backup Now"): // Run selected backup now - if(isset($server_name)){ - backup_now($server_name, $share_name); - } - break; - } - break; - case (isset($_POST['edit_server_OK'])): // On edit server detail already - if (changed($_POST['settings']) == TRUE){ // screen settings changed - edit_server($_POST['mode_name'], $_POST['server_name'], $_POST['share_name'], $_POST['settings']); - // redisplay edit server detail screen - } else { // screen settings did not change - confirm_server($_POST['server_name'], $_POST['share_name'], $_POST['mode_name'], $_POST['settings']); - // confirm server changes screen - } + case ('server_details'): // Did something on the server details screen + process_server_details(); break; - case (isset($_POST['save_changes'])): // Commit the server changes to disk + case ('confirm_settings'): // Pressed Confirm on confirm settings screen $servercfg->commit_changes($_POST['mode_name']); - select_server(); // Back to server selection screen + select_server(""); // Back to server selection screen break; default: - echo "That function is not yet implemented."; + switch ($_POST['selectlist']['name']){ + // --- A selection list form needs processing + case ('serverlist'): // Did something on the server list screen + process_serverlist($_POST['selectlist']); + // Process the serverlist screen + break; + default: + admin_login(); // Last default: login screen + break; + } break; + } + break; } // TEST: For testing if (isset($debug)){ - echo "menu_logout:" . $menu_logout . "<br>\n"; - echo "menu_servers:" . $menu_servers . "<br>\n"; - echo "menu_access:" . $menu_access . "<br>\n"; - echo "menu_bobs:" . $menu_bobs . "<br>\n"; - echo "menu_help:" . $menu_help . "<br>\n"; - echo "login_button_OK:" . $login_button_OK . "<br>\n"; - echo "edit_servers:" . $edit_servers . "<br>\n"; - echo "create_server:" . $create_server . "<br>\n"; - echo "change_server:" . $change_server . "<br>\n"; - echo "delete_server:" . $delete_server . "<br>\n"; - echo "edit_server_OK:" . $edit_server_OK . "<br>\n"; - echo "server_key:" . $server_key . "<br>\n"; - echo "<pre>"; print_r($admin); echo "</pre>"; - echo "<pre>"; print_r($servercfg); echo "</pre>"; - echo "<hr>settings:<br><pre>"; print_r($settings); echo "</pre>"; - echo "<hr>selectlist[]:<br><pre>"; print_r($selectlist); echo "</pre>"; - echo "<hr>serverlist:<br><pre>"; print_r($serverlist); echo "</pre>"; + $form_fields = array_keys($HTTP_GET_VARS); + echo "*** FORM FIELDS ***<br>"; + print_r($form_fields); + $post_fields = array_keys($HTTP_POST_VARS); + echo "*** POST FIELDS ***<br>"; + print_r($post_fields); } -echo "</body></html>\n"; return; // ---------------------------------------------------------------- @@ -160,58 +128,44 @@ function admin_login(){ // variables outside scope of this function need to be declared as global - global $tableborder; - $PHP_SELF = $_SERVER['PHP_SELF']; -?> - <center><h2> Administrator Login </h2></center> - <div class="instruction"> - Type the BOBS administrator password and click OK.</div> - <br> -<?php - echo "<form action=\"$PHP_SELF\" method=\"post\">\n"; -?> - <table align="center" border="<?php echo "$tableborder"; ?>" > - <tbody> - <tr> - <td align="right"><p><big>BOBS administrator password: </big></td> - <td align="left"><input type="password" name="password"></td> - <!-- pressing Enter will not set "login_button_OK", but this will--> - <td align="left"><input type="hidden" name="login_button_OK" value="OK"></td> - </tr> - <tr> - <td align="center" colspan="2"> - <br><input type="submit" name="login_button_OK" value="OK"></td> - </tr> - </tbody> - </table> - </form> -<?php + global $tableborder; + + $t = new rFastTemplate('inc/templates'); // Instantiate new template + $t->define(array('admin_login' => 'admin_login.thtml')); + // Tell rfasttemplate the template file name + $t->assign('HEADER', implode("", file('inc/header.pinc'))); + // Load the page header + $t->assign('PHPSELF', $_SERVER['PHP_SELF']); // Replace PHPSELF with the current URL + $t->assign('ERRMSG', ""); // Initialize error message + if (isset($_POST['password'])) { // Password must have been wrong + $t->assign('ERRMSG', "Incorrect password."); + } + $t->assign('BORDER', "$tableborder"); // Helpful to debug table layout + + $t->parse('ADMIN_LOGIN', 'admin_login'); // Prepare the final output + $t->FastPrint(); // and send it to stdout. } // ---------------------------------------------------------------- // Server selection // ---------------------------------------------------------------- -function select_server() { +function select_server($errmsg) { // variables outside scope of this function need to be declared as global global $tableborder, $servercfg, $serverlist; - $PHP_SELF = $_SERVER['PHP_SELF']; + + $PHPSELF = $_SERVER['PHP_SELF']; // Store the server field definitions // This should actually be done only once at startup. FIXME $servercfg->get_server_list(); // Put server configs in $servers[] array. -?> - <center><h2>Server Selection</h2></center> - <p><div class="instruction">Select a server to Change or Delete, - or type the name of a new Server/Share and click Add</div></p> -<?php // Initialize the server list object $serverlist = ""; $serverlist = new selectlist("serverlist"); // Create the server list object - $serverlist->setsize(15); // 15 items per page + $serverlist->setsize(10); // 15 items per page $serverlist->setadd(); // Show the "Add" button $serverlist->setchange(); // Show the "Change" button $serverlist->setdelete(); // Show the "Delete" button @@ -233,175 +187,205 @@ // Display the server list - $html = $serverlist->gethtml($PHP_SELF); // Generate the html - echo "<center>$html</center>"; // Output the html - - // Link to change admin password + $selectlist = $serverlist->gethtml($PHPSELF); // Generate the html for the list - echo "<a href=\"chgadminpwd.php\">Change Admin Password</a>\n"; + $t = new rFastTemplate('inc/templates'); // Instantiate new template + $t->define(array('select_server' => 'select_server.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', "$tableborder"); // Helpful to debug table layout + $t->assign('SELECTLIST', "$selectlist"); // The selection list and buttons + + $t->parse('SELECT_SERVER', 'select_server'); // Prepare the final output + $t->FastPrint(); // and send it to stdout. } // ---------------------------------------------------------------- -// edit_server: generate a html page that will allow -// editing of the server settings. -// Setup the edit mode and output the heading. -// Used by: admin.php +// process_serverlist: Process input from the server details screen +// Parms: selectlist Array of fields returned from the selectlist class // ---------------------------------------------------------------- -function edit_server($mode, $server, $share, $settings) { - global $admin, $server_key, $tableborder; - $PHP_SELF = $_SERVER['PHP_SELF']; +function process_serverlist($selectlist) { + global $admin, $serverlist, $servercfg; - // page heading + // Get selected action + + $action = $serverlist->getaction($selectlist); + + // Get selected server and share names - echo '<center><h2>Server Details</h2></center>'; - put_server_heading($mode, "Type the server information and click OK."); // Output server/share heading + $itemval = $serverlist->getvalue($selectlist); - echo - "\n", - '<table border="', $tableborder, '" cellspacing="2" cellpadding="2" align="center">', - "<tbody>\n" - ; - - switch ($mode) { - case ("create"): - // Error: Server and share name are required - if (strlen($server) <= 0) { - $admin->seterrmsg("Server Name is required."); // FIXME: seterrmsg - return; - } - $html = edit_server_detail("new", $mode, $settings); - break; - case ("change"): - case ("delete"): - $html = edit_server_detail("$server_key", $mode, $settings); - break; + // Get server and share name + + switch ($action){ + case "Add": + $servercfg->init_new_server($itemval[0], $itemval[1]); + $server = trim($itemval[0]); // 1st input field (Add mode) + $share = trim($itemval[1]); // 2nd input field + break; + default: + list($item_index, $server, $share)= split(",", $itemval[0], 3); + // Get values from list } - echo $html; - echo "</tbody></table>"; -} -// --------------------------------------------------------- -// edit_server_detail - generate a html page that will allow -// editing of the server settings -// Used by: admin.php -// Returns: html -// --------------------------------------------------------- -function edit_server_detail($server, $mode, $settings) { - global $servercfg; - $PHP_SELF = $_SERVER['PHP_SELF']; + // Validate input + $errmsg = validate_serverlist($action, $server, $share); - // Save server configuration in admin for use in other functions - if (isset($settings)){ - save_settings($settings); - } else { - save_settings($servercfg->servers["$server"]); + // If error, redisplay serverlist screen with error message + if ($errmsg != ""){ + select_server($errmsg); + return; } - $html = "<form action=\"$PHP_SELF\" method=\"post\">\n"; - - - // parse the config into a html editable page - $html .= parse_edit_html($mode); + // If no error, display server details screen - $html .= "<tr><td align=\"center\" colspan=\"2\"><br><input type=\"submit\" name=\"edit_server_OK\" value=\"Next\">"; - $html .= "<input type=\"hidden\" name=\"server_key\" value=\"$server\">\n"; // save server id - // Save the server/share key in hidden screen fields - $html .= '<input type="hidden" name="server_name" value="'; - $html .= $servercfg->config["server"]; - $html .= "\">\n"; - $html .= '<input type="hidden" name="share_name" value="'; - $html .= $servercfg->config["share"]; - $html .= "\">\n"; - $html .= "<input type=\"hidden\" name=\"mode_name\" value=\"$mode\">\n"; - $html .= "</td>\n"; - - $html .= "</form>\n"; - - return $html; + switch ($action){ + case ("Backup Now"): // Run selected backup now + backup_now($server, $share); + break; + case ("Check Configuration"): // Test server config + $bobsdir = dirname($_SERVER['PHP_SELF']); + header("Location: $bobsdir/systemcheck.php?server=$server&share=$share"); + // Redirect browser + exit; + break; + default: + $servercfg->set_config($server . '.' . $share); + server_details($action, $server, $share, NULL, NULL); + break; + } } // ---------------------------------------------------------------- -// Confirm server changes -// Displays the confirmation screen +// validate_serverlist: Validate input from the server details screen +// Parms: action Button pressed: Add, Change, Delete, Check Configuration, or Backup Now +// server Server name +// share Share name +// Returns: errmsg string - Empty string if no error // ---------------------------------------------------------------- -function confirm_server($server_name, $share_name, $mode, $settings){ - global $servercfg, $tableborder; +function validate_serverlist($action, $server, $share) { - // save the current screen settings - save_settings($settings); + if ( $action == "Add" + || $action == "Change" + || $action == "Delete" + || $action == "Backup Now"){ + if ($server == ""){ + return "Server name is required."; + } + if ($share == ""){ + return "Share name is required."; + } + } +} - // Display the page heading and start the table - echo '<center><h2>Confirm Server Settings</h2></center>'; - put_server_heading($mode, "Verify that the settings are correct before you save"); // Output server/share heading - // FIXME: pass $mode, not "delete" +// ---------------------------------------------------------------- +// server_details: generate a html page that will allow +// editing of the server settings. +// Setup the edit mode and output the heading. +// Used by: admin.php +// ---------------------------------------------------------------- +function server_details($mode, $server, $share, $settings, $errmsg) { + global $admin, $tableborder, $servercfg; - echo '<table align="center" border="' . $tableborder . '"><tbody>'; - echo '<tr><td align = "center">'; + $PHPSELF = $_SERVER['PHP_SELF']; + $server_key = $server . '.' . $share; + switch ($mode) { + case ("Add"): + $details = get_server_html("new", $settings, $mode); + break; + case ("Change"): + case ("Delete"): + $details = get_server_html("$server_key", $settings, $mode); + break; + } + + // Display the server details + + $t = new rFastTemplate('inc/templates'); // Instantiate new template + $t->define(array('server_details' => 'server_details.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 + $t->assign('BORDER', "$tableborder"); // Helpful to debug table layout + $t->assign('MODE', "$mode"); // Helpful to debug table layout + $t->assign('DETAILS', "$details"); + $t->assign('SERVERKEY', "$server_key"); + $t->assign('SERVER', "$servercfg->config['server']"); + $t->assign('SHARE', "$servercfg->config['share']"); - // load the html form + $t->parse('SERVER_DETAILS', 'server_details'); // Prepare the final output + $t->FastPrint(); // and send it to stdout. +} - echo '<form name="confirm_settings" method="POST">'; +// ---------------------------------------------------------------- +// process_server_details: Process input from the server detail screen +// ---------------------------------------------------------------- +function process_server_details(){ - foreach ($servercfg->config as $name => $value) { // output each field that has a value - echo "$name = $value <br>\n"; + $errmsg = validate_server($_POST['mode_name'], $_POST['settings']); + if (($errmsg != "") + || (changed($_POST['settings']) == TRUE)){ + server_details( + $_POST['mode_name'], + $_POST['settings']['server'], + $_POST['settings']['share'], + $_POST['settings'], + $errmsg); + } else { + confirm_server( + $_POST['settings']['server'], + $_POST['settings']['share'], + $_POST['mode_name'], + $_POST['settings']); } - - echo $html; - echo '<input type="hidden" name="save_changes">'; - echo "<input type=\"hidden\" name=\"mode_name\" value=\"$mode\">\n"; - echo '<p><big>Verify that the settings are correct before you save</big> - <br><br><input type="submit" name="commit_changes" value="Confirm ' . $mode . '"></p>'; - echo '</form>'; - echo '</td></tr>'; - echo '</tbody>'; - echo '</table>'; } -// --------------------------------------------------------- -// save_settings - store the server settings in config -// Used by: edit_server -// --------------------------------------------------------- -function save_settings($settings) { - global $servercfg, $debug; +// ---------------------------------------------------------------- +// validate_server: Validate input from the server details screen +// ---------------------------------------------------------------- +function validate_server($mode, $settings) { + global $admin; - // Also set to blank, any settings not shown - $server_defs = $servercfg->get_server_defs(); - foreach ($server_defs as $name => $value) { - if (isset($settings["$name"])) { - $servercfg->config["$name"] = $settings["$name"]; - } else { - $servercfg->config["$name"] = ""; // Any configs not specified, set to blank - } + if (($settings['backup_method'] == 'rsync') + && (trim($settings['rsync_share']) == "")){ + return "Please specify the name of the rsync share."; } - - // Get value for 7 day checkboxes into $days - // FIXME: 'days' hardcoding prevents using more that one "days" type field - - for ($n = 0; $n <= 6; $n++){ - $day = "day" . $n; - if (isset($settings["$day"])){ - $days .= $n; - } + if ((($settings['backup_method'] == 'nfs') + || ($settings['restore_method'] == 'nfs')) + && (trim($settings['nfs_share']) == "")){ + return "Please specify the path of the nfs share."; } - if (isset($days)){ - $servercfg->config["run_days"] = $days; + if ((($settings['backup_method'] == 'smb') + || ($settings['restore_method'] == 'smb')) + && (trim($settings['smb_share']) == "")){ + return "Please specify the name of the smb share."; } } // --------------------------------------------------------- -// parse_edit_html - parse the config file to html -// Used by: edit_server_detail -// Returns: html +// get_server_html - parse the config file to html +// Used by: server_details +// Returns: html for the edit server screen // --------------------------------------------------------- -function parse_edit_html ($mode) { +function get_server_html($server, $settings, $mode) { global $servercfg; + // Save server configuration in admin for use in other functions + if (isset($settings)){ + save_settings($settings); + } + $server_defs = $servercfg->get_server_defs(); foreach ($server_defs as $name => $value){ // read through server def key/values if (check_rules($name)) { // should field be displayed? - if ($mode == "delete"){ // input or output field? + if ($mode == "Delete"){ // input or output field? $io = 'o'; } else { $io = 'i'; @@ -424,7 +408,7 @@ // --------------------------------------------------------- // check_rules - determine if field should be displayed -// Used by: parse_edit_html +// Used by: get_server_html // Parms: $name The server configuration field name to check // --------------------------------------------------------- function check_rules ($name) { @@ -470,38 +454,84 @@ return FALSE; } +// ---------------------------------------------------------------- +// Confirm server changes +// Displays the confirmation screen +// ---------------------------------------------------------------- +function confirm_server($server_name, $share_name, $mode, $settings){ + global $servercfg, $tableborder; + + // save the current screen settings + save_settings($settings); + + // load the html form + + $t = new rFastTemplate('inc/templates'); // Instantiate new template + $t->define(array('confirm_server' => 'confirm_server.thtml')); + // Tell rfasttemplate the template file name + $t->define_dynamic('detail', 'confirm_server'); // 'detail' is dynamic template in + // same file as 'confirm_server template + $t->assign('HEADER', implode("", file('inc/header.pinc'))); + // Load the page header + $t->assign('BORDER', "$tableborder"); // Helpful to debug table layout + $t->assign('MODE', "$mode"); // Helpful to debug table layout + + foreach ($servercfg->config as $name => $value) { // output each field that has a value + $t->assign('NAME', "$name"); // Setting name + $t->assign('VALUE', "$value"); // Setting value + $t->parse('DETAIL', '.detail'); // Parse the html row + } + + $t->parse('CONFIRM_SERVER', 'confirm_server'); // Prepare the final output + $t->FastPrint(); // and send it to stdout. +} // --------------------------------------------------------- -// put_server_heading - Outputs html for the Server: xxx Share: xxx heading -// Used by: admin.php +// save_settings - store the server settings in config +// Used by: server_details // --------------------------------------------------------- -function put_server_heading($mode, $instruction) { - global $tableborder; +function save_settings($settings) { + global $servercfg, $debug; - $CR = "\n"; + // Also set to blank, any settings not shown + $server_defs = $servercfg->get_server_defs(); + foreach ($server_defs as $name => $value) { + if (isset($settings["$name"])) { + $servercfg->config["$name"] = $settings["$name"]; + } else { + $servercfg->config["$name"] = ""; // Any configs not specified, set to blank + } + } - echo - $CR, '<table align="center" width="90%" border="', $tableborder, '">', - $CR, '<tr><td><div class="instruction">', $instruction, '</div></td>', - $CR, '<td><div class="servermode">Mode: <b>', $mode, '</b></div></td></tr>', $CR - ; + // Get value for 7 day checkboxes into $days + // FIXME: 'days' hardcoding prevents using more than one "days" type field + + for ($n = 0; $n <= 6; $n++){ + $day = "day" . $n; + if (isset($settings["$day"])){ + $days .= $n; + } + } + if (isset($days)){ + $servercfg->config["run_days"] = $days; + } } // --------------------------------------------------------- -// changed - check for screen settings changed +// changed - check for screen number of fields changed // Used by: admin.php // Returns: TRUE if changed, FALSE if not changed // --------------------------------------------------------- function changed($settings) { global $admin; - $hashnew = serialize($settings); // hash current screen settings + $countnew = count($settings); // count current screen fields - if (isset($admin->hash)){ - if ($admin->hash == $hashnew) return FALSE; // compare current to saved screen settings + if (isset($admin->count)){ + if ($admin->count == $countnew) return FALSE; // Same number fields } - $admin->hash = $hashnew; // save current screen settings - return TRUE; // screen settings have changed + $admin->count = $countnew; // save field count + return TRUE; // number of fields has changed } // --------------------------------------------------------- @@ -531,6 +561,15 @@ echo "*** Backing up $server/$share\n"; +} + +// --------------------------------------------------------- +// Dump a formatted variable for TESTing +// Parms: desc string - name of the var +// var the variable to dump +// --------------------------------------------------------- +function testdump($desc, $var){ + echo "<pre>*** $desc ***\n"; var_dump($var); echo "</pre>\n"; } ?> |
From: docv <do...@va...> - 2003-05-15 14:14:02
|
My apologies if this is off topic for this list, however I noticed that most responses to the forums were older and said to use the mail lists. Having only two choices, I choose this one as my question is definitely not development. I have just recently installed Bobs Backup and just getting used to it. I am not a PHP programmer but can fumble my way through code if I have to to make specific changes. Having said that, I get the following message every day (bc of my cron job); ----Message start---- /etc/cron.daily/backup.php: X-Powered-By: PHP/4.1.2 Set-Cookie: PHPSESSID=e65a78736346bd6bc39851914e??????; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html ----Message end---- How do I change the expiration date on the cookie? And why is a cookie being set through the cron job? -- Steve Vaitl con...@va... (816)695-4897 http://www.serversforsmallbusiness.com http://www.vaitl.net http://www.athleticshowcase.com |
From: Joe Z. <jz...@us...> - 2003-05-10 17:38:55
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv9440 Modified Files: admin.php Log Message: Added "Backup Now" button to "Servers" page. Index: admin.php =================================================================== RCS file: /cvsroot/bobs/bobs/admin.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- admin.php 8 May 2003 05:46:51 -0000 1.20 +++ admin.php 10 May 2003 17:38:52 -0000 1.21 @@ -2,17 +2,19 @@ // BOBS Administration Interface -if (isset($_GET['menu_bobs'])){ // BOBS menu button pushed +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 + header("Location: $bobsdir"); // Redirect browser to BOBS main index + exit; // Make sure that code below does not get executed } -require("inc/class_config.php"); // configuration class -require("inc/class_admin.php"); // admin configuration class -require("inc/class_server.php"); // admin configuration class -require("inc/gui.pinc"); // gui functions -require("inc/class_list.php"); // gui selection list +require_once("inc/class_config.php"); // configuration class +require_once("inc/class_admin.php"); // admin configuration class +require_once("inc/class_server.php"); // admin configuration class +require_once("inc/class_backup.php"); // To submit backup to queue +require_once ('inc/class_rfasttemplate.php'); // Template class +require_once("inc/gui.pinc"); // gui functions +require_once("inc/class_list.php"); // gui selection list // Logout selected, close the session @@ -89,11 +91,11 @@ edit_server("create", $itemval[0], $itemval[1], $_POST['settings']); // Server detail: create mode break; - case ("Change"): // Change server button pressed + case ("Change"): // Change server button pressed edit_server("change", $server_name, $share_name, $_POST['settings']); // Server detail: change mode break; - case ("Delete"): // Delete server button pressed + case ("Delete"): // Delete server button pressed edit_server("delete", $server_name, $share_name, $_POST['settings']); // Server detail: delete mode break; @@ -103,6 +105,11 @@ // Redirect browser exit; break; + case ("Backup Now"): // Run selected backup now + if(isset($server_name)){ + backup_now($server_name, $share_name); + } + break; } break; case (isset($_POST['edit_server_OK'])): // On edit server detail already @@ -203,12 +210,14 @@ // Initialize the server list object $serverlist = ""; - $serverlist = new selectlist("serverlist"); // Create the server list object - $serverlist->setsize(15); // 15 items per page - $serverlist->setadd(); // Show the "Add" button - $serverlist->setchange(); // Show the "Change" button - $serverlist->setdelete(); // Show the "Delete" button - $serverlist->addbutton("Check Configuration");// Test the system and server configuration + $serverlist = new selectlist("serverlist"); // Create the server list object + $serverlist->setsize(15); // 15 items per page + $serverlist->setadd(); // Show the "Add" button + $serverlist->setchange(); // Show the "Change" button + $serverlist->setdelete(); // Show the "Delete" button + $serverlist->addbutton("Check Configuration"); + // Test the system and server configuration + $serverlist->addbutton("Backup Now"); // Backup selected server now button $serverlist->addinput("Server name : ", 20); // Input fields for "Add" button $serverlist->addinput("Share description : ", 20); @@ -493,6 +502,35 @@ } $admin->hash = $hashnew; // save current screen settings return TRUE; // screen settings have changed +} + +// --------------------------------------------------------- +// backup_now - Backup the selected server now +// Parms: server Server name +// share Share name +// Returns: ? +// --------------------------------------------------------- +function backup_now($server, $share) { + global $admin, $servercfg; + + $srvcfg = new server(); // Create the backup class instance + $srvcfg->set_config($server . '.' . $share); + $backup = new backup($srvcfg->sys_conf, $srvcfg->config); + + $t = new rFastTemplate ('inc/templates'); // Setup the template to submit + $t->define (array('backup_now' => 'backup_now.php')); // Template name + + $siteroot = $admin->get_siteroot(); + $t->assign ('SITEROOT', $siteroot); // Assign template variables + $t->assign ('SERVER', $server); + $t->assign ('SHARE', $share); + + $t->parse ('BACKUP_NOW', 'backup_now'); // Create the final result of the template + $script = $t->fetch(); // and get it into a variable + $backup->add_queue_command($script, 'php'); // that I can submit to cmdloop. + + echo "*** Backing up $server/$share\n"; + } ?> |
From: Joe Z. <jz...@us...> - 2003-05-10 17:38:55
|
Update of /cvsroot/bobs/bobs/inc/templates In directory sc8-pr-cvs1:/tmp/cvs-serv9440/inc/templates Added Files: backup_now.php Log Message: Added "Backup Now" button to "Servers" page. --- NEW FILE: backup_now.php --- <?php // This template will run a backup of a single server now. // It is started from the "Backup Now" button on te "Servers" page. require_once('{SITEROOT}/inc/class_config.php'); require_once('{SITEROOT}/inc/class_server.php'); require_once('{SITEROOT}/inc/class_backup.php'); require_once('{SITEROOT}/inc/config.php'); require_once('{SITEROOT}/inc/class_rfasttemplate.php'); // make a config object $srvcfg = new server(); // set the config we are working on $srvcfg->set_config('{SERVER}.{SHARE}'); // now we should create a new backup object $backup = new backup($srvcfg->sys_conf, $srvcfg->config); // check if the dirs we need exists $backup->dir_check(); // do backup $backup->server_backup(); // increment files $backup->increment_files(); // generate indexes $backup->server_create_index(); ?> |
From: Joe Z. <jz...@us...> - 2003-05-10 17:37:53
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv8900 Modified Files: systemcheck.php Log Message: Fix: Check of default admin password is now encrypted. Index: systemcheck.php =================================================================== RCS file: /cvsroot/bobs/bobs/systemcheck.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- systemcheck.php 1 May 2003 05:21:14 -0000 1.3 +++ systemcheck.php 10 May 2003 17:37:50 -0000 1.4 @@ -8,11 +8,13 @@ exit; // Make sure that code below does not get executed } -require_once ('inc/class_rfasttemplate.php'); // Template class +require_once ('inc/class_rfasttemplate.php'); // Template class require_once("inc/class_config.php"); // configuration class -include_once("inc/header.pinc"); // Main menu +require_once("inc/class_admin.php"); // Administration interface class +include_once("inc/header.pinc"); // Main menu $config = new config(); // Create instance of configuration class +$admin = new admin(); // Create instance of admin class // some global variables $backup=''; @@ -108,7 +110,7 @@ // -------------------------------- $t->assign ('ITEM', "Checking if default administrator password has been changed"); -if ($config->admin_pwd != 'admin'){ +if ($admin->check_admin('admin') != "yes"){ $t->assign ('STATUS', 'PASS'); putpass(); } else { @@ -641,10 +643,10 @@ global $backup, $srvtmpl; // Generate a temporary file name for return status - //$pid = posix_getpid(); // Current process id + //$pid = posix_getpid(); // Current process id $id = uniqid(bobssrvchk); $tempfile = "/tmp/" . "$id"; - `umask 077; touch $tempfile`; // I need to create it so I can delete it + `umask 077; touch $tempfile`; // I need to create it so I can delete it $srvtmpl->assign ('TEMPFILE', $tempfile); $srvtmpl->parse ('SRVCHK', 'srvchk'); @@ -652,7 +654,7 @@ $backup->add_queue_command($script, 'bash'); // submit the script to run under cmdloop // Read the response from the fifo - $maxsec = 20; // max seconds to wait for script + $maxsec = 20; // max seconds to wait for script $count = 0; $filesize = 0; while ($filesize == 0 && $count < $maxsec) { @@ -660,16 +662,16 @@ sleep(1); clearstatcache(); $stats = stat("$tempfile"); - $filesize = $stats[7]; // element 8 is file size + $filesize = $stats[7]; // element 8 is file size } // Read the script output if ($filesize > 0) { $fout = file($tempfile); unlink($tempfile); // cleanup: delete the temp file - return($fout); // return the script output + return($fout); // return the script output } - unlink($tempfile); // cleanup: delete the temp file + unlink($tempfile); // cleanup: delete the temp file return(array(-1, 'Operation timed out.')); } |
From: Joe Z. <jz...@us...> - 2003-05-09 05:39:56
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv11810/bobs Modified Files: ChangeLog INSTALL Makefile.am Makefile.in TODO Log Message: 'make uninstall-all' checks that no mount points are active in /var/bobsdata. 'make uninstall' kills the cmdloop script. Index: ChangeLog =================================================================== RCS file: /cvsroot/bobs/bobs/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ChangeLog 4 May 2003 19:51:59 -0000 1.9 +++ ChangeLog 9 May 2003 05:39:53 -0000 1.10 @@ -15,6 +15,13 @@ -- 4-26-2003 Create a "Check Configuration" option on the admin page. Admins need to be able to test if a setup works. + -- 5-07-2003 + Allow changing admin password in browser interface. + -- Bug fix 5-08-2003 + 'make uninstall-all' checks that nothing is mounted in + bobs data directory (/var/bobsdata). I fixed this bug after + deleting 3 years of my kid's homework. + 'make uninstall' also kills the cmdloop script. Version 0.6.0pre1 Rene Rask (re...@gr...) Index: INSTALL =================================================================== RCS file: /cvsroot/bobs/bobs/INSTALL,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- INSTALL 8 May 2003 05:46:50 -0000 1.22 +++ INSTALL 9 May 2003 05:39:53 -0000 1.23 @@ -373,7 +373,3 @@ remove all the files and directories, including any backups. So only run 'make uninstall-all' if you want to completely remove bobs and all configurations and backups created by bobs. - -CAUTION: If any "bobs" backup directories are mounted (they're in -/var/bobsdata), 'make uninstall-all' will delete the mounted directory! I -think I deleted all my kid's homework by accident that way. Index: Makefile.am =================================================================== RCS file: /cvsroot/bobs/bobs/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.am 8 May 2003 05:46:51 -0000 1.14 +++ Makefile.am 9 May 2003 05:39:53 -0000 1.15 @@ -105,6 +105,7 @@ # The '-' on '-rmdir' tells 'make' to ignore any error returned by command # uninstall-local: + -kill `/sbin/pidof -x cmdloop` -rmdir `find $(myWEBDIR) -type d | sort -r` -rmdir $(myBOBSDATA)/current/process/{cmd,mounts,session} -rmdir $(myBOBSDATA)/current/process @@ -114,10 +115,19 @@ # # This will remove all the install directories - empty or not. # -uninstall-all: - rm -rf $(myWEBDIR) - rm -rf $(myBOBSDATA) - make -f cron/Makefile uninstall-local +uninstall-all: uninstall + +# Be sure no bobs mount points are active! +# That's how I deleted 3 years worth of my kid's homework! + + if [ `mount | grep -c $(myBOBSDATA)` -eq 0 ]; then \ + rm -rf $(myWEBDIR); \ + rm -rf $(myBOBSDATA); \ + make -f cron/Makefile uninstall-local; \ + else \ + echo "Error *** Can't uninstall-all right now. Some mount points are active in $(myBOBSDATA)"; \ + exit 1; \ + fi rpm: dist Index: Makefile.in =================================================================== RCS file: /cvsroot/bobs/bobs/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.in 8 May 2003 05:46:51 -0000 1.12 +++ Makefile.in 9 May 2003 05:39:53 -0000 1.13 @@ -526,6 +526,7 @@ # The '-' on '-rmdir' tells 'make' to ignore any error returned by command # uninstall-local: + -kill `/sbin/pidof -x cmdloop` -rmdir `find $(myWEBDIR) -type d | sort -r` -rmdir $(myBOBSDATA)/current/process/{cmd,mounts,session} -rmdir $(myBOBSDATA)/current/process @@ -535,10 +536,19 @@ # # This will remove all the install directories - empty or not. # -uninstall-all: - rm -rf $(myWEBDIR) - rm -rf $(myBOBSDATA) - make -f cron/Makefile uninstall-local +uninstall-all: uninstall + +# Be sure no bobs mount points are active! +# That's how I deleted 3 years worth of my kid's homework! + + if [ `mount | grep -c $(myBOBSDATA)` -eq 0 ]; then \ + rm -rf $(myWEBDIR); \ + rm -rf $(myBOBSDATA); \ + make -f cron/Makefile uninstall-local; \ + else \ + echo "Error *** Can't uninstall-all right now. Some mount points are active in $(myBOBSDATA)"; \ + exit 1; \ + fi rpm: dist mkdir -p \ Index: TODO =================================================================== RCS file: /cvsroot/bobs/bobs/TODO,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- TODO 1 May 2003 05:21:14 -0000 1.16 +++ TODO 9 May 2003 05:39:53 -0000 1.17 @@ -30,7 +30,6 @@ Priority: Medium Backup directories (/var/bobsdata/) should not be world readable. Encrypt passwords. - Allow changing admin password in browser interface. User and group administration Priority: Medium |