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.')); } |