* @link http://pioder.gim2przemysl.int.pl/ * @license GNU GPL v3 **/ define('IN_uF', true); //include files include('./../config.php'); include('./../includes/constants.php'); include('./../includes/db.php'); include('./../includes/errors.php'); //connect to database DataBase::db_connect(); include('./../includes/sessions.php'); include('./../includes/classes/class_user.php'); include('./../common.php'); include('./../includes/admin/class_main.php'); include('./../includes/classes/class_forum.php'); include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php'); include('./../admin/check_script_data.php'); SessDelInvalid(); SessRegister(); SessDeleteOld(); if (User::UserInformation($_SESSION['uid'],'rank')!=2) { admin_message_forum($lng['yournotadmin'],'../index.php'); } $ERROR = './template/blank.tpl'; //functions .. in this script function check_size_md5($file) { if ( file_exists($file) ) { $result = @filesize($file); return md5($result); } else { return false; } } function mysqlversion() { $temp = ''; $result = DataBase::fetch(DataBase::sql_query("SELECT VERSION() AS mysql_version",GENERAL,'Could not read mysql version.')); $result = $result['mysql_version']; for($i=0;$i<5;$i++) { $temp .= $result[$i]; } $result = $temp; unset($temp); return($result); } function db_size() { $sql = "SHOW TABLE STATUS"; $db_size = 0; $query = DataBase::sql_query($sql,GENERAL,'Could not obtain database size'); while ($result = DataBase::fetch($query)) { $db_size += $result['Index_length']; } $db_size = $db_size / 1024; if ($db_size >=1024) { $db_size = $db_size / 1024; $db_size = round($db_size,2); $db_size = $db_size.' MB'; } else { $db_size = round($db_size,2); $db_size = $db_size.' KB'; } return $db_size; } function forum_size($path = './../') { $size = 0; if (is_dir($path)) { if ($dh = opendir($path)) { while (($file = readdir($dh)) !== false) { if ($file != '.' && $file != '..') { if (is_dir($path.$file)) { $size+= forum_size($path.$file.'/'); } else { $size+= filesize($path.$file); } } } closedir($dh); } return $size; } else { return filesize($path); } } $forum_size = forum_size(); $forum_size = $forum_size / 1024; if ($forum_size >=1024) { $forum_size = $forum_size / 1024; $forum_size = round($forum_size,2); $forum_size = $forum_size.' MB'; } else { $forum_size = round($forum_size,2); $forum_size = $forum_size.' KB'; } $count =0; for($i=0; $i$lng['scriptstat'], 'L.name'=>$lng['name'], 'L.value'=>$lng['value'], //php version 'L.php_version'=>$lng['php_version'], 'PHP.version'=>phpversion(), 'PHP.value' => (phpversion()>='5.0.7') ? 'OK' : ' Error - No OK', //extension MySQLi loaded? 'L.mySQLi_loaded'=>$lng['mysqli_loaded'], 'mySQLi_loaded'=>(extension_loaded('mysqli')) ? $lng['yes'] : $lng['no'], 'mySQLi_loaded.value'=> (extension_loaded('mysqli')) ? 'OK' : ' Error - No OK', //mysql version 'mySQL.version'=>$sql_version, 'L.mySQL_version'=>$lng['mysql_version'], 'mySQL.value'=>($sql_version>='4.1') ? 'OK' : ' Error - No OK', //database size 'L.db_size' => $lng['db_size'], 'db_size' => db_size(), //forum size 'L.forum_size' => $lng['forum_size'], 'forum_size' => $forum_size, //catalogs writable 'L.cat_name'=>$lng['catalog'], 'cat1.name'=> $folders[0], 'cat1.value'=> (@is_writable($folders[0])) ? ''.$lng['is_writable'].' - OK' : ''.$lng['not_writable'].' Error - No OK', 'cat2.name'=> $folders[1], 'cat2.value'=> (@is_writable($folders[1])) ? ''.$lng['is_writable'].' - OK' : ''.$lng['not_writable'].' Error - No OK', 'cat3.name'=> $folders[2], 'cat3.value'=> (!@is_writable($folders[2])) ? ''.$lng['not_writable'].' - OK' : ''.$lng['is_writable'].' Error - No OK', 'successfully' => ($count <1) ? ''.$lng['files_is_good'].' ('.count($script_files).')' : ''.$lng['files_not_good'].$count.'' ); Admin_Over::GenerateHeader(); include('./template/check_script.tpl'); for($i=0; $i$lng['original_sum'], 'L.sum_actual'=>$lng['actual_sum'], 'sum_rule'=>$rule, 'sum_actual'=>$actual, 'L.invalid_md5sum'=>$lng['invalid_md5sum'].' ('.substr($script_files[$i], strrpos($script_files[$i], '/') + 1, strlen($script_files[$i])).')' ); include('./template/invalidfile_body.tpl'); } } } include('./template/overall_footer.tpl'); ?>