From: Joe Z. <jz...@us...> - 2003-05-08 05:46:55
|
Update of /cvsroot/bobs/bobs In directory sc8-pr-cvs1:/tmp/cvs-serv5001/bobs Modified Files: INSTALL Makefile.am Makefile.in admin.php configure configure.in Added Files: BUGS chgadminpwd.php Log Message: The admin password is now encrypted. There is a link at the bottom of the 'servers' page to change the admin password. --- NEW FILE: BUGS --- BOBS BUGS Remove these items as their fixed and put a not in ChangeLog. - Reported by Joe Zacky 05-04-2003 systemcheck.php reports "I didn't find any backup files" if the httpd user id doesn't have access to the directory being backed up. That means if you backup a directory that has permissions of 700, for example, then systemcheck.php won't be able to read it. One solution would be to have cmdloop read the directory and report back to systemcheck.php. --- NEW FILE: chgadminpwd.php --- <?php // ------------------------------------------------ // Change admin password screen // ------------------------------------------------ require_once ('inc/class_rfasttemplate.php'); // Template class require_once("inc/class_config.php"); // Site configuration class require_once('inc/class_admin.php'); // Admin functions // Setup the session session_start(); if(!session_is_registered("admin")) { // Not logged to admin redirect(); // Redirect to admin login page } $admin = &$_SESSION['admin']; // $admin contains the admin class vars // Am I logged in to the admin session? if ($admin->admin_ok != "yes"){ // Apparently not. redirect(); // Redirect to admin login page } // Define the page template $t = new rFastTemplate('inc/templates'); // Instantiate new template $t->define(array('chgpwd' => 'chgadminpwd.thtml')); // Tell rfasttemplate the template file name $t->assign('PHPSELF', $_SERVER['PHP_SELF']); // Replace PHPSELF with the current URL $t->assign('ERRMSG', " "); // What action to take? if (isset($_POST['chg_pwd_OK'])){ // OK button pressed on chg pwd screen $errmsg = change_pwd(); // Change the password $t->assign('ERRMSG', $errmsg); // Put error msg to template } // Output the html include_once("inc/header.pinc"); // This is the menu bar and main title. $t->parse('CHGPWD', 'chgpwd'); // Parse the template. $t->FastPrint(); // and send it to stdout. return; // The End // ================================================ // change_pwd - Invoke class function to change admin password // Parms: None // Returns: string - Error message, or null if success // ================================================ function change_pwd() { global $admin; $errmsg = $admin->chg_pwd($_POST['curpwd'], $_POST['newpwd'], $_POST['newpwd2']); if (! $errmsg){ // No errors. $errmsg = "Password successfully changed."; } return $errmsg; } // ================================================ // redirect - Redirect Browser to admin login page // Parms: None // Returns: Nothing // ================================================ function redirect() { $bobsdir = dirname($_SERVER['PHP_SELF']); // Get web page directory $adminpage = $bobsdir . '/admin.php'; // Point to admin page header("Location: $adminpage"); // Redirect browser to BOBS admin page exit; // Make sure that code below does not get executed } ?> Index: INSTALL =================================================================== RCS file: /cvsroot/bobs/bobs/INSTALL,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- INSTALL 4 May 2003 19:51:59 -0000 1.21 +++ INSTALL 8 May 2003 05:46:50 -0000 1.22 @@ -290,12 +290,6 @@ This will install the web pages, create the backup data directories, and add a cron job to /etc/crontab. - FIXME: - You should now change the bobs admin password. The password - defaults to 'admin'. Open the file config.php and change the - value of the admin_pwd variable. By default, config.php will be in - /var/www/html/bobs/inc/config.php. - 4. Bobs is now installed. Point your browser to http://your.server.name/bobs/admin.php. @@ -379,3 +373,7 @@ 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.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 26 Apr 2003 22:39:43 -0000 1.13 +++ Makefile.am 8 May 2003 05:46:51 -0000 1.14 @@ -20,7 +20,7 @@ # Subdirectories to also be built # Each subdirectory has it's own Makefile.am -SUBDIRS = bash doc cron images inc js winc man +SUBDIRS = bash data doc cron images inc js man winc # Install html documents. # By using a variable htmldir, ending in 'dir' Index: Makefile.in =================================================================== RCS file: /cvsroot/bobs/bobs/Makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.in 26 Apr 2003 22:39:43 -0000 1.11 +++ Makefile.in 8 May 2003 05:46:51 -0000 1.12 @@ -92,7 +92,7 @@ myrealCRONTABDIR = @myrealCRONTABDIR@ myrealWEBDIR = @myrealWEBDIR@ -SUBDIRS = bash doc cron images inc js winc man +SUBDIRS = bash data doc cron images inc js man winc # Install html documents. @@ -299,7 +299,7 @@ distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkinstalldirs) $(distdir)/cron $(distdir)/inc + $(mkinstalldirs) $(distdir)/cron $(distdir)/data $(distdir)/inc @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ Index: admin.php =================================================================== RCS file: /cvsroot/bobs/bobs/admin.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- admin.php 26 Apr 2003 22:39:43 -0000 1.19 +++ admin.php 8 May 2003 05:46:51 -0000 1.20 @@ -226,6 +226,10 @@ $html = $serverlist->gethtml($PHP_SELF); // Generate the html echo "<center>$html</center>"; // Output the html + + // Link to change admin password + + echo "<a href=\"chgadminpwd.php\">Change Admin Password</a>\n"; } // ---------------------------------------------------------------- Index: configure =================================================================== RCS file: /cvsroot/bobs/bobs/configure,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- configure 4 May 2003 19:51:59 -0000 1.10 +++ configure 8 May 2003 05:46:51 -0000 1.11 @@ -1725,7 +1725,7 @@ fi -myPASS=admin +myPASS=$(echo '<?php echo crypt("admin"); ?>' | php | tail -n 1) myCRONTABDIR=${sysconfdir} @@ -1745,7 +1745,7 @@ - ac_config_files="$ac_config_files Makefile bash/Makefile cron/Makefile doc/Makefile images/Makefile images/bar/Makefile images/menu/Makefile inc/Makefile inc/excludes/Makefile inc/servers/Makefile inc/templates/Makefile js/Makefile man/Makefile winc/Makefile" + ac_config_files="$ac_config_files Makefile bash/Makefile cron/Makefile data/Makefile doc/Makefile images/Makefile images/bar/Makefile images/menu/Makefile inc/Makefile inc/excludes/Makefile inc/servers/Makefile inc/templates/Makefile js/Makefile man/Makefile winc/Makefile" @@ -1773,7 +1773,7 @@ )` - ac_config_files="$ac_config_files inc/config.php cron/backup.php cron/check_loop" + ac_config_files="$ac_config_files inc/config.php data/admin.pwd cron/backup.php cron/check_loop" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -2327,6 +2327,7 @@ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bash/Makefile" ) CONFIG_FILES="$CONFIG_FILES bash/Makefile" ;; "cron/Makefile" ) CONFIG_FILES="$CONFIG_FILES cron/Makefile" ;; + "data/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "images/Makefile" ) CONFIG_FILES="$CONFIG_FILES images/Makefile" ;; "images/bar/Makefile" ) CONFIG_FILES="$CONFIG_FILES images/bar/Makefile" ;; @@ -2339,6 +2340,7 @@ "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "winc/Makefile" ) CONFIG_FILES="$CONFIG_FILES winc/Makefile" ;; "inc/config.php" ) CONFIG_FILES="$CONFIG_FILES inc/config.php" ;; + "data/admin.pwd" ) CONFIG_FILES="$CONFIG_FILES data/admin.pwd" ;; "cron/backup.php" ) CONFIG_FILES="$CONFIG_FILES cron/backup.php" ;; "cron/check_loop" ) CONFIG_FILES="$CONFIG_FILES cron/check_loop" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -2698,7 +2700,7 @@ echo -n " bobs data directory = "; eval echo $myBOBSDATA echo -n " cron directory = "; eval echo $myCRONDIR echo -n " crontab directory = "; eval echo $myCRONTABDIR -echo " admin password = $myPASS" +echo " admin password = admin" echo "" echo "*** $WARNCOUNT warning(s)" echo "" Index: configure.in =================================================================== RCS file: /cvsroot/bobs/bobs/configure.in,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- configure.in 4 May 2003 19:51:59 -0000 1.12 +++ configure.in 8 May 2003 05:46:51 -0000 1.13 @@ -90,7 +90,7 @@ dnl> Setup a bobs administrator password. dnl> -myPASS=admin +myPASS=$(echo '<?php echo crypt("admin"); ?>' | php | tail -n 1) dnl> dnl> Location of crontab file @@ -127,6 +127,7 @@ Makefile bash/Makefile cron/Makefile +data/Makefile doc/Makefile images/Makefile images/bar/Makefile @@ -170,6 +171,7 @@ AC_OUTPUT([ inc/config.php +data/admin.pwd cron/backup.php cron/check_loop ]) @@ -185,7 +187,7 @@ echo -n " bobs data directory = "; eval echo $myBOBSDATA echo -n " cron directory = "; eval echo $myCRONDIR echo -n " crontab directory = "; eval echo $myCRONTABDIR -echo " admin password = $myPASS" +echo " admin password = admin" echo "" echo "*** $WARNCOUNT warning(s)" echo "" |