Location: PHPKode > projects > KISGB (Keep It Simple Guest Book) > syschk.php
<html><head><title>KISGB System Check</title></head>
<style>
	.warn {	color:blue;
			font-weight:bold;
		}
	.danger {	color:red;
				font-weight:bold;
		}
</style>
<?
if (@file_exists('config.php')) {
	include('config.php');
//	include('user.prefs.php');
	$curdir = getcwd();
	$obMessage = '';
	$localOB = '';
	echo '<p class="danger">This tool reveals your setup of KISGB.  You should not leave it in the KISGB directory!  It is for debugging purposes only.  If you need to leave it in the KISGB directory for more than a few minutes, then rename it to something that only you will know!!  You\'ve been warned :)</p>';
	$app_version = isset($app_version)?$app_version:$version;
	$fh = fopen('http://ravenphpscripts.com/public/versionserver.php','r');
	$data = htmlspecialchars(fgets($fh, 1024));
	$prodv = substr($data,strpos($data,'Version v'),15);
	echo '<br />The latest released verison of KISGB is <b>'.$prodv.'</b><br />';
	echo '<br />This is KISGB version <b>'.$version.'</b>';
	echo '<br />Global Output Buffering setting is <b>'.get_cfg_var('output_buffering').'</b>';
	$localOB = ini_get('output_buffering');
	if (empty($localOB)) $obMessage = '<span class="danger"> <-- This setting must be On or 4096 or some value, or KISGB will not function correctly! --</span>';
	echo '<br />Local Output Buffering setting is <b>'.ini_get('output_buffering').'</b>'.$obMessage;
	echo '<br />Permission setting for the KISGB folder must be at least 755. <b>Yours is '.(decoct(fileperms($curdir)) % 1000).'</b>.';
	echo '<br />Permission setting for the KISGB '.$path_to_gb.' file must be at least 666.<b>  Yours is '.(decoct(fileperms('kisgb.csv.php')) % 1000).'</b>.';
	echo '<br />Permission setting for the KISGB '.$path_to_user_prefs.' file must be at least 644.  <b>Yours is '.(decoct(fileperms("$path_to_user_prefs")) % 1000).'</b>.';
	echo '<br />Your default language is <b>'.$language.'</b>';
	echo '<br />Your default theme is <b>'.$theme.'</b>';
	echo '<br />Your server is running PHP version <b>'.phpversion().'</b>';
	$current = error_reporting();
	$out = "";
	if (($current & E_ERROR          ) == E_ERROR          ){ $out .=" E_ERROR           | "; }
	if (($current & E_WARNING        ) == E_WARNING       ){ $out .=" E_WARNING         | "; }
	if (($current & E_PARSE          ) == E_PARSE          ){ $out .=" E_PARSE           | "; }
	if (($current & E_NOTICE         ) == E_NOTICE       ){ $out .=" E_NOTICE          | "; }
	if (($current & E_CORE_ERROR     ) == E_CORE_ERROR     ){ $out .=" E_CORE_ERROR     | "; }
	if (($current & E_CORE_WARNING   ) == E_CORE_WARNING ){ $out .=" E_CORE_WARNING    | "; }
	if (($current & E_COMPILE_ERROR  ) == E_COMPILE_ERROR  ){ $out .=" E_COMPILE_ERROR   | "; }
	if (($current & E_COMPILE_WARNING) == E_COMPILE_WARNING){ $out .=" E_COMPILE_WARNING | "; }
	if (($current & E_USER_ERROR     ) == E_USER_ERROR     ){ $out .=" E_USER_ERROR      | "; }
	if (($current & E_USER_WARNING   ) == E_USER_WARNING   ){ $out .=" E_USER_WARNING    | "; }
	if (($current & E_USER_NOTICE    ) == E_USER_NOTICE    ){ $out .=" E_USER_NOTICE     | "; }
	if (($current & E_ALL            ) == E_ALL            ){ $out .=" E_ALL             | "; }
	if (strpos($out,'E_NOTICE')) {
		echo '<br /><br /><table border=1><tr><td><b>Your php.ini error_reporting setting has E_NOTICE turned on.  This is overkill for any system.  It will fill your error log up with messages like this:</b><ul><li>Notice: Undefined variable: HTTP_USER_AGENT in /inetpub/ftproot/HCUG2/mainfile.php on line 16<li>Notice: import_request_variables() [function.import-request-variables]: No prefix specified - possible security hazard in /inetpub/ftproot/HCUG2/mainfile.php on line 39<li>Notice: Undefined variable: forum_admin in /inetpub/ftproot/HCUG2/mainfile.php on line 69<li>Notice: Use of undefined constant inside_mod - assumed \'inside_mod\' in /inetpub/ftproot/HCUG2/mainfile.php on line 72</ul>While you might want to keep this on while debugging, you certainly do not want this on in a production setting!  Contact whoever is hosting your site and ask them to change the php.ini file <b>error_reporting</b> setting to <b>E_ALL &~ E_NOTICE</b>.  If you host your own site, then you should do this yourself. If you do this yourself, be sure to restart your server so the chang will take effect.<br /><br />Unfortunately, until you can get this setting changed, you will need to add a line of code to your config.php, addtogb.php, and upconfig.php files in your KISGB folder.  Add this line of code as the second line in those 3 files: <b>error_reporting(E_ALL &~ E_NOTICE);</b> Please note the semi-colon at the end.  This will be changed in Version 5.1.0 and forward, but in the current releases you have to make the modification.</td></tr></table>';
	}
	$prefs = file("$path_to_user_prefs");
	echo '<br /><br /><b>The following table is a listing of your '.$path_to_user_prefs. 'file.  Certain settings have been checked and high-lighted for you if the values are such that your setup could be compromised or not function as desired.</b><br /><table border="1">';
	foreach($prefs as $key=>$value) {
		$a = explode('=',$value,2);
		$pos0 = substr($a[0],0,1);
		if ($pos0=='#'||$pos0=='<'||$pos0=='?') continue;
		if (trim($a[0])=='$admin_id'||trim($a[0])=='$admin_pw'||trim($a[0])=='$secure_site_id'||trim($a[0])=='$secure_site_pw') $a[1] = '*******************';
		echo '<tr><td>'.$a[0].'</td><td>'.htmlentities($a[1]);

		if (trim($a[0])=='$admin_id' && $admin_id=='admin') {
			echo '<td class="danger">The default value needs to be changed!';
		}
		elseif (trim($a[0])=='$admin_pw' && $admin_pw=='password') {
			echo '<td class="danger">The default value needs to be changed!';
		}
		elseif (trim($a[0])=='$secure_site_id' && $secure_site_id=='secure') {
			echo '<td class="danger">The default value needs to be changed!';
		}
		elseif (trim($a[0])=='$secure_site_pw' && $secure_site_pw=='password') {
			echo '<td class="danger">The default value needs to be changed!';
		}
		elseif (trim($a[0])=='$admin_from_web' && $admin_from_web!==TRUE) {
			echo '<td class="warn">If this value is not set to TRUE then you will not be able to save any changes to the guestbook or configuration.';
		}
		elseif (trim($a[0])=='$site_url' && $site_url=='http://www.somewhere.com') {
			echo '<td class="danger">The default value needs to be changed!';
		}
		elseif (trim($a[0])=='$admin_email_address' && $admin_email_address=='hide@address.com') {
			echo '<td class="danger">The default value needs to be changed!';
		}
		elseif (trim($a[0])=='$admin_email_advice_on_gb_edit' && $admin_email_advice_on_gb_edit==FALSE) {
			echo '<td class="warn">If you want to be notified of changes to messages, then set this value to TRUE.';
		}
		elseif (trim($a[0])=='$admin_email_advice' && $admin_email_advice==FALSE) {
			echo '<td class="warn">If you want to be notified of new messages, then set this value to TRUE.';
		}
		elseif (trim($a[0])=='$guest_email_advice' && $guest_email_advice==FALSE) {
			echo '<td class="warn">If you want your guests to receive an email acknowledgement after signing your guestbook,  then set this value to TRUE.';
		}
		elseif (trim($a[0])=='$cutoff_date_for_updates' && $cutoff_date_for_updates==-1) {
			echo '<td class="warn">A value of -1 allows the user to edit his entry forever.  You should change this to a specific time length.';
		}
		else echo "<td>&nbsp;";
		echo '</td></tr>';
	}
	echo '</tr></table><br /><br />';
}
else {
	echo '<p class="danger">I am unable to locate the KISGB config.php file.  Make sure that this system check script is in the same directory/folder that KISGB config.php file is in.  I will go ahead and run the PHP Info script.</p><br /><br />';
}
echo phpinfo();
?>
</html>
Return current item: KISGB (Keep It Simple Guest Book)