示例#1
0
/**
 * This function checks whether a php setting matches the recommended value
 *
 * @author Patrick Cool <*****@*****.**>, Ghent University
 * @version Dokeos 1.8, august 2006
 */
function check_php_setting($php_setting, $recommended_value, $return_success = false, $return_failure = false)
{
    $current_php_value = get_php_setting($php_setting);
    if ($current_php_value == $recommended_value) {
        return Display::label($current_php_value . ' ' . $return_success, 'success');
    } else {
        return Display::label($current_php_value . ' ' . $return_success, 'important');
    }
}
示例#2
0
function boolSetting($name, $setting, $preferred, $red = true, $message = "")
{
    $current = get_php_setting($setting);
    $ret = sprintf('<tr><td>%s (%s)</td><td>%s</td><td>', $name, $setting, $preferred);
    if ($current == $preferred) {
        $ret .= sprintf('<font color="green"><b>%s</b></font>', $current);
    } else {
        if ($red === true) {
            $ret .= sprintf('<font color="red"><b>%s</b></font>', $current);
        } else {
            $ret .= sprintf('<font color="orange"><b>%s</b></font>', $current);
        }
        if ($message) {
            $ret .= ' (' . $message . ')';
        }
    }
    $ret .= "</td></tr>\n";
    return $ret;
}
示例#3
0
function system_info()
{
    $version = $GLOBALS['ext_version'];
    //$tab = extGetParam( $_REQUEST, 'tab', 'tab1' );
    $width = 400;
    // width of 100%
    switch (extGetParam($GLOBALS['__POST'], 'action2', 'panel')) {
        case 'systeminfo':
            ?>
		<div class="body-wrap">
		  <table class="member-table">
			<tr>
				<td valign="top" width="250" style="font-weight:bold;">
				Logged in as:
				</td>
				<td><?php 
            echo $_SESSION['credentials_extplorer']['username'];
            ?>
</td>
			<tr>
				<td valign="top" width="250" style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('sibuilton');
            ?>
:
				</td>
				<td>
				<?php 
            echo php_uname();
            ?>
				</td>
			</tr>
			<tr>
				<td valign="top" style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siphpversion');
            ?>
:
				</td>
				<td>
				<?php 
            echo phpversion();
            ?>
				&nbsp;
				<?php 
            echo phpversion() >= '4.3' ? '' : $GLOBALS['messages']['siphpupdate'];
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siwebserver');
            ?>
:
				</td>
				<td>
				<?php 
            echo get_server_software();
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siwebsphpif');
            ?>
:
				</td>
				<td>
				<?php 
            echo php_sapi_name();
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('simamboversion');
            ?>
:
				</td>
				<td>
				<?php 
            echo $version;
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siuseragent');
            ?>
:
				</td>
				<td>
				<?php 
            echo phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT'];
            ?>
				</td>
			</tr>
			<tr>
				<td valign="top" style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('sirelevantsettings');
            ?>
:
				</td>
				<td>
					<table cellspacing="1" cellpadding="1" border="0">
					<tr>
						<td valign="top">
							<?php 
            echo ext_lang::msg('sisafemode');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('safe_mode', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sibasedir');
            ?>
:
						</td>
						<td>
						<?php 
            echo ($ob = ini_get('open_basedir')) ? $ob : 'none';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sidisplayerrors');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('display_errors', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sishortopentags');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('short_open_tag', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sifileuploads');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('file_uploads');
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('simagicquotes');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('magic_quotes_gpc');
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('siregglobals');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('register_globals', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sioutputbuf');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('output_buffering', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sisesssavepath');
            ?>
:
						</td>
						<td>
						<?php 
            echo ($sp = ini_get('session.save_path')) ? $sp : 'none';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sisessautostart');
            ?>
:
						</td>
						<td>
						<?php 
            echo intval(ini_get('session.auto_start'));
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sixmlenabled');
            ?>
:
						</td>
						<td>
							<?php 
            echo extension_loaded('xml') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sizlibenabled');
            ?>
:
						</td>
						<td>
						<?php 
            echo extension_loaded('zlib') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sidisabledfuncs');
            ?>
:
						</td>
						<td>
						<?php 
            echo ($df = ini_get('disable_functions')) ? $df : 'none';
            ?>
						</td>
					</tr>
					</table>
				</td>
			</tr>
			</table>
		</div>
			<?php 
            break;
        case 'phpinfo':
            ob_start();
            phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
            $phpinfo = ob_get_contents();
            ob_end_clean();
            preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
            $output = preg_replace('#<table#', '<table class="member-table" align="center"', $output[1][0]);
            $output = '<div class="body-wrap">' . $output . '</div>';
            $output = preg_replace('#(\\w),(\\w)#', '\\1, \\2', $output);
            $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output);
            $output = preg_replace('#<hr />#', '', $output);
            echo $output;
            break;
        case 'about':
            show_about();
            break;
        default:
            ?>
			{
				"xtype": "tabpanel",
				
				"height": 350,
				"activeTab": 0,
				"items": [{
					"title": "<?php 
            echo ext_Lang::msg('aboutlink');
            ?>
",
					"autoScroll": true,
					"autoLoad": { 
						"url": "<?php 
            echo $GLOBALS['script_name'];
            ?>
",
						"params": {
							"option": "com_extplorer",
							"action": "get_about",
							"action2": "about"
						}
					}
				},{
					"title": "<?php 
            echo ext_Lang::msg('sisysteminfo');
            ?>
",
					"autoScroll": true,
					"autoLoad": { 
						"url": "<?php 
            echo $GLOBALS['script_name'];
            ?>
",
						"params": {
							"option": "com_extplorer",
							"action": "get_about",
							"action2": "systeminfo"
						}
					}
				},{
					"title": "<?php 
            echo ext_Lang::msg('siphpinfo');
            ?>
",
					"autoScroll": true,
					"autoLoad": { 
						"url": "<?php 
            echo $GLOBALS['script_name'];
            ?>
",
						"params": {
							"option": "com_extplorer",
							"action": "get_about",
							"action2": "phpinfo"
						}
					}
				}]
			}
			<?php 
    }
}
示例#4
0
文件: index.php 项目: rohcehlam/rflow
<?php 
                $php_settings = array(array('Magic Quotes GPC', 'magic_quotes_gpc', 'ON'), array('Register Globals', 'register_globals', 'ON'), array('Display Errors', 'display_errors', 'ON'), array('File Uploads', 'file_uploads', 'ON'));
                ?>
<table width="100%">
<tr><th class="header"  colspan="2">PHP Settings</th></tr>
<?php 
                foreach ($php_settings as $setting) {
                    ?>
  <tr><td class="prompt"><?php 
                    echo $setting[0];
                    ?>
</td>
  <?php 
                    $class = get_php_setting($setting[1]) == $setting[2] ? 'recommended' : 'notrecommended';
                    echo "<td class=\"{$class}\">";
                    echo get_php_setting($setting[1]);
                    ?>
   </td></tr>
<?php 
                }
                ?>

<?php 
                if (!empty($_SESSION['validuser'])) {
                    ?>
<tr><td  align="center" colspan="2"><input name="action" type="button" value="Detailed PHP Info"
  onclick="testPHPInfo()" /></td></tr>
<?php 
                }
                ?>
示例#5
0
/**
 */
function check_php_setting($php_setting, $recommended)
{
    $current = get_php_setting($php_setting);
    if ($current == strtoupper($recommended)) {
        return '<span class="ok">' . $current . '</span>';
    } else {
        return '<span class="ko">' . $current . '</span>';
    }
}
				<td><?php 
echo get_php_setting('file_uploads');
?>
</td>
			</tr>
			<tr>
				<td>Magic Quotes:</td>
				<td><?php 
echo get_php_setting('magic_quotes_gpc');
?>
</td>
			</tr>
			<tr>
				<td>Register Globals:</td>
				<td><?php 
echo get_php_setting('register_globals');
?>
</td>
			</tr>
			<tr>
				<td>Output Buffering:</td>
				<td><?php 
echo is_numeric(ini_get('output_buffering')) ? 'Yes' : 'No';
?>
</td>
			</tr>
			<tr>
				<td>Disabled Functions:</td>
				<td><?php 
echo ($df = ini_get('disable_functions')) ? $df : 'none';
?>
示例#7
0
function view()
{
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TorrentTrader Check</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
td { vertical-align: top; }
</style>
</head>
<body>
<center>
<br /><b>TorrentTrader v3 unoffical Config Check<br />v1.7 - TorrentialStorm<br /><br /></b>

<input type="button" class="button" value="Check Again" onclick="window.location=window.location" /><br />

<a href="check.php?phpinfo=1">PHPInfo</a></center><br />

<b>Required Settings Check:</b><br />
<p>If any of these items are highlighted in red then please take actions to correct them. <br />
Failure to do so could lead to your TorrentTrader! installation not functioning correctly.</p>
<br />
This system check is designed for unix based servers, windows based servers may not give desired results<br />
<br />
<br />

<table cellpadding="3" cellspacing="1" style="border-collapse: collapse" border="1">
<tr>
	<td>PHP version >= 4.3.0</td>
	<td>
	<?php 
    echo phpversion() < '4.3' ? '<b><font color="red">No</font> 4.3 or above required</b>' : '<b><font color="green">Yes</font></b>';
    echo " - Your PHP version is " . phpversion();
    ?>
	</td>
</tr>

<tr>
	<td>&nbsp; - zlib compression support</td>
	<td><?php 
    echo extension_loaded('zlib') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>&nbsp; - XML support</td>
	<td><?php 
    echo extension_loaded('xml') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>&nbsp; - MySQL support</td>
	<td><?php 
    echo function_exists('mysql_connect') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>&nbsp; - curl support (Not required but external torrents may scrape faster)</td>
	<td><?php 
    echo function_exists('curl_init') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>&nbsp; - gmp support (Required for IPv6)</td>
	<td><?php 
    echo extension_loaded('gmp') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>&nbsp; - bcmath support (Required for IPv6)</td>
	<td><?php 
    echo extension_loaded('bcmath') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>&nbsp; - hash_hmac support (Recommended - For better password encryption)</td>
	<td><?php 
    echo function_exists('hash_hmac') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>&nbsp; - suhosin extension (Optional)</td>
	<td><?php 
    echo extension_loaded('suhosin') ? '<b><font color="green">Available</font></b><br /><br />Add to your php.ini (otherwise you may have issues):<br />suhosin.get.disallow_nul = Off<br />suhosin.request.disallow_nul = Off' : '<b><font color="red">Unavailable</font></b>';
    ?>
</td>
</tr>

<tr>
	<td>backend/config.php</td>
	<td>
	<?php 
    if (@file_exists('backend/config.php') && @is_writable('backend/config.php')) {
        echo '<b><font color="red">Writeable</font></b><br />Warning: leaving backend/config.php writeable is a security risk';
    } else {
        echo '<b><font color="green">Unwriteable</font></b>';
    }
    ?>
	</td>
</tr>

<tr>
	<td>Document Root<br /><i><font size="1">(Use this for your PATHS in config.php)</font></i></td>
	<td><?php 
    echo str_replace('\\', '/', getcwd());
    ?>
</td>
</tr>

</table>


<br />
<p>These settings are recommended for PHP in order to ensure full compatibility with TorrentTrader!.
However, TorrentTrader! will still operate if your settings do not quite match the recommended.</p>

<table cellpadding="3" cellspacing="1" style="border-collapse: collapse" border="1">
<tr><td width="500px">Directive</td><td>Recommended</td><td>Actual</td></tr>

<?php 
    $php_recommended_settings = array(array('Safe Mode', 'safe_mode', 'OFF'), array('Display Errors (Can be off, but does make debugging difficult.)', 'display_errors', 'ON'), array('File Uploads', 'file_uploads', 'ON'), array('Magic Quotes Runtime', 'magic_quotes_runtime', 'OFF'), array('Register Globals', 'register_globals', 'OFF'), array('Output Buffering', 'output_buffering', 'OFF'), array('Session auto start', 'session.auto_start', 'OFF'), array('allow_url_fopen (Required for external torrents)', 'allow_url_fopen', 'ON'));
    foreach ($php_recommended_settings as $phprec) {
        ?>
	<tr>
	<td><?php 
        echo $phprec[0];
        ?>
:</td>
	<td><?php 
        echo $phprec[2];
        ?>
:</td>
	<td><b>
	<?php 
        if (get_php_setting($phprec[1]) == $phprec[2]) {
            ?>
		<font color="green">
	<?php 
        } else {
            ?>
		<font color="red">
	<?php 
        }
        echo get_php_setting($phprec[1]);
        ?>
</font></b>
</td></tr>
<?php 
    }
    ?>
</table>

<br /><b>Directory and File Permissions Check:</b><br />
<p>In order for TorrentTrader! to function correctly it needs to be able to access or write to certain files or directories.<br />
If you see "Unwriteable" you need to change the permissions on the file or directory to 777 (directories) or 666 (files) so that TorrentTrader to write to it.
<br />The censor.txt should be chmodded to <b>600</b>.
</p>
<br />

<table cellpadding="3" cellspacing="1" style='border-collapse: collapse' border="1" >
<?php 
    writableCell('backups');
    writableCell('uploads');
    writableCell('uploads/images');
    writableCell('cache');
    writableCell('cache/get_row_count');
    writableCell('cache/queries');
    writableCell('import');
    writableCell('censor.txt', 1);
    ?>
</table>
<br />
<?php 
    require_once "backend/mysql.php";
    echo "<b>Table Status Check:</b><br /><br />";
    if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass)) {
        printf("<font color='#ff0000'><b>Failed to connect to database:</b></font> (%d) %s<br />", mysql_errno(), mysql_error());
    } else {
        if (!@mysql_select_db($mysql_db)) {
            printf("<font color='#ff0000'><b>Failed to select database:</b></font> (%d) %s<br />", mysql_errno(), mysql_error());
        } else {
            $r = mysql_query("SHOW TABLES");
            if (!$r) {
                printf("<font color='#ff0000'><b>Failed to list tables:</b></font> (%d) %s<br />", mysql_errno(), mysql_error());
            } else {
                $tables = array();
                while ($rr = mysql_fetch_row($r)) {
                    $tables[] = $rr[0];
                }
                $arr[] = "announce";
                $arr[] = "bans";
                $arr[] = "blocks";
                $arr[] = "categories";
                $arr[] = "censor";
                $arr[] = "comments";
                $arr[] = "completed";
                $arr[] = "countries";
                $arr[] = "email_bans";
                $arr[] = "faq";
                $arr[] = "groups";
                $arr[] = "guests";
                $arr[] = "languages";
                $arr[] = "log";
                $arr[] = "messages";
                $arr[] = "news";
                $arr[] = "peers";
                $arr[] = "pollanswers";
                $arr[] = "polls";
                $arr[] = "ratings";
                $arr[] = "reports";
                $arr[] = "rules";
                $arr[] = "shoutbox";
                $arr[] = "stylesheets";
                $arr[] = "tasks";
                $arr[] = "teams";
                $arr[] = "torrentlang";
                $arr[] = "torrents";
                $arr[] = "users";
                $arr[] = "warnings";
                $arr[] = "forumcats";
                $arr[] = "forum_topics";
                $arr[] = "forum_posts";
                $arr[] = "forum_forums";
                $arr[] = "forum_readposts";
                $arr[] = "sqlerr";
                echo "<table cellpadding='3' cellspacing='1' style='border-collapse: collapse' border='1'>";
                echo "<tr><th>Table</th><th>Status</th></tr>";
                foreach ($arr as $t) {
                    if (!in_array($t, $tables)) {
                        echo "<tr><td>{$t}</td><td align='right'><font color='#ff0000'><b>MISSING</b></font></td></tr>";
                    } else {
                        echo "<tr><td>{$t}</td><td align='right'><font color='green'><b>OK</b></font></td></tr>";
                    }
                }
                echo "</table>";
                require "backend/config.php";
                echo "<br /><br /><b>Default Theme:</b> ";
                if (!is_numeric($site_config["default_theme"])) {
                    echo "<font color='#ff0000'><b>Invalid.</b></font> (Not a number)";
                } else {
                    $res = mysql_query("SELECT uri FROM stylesheets WHERE id={$site_config['default_theme']}");
                    if ($row = mysql_fetch_row($res)) {
                        if (file_exists("themes/{$row['0']}/header.php")) {
                            echo "<font color='green'><b>Valid.</b></font> (ID: {$site_config['default_theme']}, Path: themes/{$row['0']}/)";
                        } else {
                            echo "<font color='#ff0000'><b>Invalid.</b></font> (No header.php found)";
                        }
                    } else {
                        echo "<font color='#ff0000'><b>Invalid.</b></font> (No theme found with ID {$site_config['default_theme']})";
                    }
                }
                echo "<br /><b>Default Language:</b> ";
                if (!is_numeric($site_config["default_language"])) {
                    echo "<font color='#ff0000'><b>Invalid.</b></font> (Not a number)";
                } else {
                    $res = mysql_query("SELECT uri FROM languages WHERE id={$site_config['default_language']}");
                    if ($row = mysql_fetch_row($res)) {
                        if (file_exists("languages/{$row['0']}")) {
                            echo "<font color='green'><b>Valid.</b></font> (ID: {$site_config['default_language']}, Path: languages/{$row['0']})";
                        } else {
                            echo "<font color='#ff0000'><b>Invalid.</b></font> (File languages/{$row['0']} missing)";
                        }
                    } else {
                        echo "<font color='#ff0000'><b>Invalid.</b></font> (No language found with ID {$site_config['default_language']})";
                    }
                }
            }
        }
    }
    ?>
</body>
</html>
<?php 
}
示例#8
0
文件: index.php 项目: cwcw/cms
	</td>
	<td class="toggle">
	OFF
	</td>
	<td>
	<?php 
if (get_php_setting('session.auto_start') == 'OFF') {
    ?>
		<font color="green"><b>
		<?php 
} else {
    ?>
		<font color="red" style="bold"><b>
		<?php 
}
echo get_php_setting('session.auto_start');
?>
	</b></font>
	</td>
</tr>
</table>
</div>
</div>
<div class="clr"></div>

<h1>目录和文件的权限:</h1>
<div class="install-text">
为了正常的运行 Mambo ,有些文件和文件夹必须有可写的权限。如果你看到“不可写”,请在服务器上修改它的属性!
<div class="clr">&nbsp;&nbsp;</div>
<div class="ctr"></div>
</div>
示例#9
0
	<td class="toggle"><?php 
    echo $phprec[2];
    ?>
:</td>
	<td>
	<?php 
    if (get_php_setting($phprec[1]) == $phprec[2]) {
        ?>
		<font color="green"><b>
	<?php 
    } else {
        ?>
		<font color="red"><b>
	<?php 
    }
    echo get_php_setting($phprec[1]);
    ?>
	</b></font>
	<td>
</tr>
<?php 
}
?>
</table>
</div>
</div>
<div class="clr"></div>

<h1>Files Permissions:</h1>
<div class="install-text">
In order for PHP-Nuke to function
示例#10
0
function show_errors($error_val = 0)
{
    global $show_all_errors;
    if (empty($_SESSION['error_reporting'])) {
        $_SESSION['error_reporting'] = get_php_setting('error_reporting');
    }
    ini_set('error_reporting', $show_all_errors == true ? 64 : ($error_val ? $_SESSION['error_reporting'] : 64));
}
示例#11
0
/**
 * check_settings
 */
function check_settings()
{
    global $gBitSmarty, $error, $warning;
    $config_file = clean_file_path(empty($_SERVER['CONFIG_INC']) ? BIT_ROOT_PATH . 'config/kernel/config_inc.php' : $_SERVER['CONFIG_INC']);
    $i = 0;
    // required settings - if not met, are passed into the array $reqd
    // PHP system checks
    $phpvers = '4.3.0';
    if (phpversion() < $phpvers) {
        $required[$i]['note'] = '<strong>PHP version</strong> should be greater than <strong>' . $phpvers . '</strong>.<br />Your installed version of PHP is <strong>' . phpversion() . '</strong>.';
        $required[$i]['passed'] = FALSE;
    } else {
        $required[$i]['note'] = '<strong>PHP version</strong> is greater than <strong>' . $phpvers . '</strong>.<br />Your installed version of PHP is <strong>' . phpversion() . '</strong>.';
        $required[$i]['passed'] = TRUE;
    }
    // check file and directory permissisions
    $i++;
    if (@file_exists($config_file) && @bw_is_writeable($config_file)) {
        $required[$i]['note'] = 'The Bitweaver configuration file is available and the file is writeable:<br /><code>' . $config_file . '</code>';
        $required[$i]['passed'] = TRUE;
    } elseif (@file_exists($config_file) && !@bw_is_writeable($config_file)) {
        $required[$i]['note'] = 'The Bitweaver configuration file is available but the file is not writeable. Please execute something like:<br /><code>chmod 777 ' . $config_file . '</code>';
        $required[$i]['passed'] = FALSE;
    } else {
        $required[$i]['note'] = 'The Bitweaver configuration file is not available. Please execute something like:<br /><code>touch ' . $config_file . ';<br />chmod 777 ' . $config_file . '</code>';
        $required[$i]['passed'] = FALSE;
    }
    $i++;
    $dir_check = array('storage' => defined('STORAGE_PKG_PATH') ? STORAGE_PKG_PATH : BIT_ROOT_PATH . 'storage', 'temp' => defined('TEMP_PKG_PATH') ? TEMP_PKG_PATH : sys_get_temp_dir() . '/bitweaver/' . $_SERVER['SERVER_NAME']);
    foreach ($dir_check as $name => $d) {
        // final attempt to create the required directories
        @mkdir($d, 0644);
        if (@is_dir($d) && bw_is_writeable($d)) {
            $required[$i]['note'] = "The {$name} directory is available and it is writeable.<br /><code>{$d}</code>";
            $required[$i]['passed'] = TRUE;
        } elseif (@is_dir($d) && !bw_is_writeable($d)) {
            $required[$i]['note'] = "The {$name} directory is available but it is not writeable.<br />Please execute something like:<br /><code>chmod -R 777 {$d}</code>";
            $required[$i]['passed'] = FALSE;
        } else {
            $required[$i]['note'] = "The {$name} directory is not available and we cannot create it automaticalliy.<br />Please execute something like:<br /><code>mkdir -m 777 {$d}</code>";
            $required[$i]['passed'] = FALSE;
        }
        $i++;
    }
    foreach ($required as $r) {
        if (!$r['passed']) {
            $error = TRUE;
        }
    }
    // check extensions
    $php_ext = array('zlib' => '<a class="external" href="http://www.zlib.net/">The zlib compression libraries</a> are used to pack and unpack compressed files such as .zip files.', 'gd' => '<a class="external" href="http://www.boutell.com/gd/">GD Libraries</a> are used to manipulate images. Bitweaver uses these libraries to create thumbnails and convert images from one format to another. If you are running Red Hat or Fedora Core, you can try: <kbd>yum install php-gd</kbd>. The GD libaries are quite limited and <em>don\'t support</em> a number of image formats including <em>.bmp</em>. If you are planning on uploading and using a lot of images, we recommend you use one of the other image processors.', 'imagick' => 'ImageMagick supports a multitude of different image and video formats and <em>can be used instead of the GD Libraries</em>. Using these libraries will allow you to upload most image formats without any difficulties. For installation help, please view <a class="external" href="http://www.bitweaver.org/wiki/ImageMagick">ImageMagick and MagickWand installation instructions</a> or visit the <a class="external" href="http://www.imagemagick.org">ImageMagick homepage</a>.', 'magickwand' => 'MagickWand is a newer PHP extension for ImageMagick. For installation help, please view Bitweaver\'s: <a class="external" href="http://www.bitweaver.org/wiki/ImageMagick">ImageMagick and MagickWand installation instructions</a> or visit the <a class="external" href="http://www.imagemagick.org">ImageMagick homepage</a>.');
    foreach ($php_ext as $ext => $note) {
        $extensions[$ext]['note'] = 'The extension <strong>' . $ext . '</strong> is ';
        if (extension_loaded($ext)) {
            $extensions[$ext]['passed'] = TRUE;
        } else {
            $extensions[$ext]['note'] .= 'not ';
            $extensions[$ext]['passed'] = FALSE;
        }
        $extensions[$ext]['note'] .= 'available.<br />' . $note;
    }
    // disable one of the imagick / magickwand warnings
    if ($extensions['magickwand']['passed'] == TRUE && $extensions['imagick']['passed'] == FALSE) {
        unset($extensions['imagick']);
    } elseif ($extensions['imagick']['passed'] == TRUE && $extensions['magickwand']['passed'] == FALSE) {
        unset($extensions['magickwand']);
    }
    // make sure we show the worning flag if there is a need for it
    foreach ($extensions as $info) {
        if (!$info['passed']) {
            $warning = TRUE;
        }
    }
    // output has to be verbose that we can catch the output of the shell_exec
    // using --help, -h or --version should make applications output something to stdout - this is no guarantee though, bunzip2 doesn't...
    $execs = array('tar' => array('command' => 'tar -xvf', 'dest_params' => '-C', 'testfile' => 'test.tar', 'note' => '<strong>Tarball</strong> is a common archiving format on Linux and <a class="external" href="http://www.gnu.org/software/tar/">tar</a> is used to extract .tar files. For windows use <a class="external" href="http://gnuwin32.sourceforge.net/downlinks/libarchive.php">bsdtar</a> from gnuwin32 ( See <a class="external" href="http://www.bitweaver.org/wiki/Windows+installation+notes">Windows notes for installation help</a> ).'), 'bzip2' => array('command' => 'tar -jvxf', 'dest_params' => '-C', 'testfile' => 'test.tar.bz2', 'note' => '<strong>Bzip</strong> is a common compression format on Linux and <a class="external" href="http://www.bzip.org/">bzip2</a> is used to extract .bz2 and in combination with tar .tar.bz2 file. ( For windows see bsdtar above. )'), 'gzip' => array('command' => 'tar -zvxf', 'dest_params' => '-C', 'testfile' => 'test.tar.gz', 'note' => '<strong>Gzip</strong> is a common compression format on Linux and <a class="external" href="http://www.gnu.org/software/gzip/gzip.html">gzip</a> is used to extract .gz and in combination with tar .tar.gz file. ( For windows see bsdtar above. )'), 'unzip' => array('command' => 'unzip -v', 'dest_params' => '-d', 'testfile' => 'test.zip', 'note' => '<strong>Zip</strong> is a common compression format on all operating systems and <a class="external" href="http://www.info-zip.org/">unzip</a> is used to extract .zip files.'), 'unrar' => array('command' => 'unrar x', 'dest_params' => '', 'testfile' => 'test.rar', 'note' => '<strong>Rar</strong> is a common compression format on all operating systems and <a class="external" href="http://www.rarlab.com/rar_add.htm">unrar</a> is used to extract .rar files.'), 'gs' => array('command' => 'gs --version', 'note' => '<a class="external" href="http://www.cs.wisc.edu/~ghost/">GhostScript</a> is an interpreter for the PostScript language and for PDF and is used to create PDF previews when uploading PDF files to Fisheye. If you do not have this installed, previews of PDF files will not be generated on upload. If you have difficulties with GhostScript, please try installing a different version. Bitweaver was successfully tested with versions 7.5, 8.15.4, 8.5, 8.54. There where difficulties with version 8.1.', 'result' => 'Your version of GhostScript: '), 'graphviz' => array('command' => 'dot -V', 'note' => '<a class="external" href="http://www.graphviz.org/">Graphviz</a> is a way of representing structural information as diagrams of abstract graphs and networks and visualizing that representation. It is used by the {graphviz} Liberty plugin and you only need to install it if you intend to enable that plugin.<br /><em>The Pear::Image_Graphviz plugin is required as well.</em>', 'result' => 'Your version of Graphviz: '));
    foreach ($execs as $exe => $app) {
        $executables[$exe]['note'] = 'The application <strong>' . $exe . '</strong> is ';
        if (!empty($app['testfile']) && is_readable($file = INSTALL_PKG_PATH . 'testfiles/' . $app['testfile'])) {
            $command = $app['command'] . ' "' . $file . '" ' . $app['dest_params'] . ' "' . TEMP_PKG_PATH . '"';
        } else {
            $command = $app['command'];
        }
        if (get_php_setting('safe_mode') == 'OFF' && ($shellResults[$exe] = shell_exec($command . ' 2> ' . TEMP_PKG_PATH . 'output'))) {
            @unlink(TEMP_PKG_PATH . 'test.txt');
            $executables[$exe]['passed'] = TRUE;
        } elseif ($shellResults[$exe] = join("", file(TEMP_PKG_PATH . 'output'))) {
            if (strpos($shellResults[$exe], 'command') and strpos($shellResults[$exe], 'not')) {
                $executables[$exe]['note'] .= 'not ';
                $executables[$exe]['passed'] = FALSE;
                $shellResults[$exe] = "";
            } else {
                @unlink(TEMP_PKG_PATH . 'test.txt');
                $executables[$exe]['passed'] = TRUE;
            }
        } else {
            $executables[$exe]['note'] .= 'not ';
            $executables[$exe]['passed'] = FALSE;
        }
        $executables[$exe]['note'] .= 'available.<br />' . $app['note'];
        if (!empty($app['result']) && !empty($shellResults[$exe])) {
            $executables[$exe]['note'] .= '<br />' . $app['result'] . '<strong>' . $shellResults[$exe] . '</strong>';
        }
    }
    // PEAR checks
    $pears = array('PEAR' => array('path' => 'PEAR.php', 'note' => 'This check indicates if PEAR is installed and available. To make use of PEAR extensions, you need to make sure that PEAR is installed and the include_path is set in your php.ini file.'), 'Auth' => array('path' => 'Auth/Auth.php', 'note' => 'This will allow you to use the PEAR::Auth package to authenticate users on your website.', 'install_command' => 'pear install --onlyreqdeps Auth;'), 'Text_Wiki' => array('path' => 'Text/Wiki.php', 'note' => 'Having PEAR::Text_Wiki installed will make more wiki format parsers available. The following parsers will be recognised and used: Text_Wiki_BBCode, Text_Wiki_Cowiki, Text_Wiki_Creole, Text_Wiki_Doku, Text_Wiki_Mediawiki, Text_Wiki_Tiki', 'install_command' => 'pear install --onlyreqdeps Text_Wiki_BBCode Text_Wiki_Cowiki Text_Wiki_Creole Text_Wiki_Doku Text_Wiki_Mediawiki Text_Wiki_Tiki;'), 'Text_Diff' => array('path' => 'Text/Diff.php', 'note' => 'PEAR::Text_Diff makes inline diffing of content available.', 'install_command' => 'pear install --onlyreqdeps Text_Diff;'), 'Image_Graphviz' => array('path' => 'Image/GraphViz.php', 'note' => 'Pear::Image_Graphviz makes the {graphviz} plugin available. With it you can draw maps of how your Wiki pages are linked to each other. This can be used for informational purposes or a site-map. It requires the application graphviz to be installed on your server as well.', 'install_command' => 'pear install --onlyreqdeps Image_Graphviz;'), 'HTMLPurifier' => array('path' => 'HTMLPurifier.php', 'note' => 'HTMLPurifier is an advanced system for defending against Cross Site Scripting (XSS) attacks and ensuring that all code on your site is standards compliant. It is highly recommended if you are going to allow HTML submission to your site. It is not required if you are only going to allow the input of a Wiki format like Tikiwiki or BBcode. You also need to enable it in the Liberty plugins administration after installation. See <a class="external" href="http://www.bitweaver.org/wiki/HTMLPurifier">http://www.bitweaver.org/wiki/HTMLPurifier</a> and <a class = "external" href = "http: // htmlpurifier.org">http://htmlpurifier.org</a> for more information.', 'install_command' => 'pear channel-discover htmlpurifier.org;<br />pear install hp/HTMLPurifier;'), 'HTTP_Download' => array('path' => 'HTTP/Download.php', 'note' => 'Treasury - the file manager of Bitweaver - can make use of PEAR::HTTP_Download to provide more reliable downloads and download resume support when using a download manager.', 'install_command' => 'pear install --alldeps HTTP_Download;'));
    foreach ($pears as $pear => $info) {
        if ($pear == 'PEAR') {
            $pearexts[$pear]['note'] = '<strong>' . $pear . '</strong> is ';
        } else {
            $pearexts[$pear]['note'] = 'The extension <strong>PEAR::' . $pear . '</strong> is ';
        }
        if (@(include_once $info['path'])) {
            $pearexts[$pear]['passed'] = TRUE;
        } else {
            $pearexts[$pear]['note'] .= 'not ';
            $pearexts[$pear]['passed'] = FALSE;
        }
        $pearexts[$pear]['original_note'] = $info['note'];
        $pearexts[$pear]['note'] .= 'available.<br />';
        $pearexts[$pear]['note'] .= $info['note'];
        if (!empty($info['install_command']) && $pearexts[$pear]['passed'] == FALSE) {
            $pearexts[$pear]['note'] .= '<br /><em>Install using this command:</em><br /><code>' . $info['install_command'] . '</code>';
        }
    }
    $i = 0;
    // recommended php toggles - these don't need explicit explanations on how to rectify them
    // start with special cases
    $recommended[$i] = array('Memory Limit', 'memory_limit', 'shouldbe' => 'at least 16M', 'actual' => get_cfg_var('memory_limit'));
    if (preg_replace('/M/i', '', get_cfg_var('memory_limit')) > 15) {
        $recommended[$i]['passed'] = TRUE;
    } else {
        $recommended[$i]['passed'] = FALSE;
        $gBitSmarty->assign('memory_warning', TRUE);
    }
    $i++;
    // now continue with easy toggle checks
    $php_rec_toggles = array(array('Safe Mode', 'safe_mode', 'shouldbe' => 'OFF'), array('Display Errors', 'display_errors', 'shouldbe' => 'OFF'), array('File Uploads', 'file_uploads', 'shouldbe' => 'ON'), array('Magic Quotes GPC', 'magic_quotes_gpc', 'shouldbe' => 'OFF'), array('Magic Quotes Runtime', 'magic_quotes_runtime', 'shouldbe' => 'OFF'), array('Magic Quotes Sybase', 'magic_quotes_sybase', 'shouldbe' => 'OFF'), array('Register Globals', 'register_globals', 'shouldbe' => 'OFF'), array('Output Buffering', 'output_buffering', 'shouldbe' => 'OFF'), array('Session auto start', 'session.auto_start', 'shouldbe' => 'OFF'));
    foreach ($php_rec_toggles as $php_rec_toggle) {
        $php_rec_toggle['actual'] = get_php_setting($php_rec_toggle[1]);
        if (get_php_setting($php_rec_toggle[1]) == $php_rec_toggle['shouldbe']) {
            $php_rec_toggle['passed'] = TRUE;
        } else {
            $php_rec_toggle['passed'] = FALSE;
        }
        $recommended[] = $php_rec_toggle;
        $i++;
    }
    // settings that are useful to know about
    $php_ini_gets = array(array('<strong>Maximum post size</strong> restricts the size of files uploaded using a form. <br />Recommended: at least <strong>8M</strong>.', 'post_max_size'), array('<strong>Upload max filesize</strong> is related to maximim post size and will also limit the size of uploads. <br />Recommended: at least <strong>8M</strong>.', 'upload_max_filesize'), array('<strong>Maximum execution time</strong> is related to time outs in PHP. It affects database upgrades and backups. <br />Recommended: <strong>60</strong>.', 'max_execution_time'));
    foreach ($php_ini_gets as $php_ini_get) {
        $value = ini_get($php_ini_get[1]);
        if ($value == 1) {
            $value = "On";
        } elseif ($value == 0) {
            $value = "Off";
        }
        $show[$php_ini_get[1]] = $php_ini_get[0] . "<br /><strong>{$php_ini_get[1]}</strong> is set to <strong>{$value}</strong>";
    }
    $res['required'] = $required;
    $res['extensions'] = $extensions;
    $res['executables'] = $executables;
    $res['pearexts'] = $pearexts;
    $res['recommended'] = $recommended;
    $res['show'] = $show;
    return $res;
}
示例#12
0
function system_info($version, $option)
{
    global $mosConfig_absolute_path, $database, $_VERSION;
    $version = $_VERSION->PRODUCT . ' <strong style="color: red;">' . $_VERSION->RELEASE . '.' . $_VERSION->DEV_LEVEL . '</strong> ' . $_VERSION->DEV_STATUS . ' [ ' . $_VERSION->CODENAME . ' ] ' . $_VERSION->RELDATE . ' ' . $_VERSION->RELTIME . ' ' . $_VERSION->RELTZ;
    //$tab = mosGetParam( $_REQUEST, 'tab', 'tab1' );
    $width = 400;
    // width of 100%
    $tabs = new mosTabs(0);
    ?>
	<br />
	<?php 
    $tabs->startPane('sysinfo');
    $tabs->startTab($GLOBALS['messages']['sisysteminfo'], 'system-page');
    ?>
	<table class="adminform">
	<tr>
		<td valign="top" width="250" style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['sibuilton'];
    ?>
:
		</td>
		<td>
		<?php 
    echo php_uname();
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['sidbversion'];
    ?>
:
		</td>
		<td>
		<?php 
    echo mysql_get_server_info();
    ?>
		</td>
	</tr>
	<tr>
		<td valign="top" style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['siphpversion'];
    ?>
:
		</td>
		<td>
		<?php 
    echo phpversion();
    ?>
		&nbsp;
		<?php 
    echo phpversion() >= '4.3' ? '' : $GLOBALS['messages']['siphpupdate'];
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['siwebserver'];
    ?>
:
		</td>
		<td>
		<?php 
    echo get_server_software();
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['siwebsphpif'];
    ?>
:
		</td>
		<td>
		<?php 
    echo php_sapi_name();
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['simamboversion'];
    ?>
:
		</td>
		<td>
		<?php 
    echo $version;
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['siuseragent'];
    ?>
:
		</td>
		<td>
		<?php 
    echo phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT'];
    ?>
		</td>
	</tr>
	<tr>
		<td valign="top" style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['sirelevantsettings'];
    ?>
:
		</td>
		<td>
			<table cellspacing="1" cellpadding="1" border="0">
			<tr>
				<td valign="top">
					<?php 
    echo $GLOBALS['messages']['sisafemode'];
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('safe_mode', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sibasedir'];
    ?>
:
				</td>
				<td>
				<?php 
    echo ($ob = ini_get('open_basedir')) ? $ob : 'none';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sidisplayerrors'];
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('display_errors');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sishortopentags'];
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('short_open_tag');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sifileuploads'];
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('file_uploads');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['simagicquotes'];
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('magic_quotes_gpc');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['siregglobals'];
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('register_globals', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sioutputbuf'];
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('output_buffering', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sisesssavepath'];
    ?>
:
				</td>
				<td>
				<?php 
    echo ($sp = ini_get('session.save_path')) ? $sp : 'none';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sisessautostart'];
    ?>
:
				</td>
				<td>
				<?php 
    echo intval(ini_get('session.auto_start'));
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sixmlenabled'];
    ?>
:
				</td>
				<td>
					<?php 
    echo extension_loaded('xml') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sizlibenabled'];
    ?>
:
				</td>
				<td>
				<?php 
    echo extension_loaded('zlib') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sidisabledfuncs'];
    ?>
:
				</td>
				<td>
				<?php 
    echo ($df = ini_get('disable_functions')) ? $df : 'none';
    ?>
				</td>
			</tr>
			<?php 
    $query = "SELECT name FROM #__mambots" . "\nWHERE folder='editors' AND published='1'" . "\nLIMIT 1";
    $database->setQuery($query);
    $editor = $database->loadResult();
    ?>
			<tr>
				<td>
					<?php 
    echo $GLOBALS['messages']['sieditor'];
    ?>
:
				</td>
				<td>
					<?php 
    echo $editor;
    ?>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign="top" style="font-weight:bold;">
			<?php 
    echo $GLOBALS['messages']['siconfigfile'];
    ?>
:
		</td>
		<td>
		<?php 
    $cf = file($mosConfig_absolute_path . '/configuration.php');
    foreach ($cf as $k => $v) {
        if (eregi('mosConfig_host', $v)) {
            $cf[$k] = '$mosConfig_host = \'xxxxxx\'';
        } else {
            if (eregi('mosConfig_user', $v)) {
                $cf[$k] = '$mosConfig_user = \'xxxxxx\'';
            } else {
                if (eregi('mosConfig_password', $v)) {
                    $cf[$k] = '$mosConfig_password = \'xxxxxx\'';
                } else {
                    if (eregi('mosConfig_db ', $v)) {
                        $cf[$k] = '$mosConfig_db = \'xxxxxx\'';
                    } else {
                        if (eregi('<?php', $v)) {
                            $cf[$k] = '&lt;?php';
                        }
                    }
                }
            }
        }
    }
    echo implode('<br>', $cf);
    ?>
		</td>
	</tr>
	</table>
	<?php 
    $tabs->endTab();
    $tabs->startTab($GLOBALS['messages']['siphpinfo'], 'php-page');
    ?>
	<table class="adminform">
	<tr>
		<th colspan="2">
			<?php 
    echo $GLOBALS['messages']['siphpinformation'];
    ?>
:
		</th>
	</tr>
	<tr>
		<td>
		<?php 
    ob_start();
    phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
    $phpinfo = ob_get_contents();
    ob_end_clean();
    preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
    $output = preg_replace('#<table#', '<table class="adminlist" align="center"', $output[1][0]);
    $output = preg_replace('#(\\w),(\\w)#', '\\1, \\2', $output);
    $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output);
    $output = preg_replace('#<hr />#', '', $output);
    echo $output;
    ?>
		</td>
	</tr>
	</table>
	<?php 
    $tabs->endTab();
    $tabs->startTab($GLOBALS['messages']['sipermissions'], 'perms');
    ?>
	<table class="adminform">
	  <tr>
		<th colspan="2">&nbsp;<?php 
    echo $GLOBALS['messages']['sidirperms'];
    ?>
:</th>
	  </tr>
	  <tr>
		<td colspan="2">
			<span style="font-weight:bold;"><?php 
    echo $GLOBALS['messages']['sidirpermsmess'];
    ?>
:</span>
		</td>
	  </tr>
	  <tr>
	  	<td width="50%">
		<?php 
    mosHTML::writableCell('administrator/backups');
    mosHTML::writableCell('administrator/components');
    mosHTML::writableCell('administrator/modules');
    mosHTML::writableCell('administrator/templates');
    mosHTML::writableCell('cache');
    mosHTML::writableCell('components');
    mosHTML::writableCell('images');
    mosHTML::writableCell('images/banners');
    mosHTML::writableCell('images/stories');
    mosHTML::writableCell('language');
    mosHTML::writableCell('mambots');
    mosHTML::writableCell('mambots/content');
    mosHTML::writableCell('mambots/search');
    mosHTML::writableCell('media');
    mosHTML::writableCell('modules');
    mosHTML::writableCell('templates');
    ?>

		</td>
	  </tr>
	</table>
	<?php 
    $tabs->endTab();
    $tabs->endPane();
    ?>
	<?php 
}
示例#13
0
文件: index.php 项目: rhertzog/lcs
        etranslate('Detailed PHP Info');
        ?>
" onClick="testPHPInfo()" />
<?php 
    }
    ?>
</th></tr>
<?php 
    foreach ($php_settings as $setting) {
        ?>
  <tr><td class="prompt"><?php 
        echo $setting[0];
        ?>
</td>
  <?php 
        $ini_get_result = get_php_setting($setting[1], $setting[3]);
        $class = $ini_get_result == $setting[2] ? 'recommended' : 'notrecommended';
        echo "<td class=\"{$class}\">";
        if ($class == 'recommended') {
            echo '<img src="recommended.gif" alt=""/>&nbsp;';
        } else {
            echo '<img src="not_recommended.jpg" alt=""/>&nbsp;';
        }
        echo $ini_get_result;
        ?>
   </td></tr>
<?php 
    }
    foreach ($php_constants as $constant) {
        ?>
  <tr><td class="prompt"><?php 
示例#14
0
function configuration()
{
    global $secteur, $page, $php_recommended_settings, $_path;
    if ($page == 'configuration') {
        foreach ($php_recommended_settings as $l => $phprec) {
            $setting[$l] = get_php_setting($phprec[1]);
        }
        $sp = ini_get('session.save_path');
        ?>
<div id="ctr" align="center">
  <div class="install">
    <div class="Conteneur">
    
 <h1>Condition minimale requise:</h1>
    <ul style='text-align:left'>
<li>Serveur HTTP (Apache 2.x)</li>
<li>PHP (5.2.X)</li>
<li>Mysql (5.5) - (Caranille fonctionne aussi avec PostgreSQL et la base de donnée Oracle)</li>
</ul>
    
      <h1> Permissions des répertoires: </h1>
      <div class="install-text">
        <p> Certains répertoires doivent être accessibles en lecture et écriture. </p>
        <p> Si certains des répertoires listés co-contre sont dans l'état "Non modifiable", alors vous devrez changer les CHMOD pour les rendre "Modifiables". </p>
        <div class="clr">&nbsp;&nbsp;</div>
        <div class="ctr"></div>
      </div>
      <div class="install-form">
        <div class="form-block">
          <table class="content">
            <?php 
        writableCell('');
        writableCell('Logs');
        writableCell('Design');
        //writableCell( 'configuration' );
        writableCell('Scripts');
        writableCell('Styles');
        //	writableCell( 'tmp' );
        //writableCell( 'modules' );
        //writableCell( 'templates' );
        ?>
          </table>
        </div>
        <div class="clr"></div>
      </div>
      <div class="clr"></div>
      <h1> Vérification des paramètres nécessaires: </h1>
      <div class="install-text"> 
        <p> Si certains éléments sont écrits en rouge, alors veuillez prendre les mesures nécessaires pour les corriger. </p>
        <div class="ctr"></div>
      </div>
      <div class="install-form">
        <div class="form-block">
          <table class="content">
            <tr>
              <td class="item"> PHP version >= 5 </td>
              <td align="left"><?php 
        echo phpversion() < '5' ? '<b><font color="red">Non</font></b>' : '<b><font color="green">Oui</font></b>';
        ?>
 </td>
            </tr>
            <tr>
              <td>Compression ZLIB </td>
              <td align="left"><?php 
        echo extension_loaded('zlib') ? '<b><font color="green">Oui</font></b>' : '<b><font color="red">Non</font></b>';
        ?>
 </td>
            </tr>
            <tr>
              <td>Support XML </td>
              <td align="left"><?php 
        echo extension_loaded('xml') ? '<b><font color="green">Oui</font></b>' : '<b><font color="red">Non</font></b>';
        ?>
 </td>
            </tr>
            <tr>
              <td>Support MySQL </td>
              <td align="left"><?php 
        echo function_exists('mysql_connect') ? '<b><font color="green">Oui</font></b>' : '<b><font color="red">Non</font></b>';
        ?>
 </td>
            </tr>
            <tr>
              <td valign="top" class="item"> Config.php </td>
              <td align="left"><?php 
        if (@file_exists($_path . 'Config.php') && @is_writable($_path . 'Config.php')) {
            echo '<b><font color="green">Modifiable</font></b>';
        } elseif (is_writable($_path)) {
            echo '<b><font color="green">Modifiable</font></b>';
        } else {
            echo '<b><font color="red">Non modifiable</font></b>';
            echo "<br /><span class='small'>Vous pouvez poursuivre l'installation, vous devrez toutefois copier et coller les données de configuration affichées à la fin de l'installation dans un fichier Config.php, que vous devrez ensuite uploader.</span>";
        }
        ?>
              </td>
            </tr>
            
            <tr>
              <td class="item"> Session save path </td>
              <td align="left" valign="top"><?php 
        echo is_writable($sp) ? '<b><font color="green">Modifiable</font></b>' : '<b><font color="red">Non modifiable</font></b>';
        ?>
 </td>
            </tr>
            <tr>
              <td class="item" colspan="2"><b> <?php 
        echo $sp ? $sp : 'Not set';
        ?>
 </b> </td>
            </tr>
        </table>
        </div>
      </div>
      <div class="clr"></div>
      <?php 
        $wrongSettingsTexts = array();
        if (ini_get('magic_quotes_gpc') == '1') {
            $wrongSettingsTexts[] = 'Paramètre PHP magic_quotes_gpc est sur `ON` au lieu de `OFF`';
        }
        if (ini_get('register_globals') == '1') {
            $wrongSettingsTexts[] = 'Paramètre PHP register_globals est sur `ON` au lieu de `OFF`';
        }
        if (count($wrongSettingsTexts)) {
            ?>
      <h1> Vérification de la sécurité: </h1>
      <div class="install-text">
        <p> Les paramètres PHP Serveur suivants ne sont pas optimum pour la <strong>Sécurité</strong> de votre site, il vous est recommandé de les modifier: </p>
      </div>
      <div class="install-form">
        <div class="form-block" style=" border: 1px solid #cc0000; background: #ffffcc;">
          <table class="content">
            <tr>
            
            
              <td class="item"><ul style="margin: 0px; padding: 0px; padding-left: 5px; text-align: left; padding-bottom: 0px; list-style: none;">
                  <?php 
            foreach ($wrongSettingsTexts as $txt) {
                ?>
                  <li style="min-height: 25px; padding-bottom: 5px; padding-left: 25px; color: red; font-weight: bold;" >
                    <?php 
                echo $txt;
                ?>
                  </li>
                  <?php 
            }
            ?>
                </ul></td>
            </tr>
          </table>
        </div>
      </div>
      <div class="clr"></div>
      <?php 
        }
        ?>
      <h1> Configuration recommandée: </h1>
      <div class="install-text">
        <p> Ces paramètres PHP sont recommandés afin d'assurer 
          une pleine compatibilité avec le script. </p>
        <p> Toutefois cela fonctionne correctement s'ils ne sont pas activés. <br />
        </p>
        <div class="ctr"></div>
      </div>
      <div class="install-form">
        <div class="form-block">
          <table class="content">
            <tr>
              <td class="toggle" width="500px"> Directive </td>
              <td class="toggle"> Recommandé </td>
              <td class="toggle"> Actuel </td>
            </tr>
              

                       <?php 
        foreach ($php_recommended_settings as $l => $phprec) {
            ?>
            <tr>
            
              <td class="item"><?php 
            echo $phprec[0];
            ?>
</td>
              <td class="toggle"><font color="blue"><?php 
            echo $phprec[2];
            ?>
</font></td>
              <td>
                <strong>
          <font color="<?php 
            echo $setting[$l] == $phprec[2] ? "green" : "red";
            ?>
"><?php 
            echo $setting[$l];
            ?>
</font> 
                </strong>
              </td>
            </tr>
            <?php 
        }
        ?>
            
                        <tr>
              <td>Réécriture URL </td>
               <td class="toggle"><font color="blue">ON</font></td>
              <td align="left"><?php 
        echo function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules()) ? '<b><font color="green">ON</font></b>' : '<b><font color="red">OFF</font></b>';
        ?>
 </td>
            </tr>
            
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
<?php 
    }
}
示例#15
0
function view()
{
    $sp = ini_get('session.save_path');
    $_VERSION = new joomlaVersion();
    $versioninfo = $_VERSION->RELEASE . '.' . $_VERSION->DEV_LEVEL . ' ' . $_VERSION->DEV_STATUS;
    $version = $_VERSION->PRODUCT . ' ' . $_VERSION->RELEASE . '.' . $_VERSION->DEV_LEVEL . ' ' . $_VERSION->DEV_STATUS . ' [ ' . $_VERSION->CODENAME . ' ] ' . $_VERSION->RELDATE . ' ' . $_VERSION->RELTIME . ' ' . $_VERSION->RELTZ;
    echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?" . ">";
    ?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<title>Joomla! - Instalador Web</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link rel="shortcut icon" href="../images/favicon.ico" />
	<link rel="stylesheet" href="install.css" type="text/css" />
	</head>
	<body>
	
	<div id="wrapper">
	  <div id="div">
        <div id="header">
          <div id="joomla"><img src="header_install.png" alt="Instalação do Joomla" /></div>
        </div>
      </div>
	</div>
	
	<div id="ctr" align="center">
		<div class="install">
			<div id="stepbar">
				<div class="step-on">Checagem de <br /> pré-instalação</div>
				<div class="step-off">Licença</div>
				<div class="step-off">1º passo</div>
				<div class="step-off">2º passo</div>
				<div class="step-off">3º passo</div>
				<div class="step-off">4º passo</div>
			</div>
	
			<div id="right">
				<div id="step">Checagem de pré-instalação</div>
	
				<div class="far-right">
					<input name="Button2" type="submit" class="button" value="Próximo >>" onclick="window.location='install.php';" />
					<br/>
					<br/>
					<input type="button" class="button" value="Checar Novamente" onclick="window.location=window.location" />
				</div>
				<div class="clr"></div>				
					
				<h1>Checagem de pré-instalação para:<br/><?php 
    echo $version;
    ?>
</h1>
	
				<h1>
					Configurações requeridas:
				</h1>
				
<div class="install-text"> Se algum destes itens estiver destacado em vermelho
  então por favor providencie a correção do mesmo. A persistência da falha pode
  levar a sua instalação do Joomla a não funcionar corretamente.
  <div class="ctr"></div>
			  </div>
	
				<div class="install-form">
					<div class="form-block">
						<table class="content">
						<tr>
							<td class="item">
								Versão do PHP >  4.1.0							</td>
							<td align="left">
								<?php 
    echo phpversion() < '4.1' ? '<b><font color="red">Não</font></b>' : '<b><font color="green">Sim</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp; - Suporte à compressão zlib							</td>
							<td align="left">
								<?php 
    echo extension_loaded('zlib') ? '<b><font color="green">Disponível</font></b>' : '<b><font color="red">Não Disponível</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp; - Suporte à XML							</td>
							<td align="left">
								<?php 
    echo extension_loaded('xml') ? '<b><font color="green">Disponível</font></b>' : '<b><font color="red">Não Disponível</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp; - Suporte à MySQL							</td>
							<td align="left">
								<?php 
    echo function_exists('mysql_connect') ? '<b><font color="green">Disponível</font></b>' : '<b><font color="red">Não Disponível</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td valign="top" class="item">
								configuration.php							</td>
							<td align="left">
								<?php 
    if (@file_exists('../configuration.php') && @is_writable('../configuration.php')) {
        echo '<b><font color="green">Permissão para escrita</font></b>';
    } else {
        if (is_writable('..')) {
            echo '<b><font color="green">Permissão para escrita</font></b>';
        } else {
            echo '<b><font color="red">Sem permissão para escrita</font></b><br /><span class="small">You can still continue the install as the configuration will be displayed at the end, just copy & paste this and upload.</span>';
        }
    }
    ?>
							</td>
						</tr>
						<tr>
							<td class="item">
								Caminho das sessões							</td>
							<td align="left" valign="top">
								<?php 
    echo is_writable($sp) ? '<b><font color="green">Permissão para escrita</font></b>' : '<b><font color="red">Sem permissão para escrita</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td class="item" colspan="2">
								<b>
									<?php 
    echo $sp ? $sp : 'Não definido';
    ?>
								</b>							</td>
						</tr>
						</table>
					</div>
				</div>
				<div class="clr"></div>
		
				<?php 
    $wrongSettingsTexts = array();
    if (ini_get('magic_quotes_gpc') != '1') {
        $wrongSettingsTexts[] = 'Configuração PHP - Citações Mágicas (magic_quotes_gpc) está `Desligado` em vez de `Ligado`';
    }
    if (ini_get('register_globals') == '1') {
        $wrongSettingsTexts[] = 'Configuração PHP - Registo de Globais (register_globals) está `Ligado` em vez de `Desligado`';
    }
    if (count($wrongSettingsTexts)) {
        ?>
<h1>
						Checar Segurança:
			  </h1>
					
					<div class="install-text">
						<p>
							As seguintes configurações de segurança do servidor PHP não estão otimizadas para SEGURANÇA é recomendado que elas sejam alteradas						</p>
						<p>
							Por favor, consulte o <a href="http://forum.joomla.org/index.php/topic,81058.0.html" target="_blank">artigo oficial Joomla! sobre Segurança de Servidores</a> para mais informações.						</p>
						<div class="ctr"></div>
					</div>
							
					<div class="install-form">
						<div class="form-block" style=" border: 1px solid #cc0000; background: #ffffcc;">
							<table class="content">
							<tr>
								<td class="item">
									<ul style="margin: 0px; padding: 0px; padding-left: 5px; text-align: left; padding-bottom: 0px; list-style: none;">
										<?php 
        foreach ($wrongSettingsTexts as $txt) {
            ?>
	
											<li style="min-height: 25px; padding-bottom: 5px; padding-left: 25px; color: red; font-weight: bold; background-image: url(../includes/js/ThemeOffice/warning.png); background-repeat: no-repeat; background-position: 0px 2px;" >
												<?php 
            echo $txt;
            ?>
											</li>
											<?php 
        }
        ?>
									</ul>								</td>
							</tr>
							</table>
						</div>
					</div>
					<div class="clr"></div>
					<?php 
    }
    ?>
												
				<h1>
					Configurações recomendadas:
			  </h1>
				
				<div class="install-text">
					<p>
						Estas configurações são recomendadas para o PHP de modo a assegurar total compatibilidade com o Joomla. 
Contudo, o Joomla ainda poderá funcionar caso suas configurações não estejam totalmente de acordo com o recomendado (como é o caso do Registar Globais)					</p>
					<div class="ctr"></div>
				</div>
		
				<div class="install-form">
					<div class="form-block">
		
						<table class="content">
						<tr>
							<td class="toggle" width="500px">
								Diretiva							</td>
							<td class="toggle">
								Recomendado							</td>
							<td class="toggle">
								Atual							</td>
						</tr>
						<?php 
    $php_recommended_settings = array(array('Modo Seguro', 'safe_mode', 'DESLIGADO'), array('Exibir erros', 'display_errors', 'LIGADO'), array('Enviar arquivos', 'file_uploads', 'LIGADO'), array('Citações mágicas GPC', 'magic_quotes_gpc', 'LIGADO'), array('Citações mágicas runtime', 'magic_quotes_runtime', 'DESLIGADO'), array('Registro globais', 'register_globals', 'DESLIGADO'), array('Memória de saída', 'output_buffering', 'DESLIGADO'), array('Início aut. de sessão', 'session.auto_start', 'DESLIGADO'));
    foreach ($php_recommended_settings as $phprec) {
        ?>
							<tr>
								<td class="item">
									<?php 
        echo $phprec[0];
        ?>
:								</td>
								<td class="toggle">
									<?php 
        echo $phprec[2];
        ?>
:								</td>
								<td>
									<b>
										<?php 
        if (get_php_setting($phprec[1]) == $phprec[2]) {
            ?>
											<font color="green">
											<?php 
        } else {
            ?>
											<font color="red">
											<?php 
        }
        echo get_php_setting($phprec[1]);
        ?>
										</font>									</b>
							<td>							</tr>
							<?php 
    }
    ?>
						</table>
					</div>
				</div>
				<div class="clr"></div>
		
				<h1>
					Permissões de Arquivos e Diretórios:
				</h1>
				
				<div class="install-text">
					Para que o Joomla funcione corretamente é necessário que ele tenha permissão de acesso ou gravação a alguns arquivos e diretórios. Caso esteja visível a indicação de "Sem permissão " deverá alterar as permissões nos arquivos ou diretórios para permitir acesso de escrita ao Joomla (por FTP fazer CHOMOD 755 ou 777 aos arquivos).
					<div class="clr">&nbsp;&nbsp;</div>
					<div class="ctr"></div>
				</div>
		
				<div class="install-form">
					<div class="form-block">	
						<table class="content">
						<?php 
    writableCell('administrator/backups');
    writableCell('administrator/components');
    writableCell('administrator/modules');
    writableCell('administrator/templates');
    writableCell('cache');
    writableCell('components');
    writableCell('images');
    writableCell('images/banners');
    writableCell('images/stories');
    writableCell('language');
    writableCell('mambots');
    writableCell('mambots/content');
    writableCell('mambots/editors');
    writableCell('mambots/editors-xtd');
    writableCell('mambots/search');
    writableCell('mambots/system');
    writableCell('media');
    writableCell('modules');
    writableCell('templates');
    ?>
						</table>
					</div>
					<div class="clr"></div>
				</div>
	
				
				<div class="clr"></div>
			</div>
			<div class="clr"></div>
		</div>
	</div>
	
	<div class="ctr">
        <a href="http://www.joomla.org" target="_blank">JoomlaClube</a> Comunidade do Joomla no Brasil.<br />
		<a href="http://www.joomla.org" target="_blank">Joomla!</a> é um Software Livre liberado sob a licença GNU/GPL.
	</div>
	
	</body>
	</html>
	<?php 
}
示例#16
0
function system_info()
{
    $version = $GLOBALS['ext_version'];
    //$tab = extGetParam( $_REQUEST, 'tab', 'tab1' );
    $width = 400;
    // width of 100%
    ?>
	<br />
	<div id="sysinfo">
	<div id="system-page" class="x-tab" title="<?php 
    echo ext_Lang::msg('sisysteminfo');
    ?>
">
	
	<table class="adminform">
	<tr>
		<td valign="top" width="250" style="font-weight:bold;">
		Logged in as:
		</td>
		<td><?php 
    echo $_SESSION['s_user'];
    ?>
</td>
	<tr>
		<td valign="top" width="250" style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('sibuilton');
    ?>
:
		</td>
		<td>
		<?php 
    echo php_uname();
    ?>
		</td>
	</tr>
	<tr>
		<td valign="top" style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siphpversion');
    ?>
:
		</td>
		<td>
		<?php 
    echo phpversion();
    ?>
		&nbsp;
		<?php 
    echo phpversion() >= '4.3' ? '' : $GLOBALS['messages']['siphpupdate'];
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siwebserver');
    ?>
:
		</td>
		<td>
		<?php 
    echo get_server_software();
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siwebsphpif');
    ?>
:
		</td>
		<td>
		<?php 
    echo php_sapi_name();
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('simamboversion');
    ?>
:
		</td>
		<td>
		<?php 
    echo $version;
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siuseragent');
    ?>
:
		</td>
		<td>
		<?php 
    echo phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT'];
    ?>
		</td>
	</tr>
	<tr>
		<td valign="top" style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('sirelevantsettings');
    ?>
:
		</td>
		<td>
			<table cellspacing="1" cellpadding="1" border="0">
			<tr>
				<td valign="top">
					<?php 
    echo ext_lang::msg('sisafemode');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('safe_mode', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sibasedir');
    ?>
:
				</td>
				<td>
				<?php 
    echo ($ob = ini_get('open_basedir')) ? $ob : 'none';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sidisplayerrors');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('display_errors');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sishortopentags');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('short_open_tag');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sifileuploads');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('file_uploads');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('simagicquotes');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('magic_quotes_gpc');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('siregglobals');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('register_globals', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sioutputbuf');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('output_buffering', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sisesssavepath');
    ?>
:
				</td>
				<td>
				<?php 
    echo ($sp = ini_get('session.save_path')) ? $sp : 'none';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sisessautostart');
    ?>
:
				</td>
				<td>
				<?php 
    echo intval(ini_get('session.auto_start'));
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sixmlenabled');
    ?>
:
				</td>
				<td>
					<?php 
    echo extension_loaded('xml') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sizlibenabled');
    ?>
:
				</td>
				<td>
				<?php 
    echo extension_loaded('zlib') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sidisabledfuncs');
    ?>
:
				</td>
				<td>
				<?php 
    echo ($df = ini_get('disable_functions')) ? $df : 'none';
    ?>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
	</div>
	<div id="php-page" class="x-tab" title="<?php 
    echo ext_Lang::msg('siphpinfo');
    ?>
">
	<table class="adminform">
	<tr>
		<th colspan="2">
			<?php 
    echo ext_lang::msg('siphpinformation');
    ?>
:
		</th>
	</tr>
	<tr>
		<td>
		<?php 
    ob_start();
    phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
    $phpinfo = ob_get_contents();
    ob_end_clean();
    preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
    $output = preg_replace('#<table#', '<table class="adminlist" align="center"', $output[1][0]);
    $output = preg_replace('#(\\w),(\\w)#', '\\1, \\2', $output);
    $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output);
    $output = preg_replace('#<hr />#', '', $output);
    echo $output;
    ?>
		</td>
	</tr>
	</table>
	</div>
	</div>
	<script type="text/javascript">
<!--
var tabs = new Ext.TabPanel( "sysinfo" );
tabs.addTab( "system-page","<?php 
    echo ext_Lang::msg('sisysteminfo');
    ?>
" ); 
tabs.addTab( "php-page","<?php 
    echo ext_Lang::msg('siphpinfo');
    ?>
" ); 
tabs.activate( "system-page" );
//-->
</script>
	<?php 
}
示例#17
0
    // Simple Text strings
    $txt['none'] = 'NONE';
    $txt['on'] = 'ON';
    $txt['off'] = 'OFF';
    $txt['empty'] = 'EMPTY';
    $txt['seconds'] = 'seconds';
    $txt['na'] = 'n/a';
    $txt['recommended'] = 'Recommended Value';
}
load_txt_strings();
// Setup the information
// The keys on these entries need to match
// what is in the $txt keys/brackets above
// Makes for easy adding of extra info, or deleting
$context['smfinfo'] = array('db_last_error' => !empty($db_last_error) ? date(DATE_RFC822, $db_last_error) : $txt['none'], 'auto_fix_db' => get_smf_setting('autoFixDatabase', 'on'), 'db_persist' => get_smf_setting('db_persist', 'off'), 'db_debug' => get_smf_setting('db_show_debug', 'off'), 'enable_error' => get_smf_setting('enableErrorLogging', 'on'), 'database_sessions' => get_smf_setting('databaseSession_enable'), 'database_loose' => get_smf_setting('databaseSession_loose'), 'session_timeout' => !empty($modSettings['databaseSession_lifetime']) ? $modSettings['databaseSession_lifetime'] . ' ' . $txt['seconds'] : '<i>' . $txt['empty'] . '</i>&nbsp;<strong>(' . $txt['recommended'] . ': >300)</strong>', 'maintenance_mode' => get_smf_setting('maintenance'), 'time_load' => get_smf_setting('timeLoadPageEnable'), 'hostname_lookup' => get_smf_setting('disableHostnameLookup'), 'cache' => (!empty($modSettings['cache_enable']) ? $txt['cache_level'] . ' ' . $modSettings['cache_enable'] : $txt['off']) . ($modSettings['cache_enable'] != '1' ? '&nbsp;<strong>(' . $txt['recommended'] . ': ' . $txt['cache_level'] . ' 1)</strong>' : ''), 'memcached_settings' => isset($modSettings['cache_memcached']) && trim($modSettings['cache_memcached']) != '' ? trim($modSettings['cache_memcached']) : '<i>' . $txt['empty'] . '</i>', 'cookie_name' => !empty($cookiename) ? $cookiename : '<i>' . $txt['empty'] . '</i>&nbsp;<strong>(' . $txt['recommended'] . ': SMFCookie' . rand(100, 999) . ')</strong>', 'local_cookies' => get_smf_setting('localCookies', 'off'), 'global_cookies' => get_smf_setting('globalCookies'), 'log_pruning' => get_smf_setting('pruningOptions', 'on'), 'sef_urls' => get_smf_setting('queryless_urls'), 'compressed_output' => get_smf_setting('enableCompressedOutput'));
$context['phpinfo'] = array('safe_mode' => get_php_setting('safe_mode', 'off'), 'open_base' => ($ob = ini_get('open_basedir')) ? $ob : $txt['none'], 'display_errors' => get_php_setting('display_errors', 'off'), 'file_uploads' => get_php_setting('file_uploads', 'on'), 'magic_quotes' => get_php_setting('magic_quotes_gpc', 'off'), 'register_globals' => get_php_setting('register_globals', 'off'), 'output_buffering' => get_php_setting('output_handler'), 'session_save' => ($path = ini_get('session.save_path')) ? $path : $txt['none'], 'session_auto' => (int) ini_get('session.auto_start'), 'xml_enabled' => extension_loaded('xml') ? $txt['on'] : $txt['off'], 'zlib_enabled' => extension_loaded('zlib') ? $txt['on'] : $txt['off']);
show_header();
show_system_info();
show_php_info();
show_detailed_file();
show_detailed_db();
show_mods();
show_error_log();
show_status();
show_footer();
function show_header()
{
    global $txt, $smfInfo, $context, $smfinfo_version;
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
示例#18
0
$recommended['magic_quotes_gpc']['status'] = get_php_setting('magic_quotes_gpc', false, 'img');
// Checking magic_quotes_runtime
$recommended['magic_quotes_runtime']['label'] = $language['MAGIC_QUOTES_RUNTIME'];
$recommended['magic_quotes_runtime']['expected'] = SETTING_EXPECTED_OFF;
$recommended['magic_quotes_runtime']['actual'] = get_php_setting('magic_quotes_runtime', false, 'string');
$recommended['magic_quotes_runtime']['status'] = get_php_setting('magic_quotes_runtime', false, 'img');
// Checking short open tag
$recommended['short_open_tag']['label'] = $language['SHORT_OPEN_TAG'];
$recommended['short_open_tag']['expected'] = SETTING_EXPECTED_OFF;
$recommended['short_open_tag']['actual'] = get_php_setting('short_open_tag', false, 'string');
$recommended['short_open_tag']['status'] = get_php_setting('short_open_tag', false, 'img');
// Checking output_buffering
$recommended['output_buffering']['label'] = $language['OUTPUT_BUFFERING'];
$recommended['output_buffering']['expected'] = SETTING_EXPECTED_OFF;
$recommended['output_buffering']['actual'] = get_php_setting('output_buffering', false, 'string');
$recommended['output_buffering']['status'] = get_php_setting('output_buffering', false, 'img');
// Checking presence of XSLTProcessor
$recommended['xsltprocessor']['label'] = $language['XSLT_PROCESSOR'];
$recommended['xsltprocessor']['expected'] = SETTING_EXPECTED_ON;
$recommended['xsltprocessor']['actual'] = class_exists('XSLTProcessor', false) ? SETTING_EXPECTED_ON : SETTING_EXPECTED_OFF;
$recommended['xsltprocessor']['status'] = class_exists('XSLTProcessor', false) ? SETTING_TRUE : SETTING_FALSE;
// Checking for PHP Extension : HASH (used in Clansuite_Security)
$recommended['extension_hash']['label'] = $language['EXTENSION_HASH'];
$recommended['extension_hash']['expected'] = SETTING_EXPECTED_ON;
$recommended['extension_hash']['actual'] = extension_loaded('hash') ? SETTING_EXPECTED_ON : SETTING_EXPECTED_OFF;
$recommended['extension_hash']['status'] = extension_loaded('hash') ? SETTING_TRUE : SETTING_FALSE;
// Checking for PHP Extension : gettext (used in Clansuite_Localization)
$recommended['extension_gettext']['label'] = $language['EXTENSION_GETTEXT'];
$recommended['extension_gettext']['expected'] = SETTING_EXPECTED_ON;
$recommended['extension_gettext']['actual'] = extension_loaded('gettext') ? SETTING_EXPECTED_ON : SETTING_EXPECTED_OFF;
$recommended['extension_gettext']['status'] = extension_loaded('gettext') ? SETTING_TRUE : SETTING_FALSE;
示例#19
0
function view()
{
    $sp = ini_get('session.save_path');
    $_VERSION = new joomlaVersion();
    $versioninfo = $_VERSION->RELEASE . '.' . $_VERSION->DEV_LEVEL . ' ' . $_VERSION->DEV_STATUS;
    $version = $_VERSION->PRODUCT . ' ' . $_VERSION->RELEASE . '.' . $_VERSION->DEV_LEVEL . ' ' . $_VERSION->DEV_STATUS . ' [ ' . $_VERSION->CODENAME . ' ] ' . $_VERSION->RELDATE . ' ' . $_VERSION->RELTIME . ' ' . $_VERSION->RELTZ;
    echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?" . ">";
    ?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<title>Joomla! - Web Installer</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link rel="shortcut icon" href="../images/favicon.ico" />
	<link rel="stylesheet" href="install.css" type="text/css" />
	</head>
	<body>

	<div id="wrapper">
		<div id="header">
			<div id="joomla">
				<img src="header_install.png" alt="Joomla! Installation" />
			</div>
		</div>
	</div>

	<div id="ctr" align="center">
		<div class="install">
			<div id="stepbar">
				<div class="step-on">pre-installation check</div>
				<div class="step-off">license</div>
				<div class="step-off">step 1</div>
				<div class="step-off">step 2</div>
				<div class="step-off">step 3</div>
				<div class="step-off">step 4</div>
			</div>

			<div id="right">
				<div id="step">pre-installation check</div>

				<div class="far-right">
					<input name="Button2" type="submit" class="button" value="Next >>" onclick="window.location='install.php';" />
					<br/>
					<br/>
					<input type="button" class="button" value="Check Again" onclick="window.location=window.location" />
				</div>
				<div class="clr"></div>

				<h1 style="text-align: center; border-bottom: 0px;">
					<?php 
    echo $version;
    ?>
				</h1>

				<h1>
					Required Settings Check:
				</h1>

				<div class="install-text">
					<p>
						If any of these items are highlighted in red then please take actions to correct them.
					</p>
					<p>
						Failure to do so could lead to your Joomla! installation not functioning correctly.
					</p>
					<div class="ctr"></div>
				</div>

				<div class="install-form">
					<div class="form-block">
						<table class="content">
						<tr>
							<td class="item">
								PHP version >= 4.1.0
							</td>
							<td align="left">
								<?php 
    echo phpversion() < '4.1' ? '<b><font color="red">No</font></b>' : '<b><font color="green">Yes</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp; - zlib compression support
							</td>
							<td align="left">
								<?php 
    echo extension_loaded('zlib') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp; - XML support
							</td>
							<td align="left">
								<?php 
    echo extension_loaded('xml') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp; - MySQL support
							</td>
							<td align="left">
								<?php 
    echo function_exists('mysql_connect') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td valign="top" class="item">
								configuration.php
							</td>
							<td align="left">
								<?php 
    if (@file_exists('../configuration.php') && @is_writable('../configuration.php')) {
        echo '<b><font color="green">Writeable</font></b>';
    } else {
        if (is_writable('..')) {
            echo '<b><font color="green">Writeable</font></b>';
        } else {
            echo '<b><font color="red">Unwriteable</font></b><br /><span class="small">You can still continue the install as the configuration will be displayed at the end, just copy & paste this and upload.</span>';
        }
    }
    ?>
							</td>
						</tr>
						<tr>
							<td class="item">
								Session save path
							</td>
							<td align="left" valign="top">
								<?php 
    echo is_writable($sp) ? '<b><font color="green">Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>';
    ?>
							</td>
						</tr>
						<tr>
							<td class="item" colspan="2">
								<b>
									<?php 
    echo $sp ? $sp : 'Not set';
    ?>
								</b>
							</td>
						</tr>
						</table>
					</div>
				</div>
				<div class="clr"></div>

				<?php 
    $wrongSettingsTexts = array();
    if (ini_get('magic_quotes_gpc') != '1') {
        $wrongSettingsTexts[] = 'PHP magic_quotes_gpc setting is `OFF` instead of `ON`';
    }
    if (ini_get('register_globals') == '1') {
        $wrongSettingsTexts[] = 'PHP register_globals setting is `ON` instead of `OFF`';
    }
    if (count($wrongSettingsTexts)) {
        ?>
					<h1>
						Security Check:
					</h1>

					<div class="install-text">
						<p>
							Following PHP Server Settings are not optimal for <strong>Security</strong> and it is recommended to change them:
						</p>
						<p>
							Please check <a href="http://forum.joomla.org/index.php/topic,81058.0.html" target="_blank">the Official Joomla! Server Security post</a> for more information.
						</p>
						<div class="ctr"></div>
					</div>

					<div class="install-form">
						<div class="form-block" style=" border: 1px solid #cc0000; background: #ffffcc;">
							<table class="content">
							<tr>
								<td class="item">
									<ul style="margin: 0px; padding: 0px; padding-left: 5px; text-align: left; padding-bottom: 0px; list-style: none;">
										<?php 
        foreach ($wrongSettingsTexts as $txt) {
            ?>
											<li style="min-height: 25px; padding-bottom: 5px; padding-left: 25px; color: red; font-weight: bold; background-image: url(../includes/js/ThemeOffice/warning.png); background-repeat: no-repeat; background-position: 0px 2px;" >
												<?php 
            echo $txt;
            ?>
											</li>
											<?php 
        }
        ?>
									</ul>
								</td>
							</tr>
							</table>
						</div>
					</div>
					<div class="clr"></div>
					<?php 
    }
    ?>

				<h1>
					Recommended Settings Check:
				</h1>

				<div class="install-text">
					<p>
						These settings are recommended for PHP in order to ensure full
						compatibility with Joomla!.
					</p>
					<p>
						However, Joomla! will still operate if your settings do not quite match the recommended
					</p>
					<div class="ctr"></div>
				</div>

				<div class="install-form">
					<div class="form-block">

						<table class="content">
						<tr>
							<td class="toggle" width="500px">
								Directive
							</td>
							<td class="toggle">
								Recommended
							</td>
							<td class="toggle">
								Actual
							</td>
						</tr>
						<?php 
    $php_recommended_settings = array(array('Safe Mode', 'safe_mode', 'OFF'), array('Display Errors', 'display_errors', 'ON'), array('File Uploads', 'file_uploads', 'ON'), array('Magic Quotes GPC', 'magic_quotes_gpc', 'ON'), array('Magic Quotes Runtime', 'magic_quotes_runtime', 'OFF'), array('Register Globals', 'register_globals', 'OFF'), array('Output Buffering', 'output_buffering', 'OFF'), array('Session auto start', 'session.auto_start', 'OFF'));
    foreach ($php_recommended_settings as $phprec) {
        ?>
							<tr>
								<td class="item">
									<?php 
        echo $phprec[0];
        ?>
:
								</td>
								<td class="toggle">
									<?php 
        echo $phprec[2];
        ?>
:
								</td>
								<td>
									<b>
										<?php 
        if (get_php_setting($phprec[1]) == $phprec[2]) {
            ?>
											<font color="green">
											<?php 
        } else {
            ?>
											<font color="red">
											<?php 
        }
        echo get_php_setting($phprec[1]);
        ?>
										</font>
									</b>
								<td>
							</tr>
							<?php 
    }
    ?>
						</table>
					</div>
				</div>
				<div class="clr"></div>

				<h1>
					Directory and File Permissions Check:
				</h1>

				<div class="install-text">
					<p>
						In order for Joomla! to function correctly it needs to be able to access or write to certain files or directories.
					</p>
					<p>
						If you see "Unwriteable" you need to change the permissions on the file or directory to allow Joomla! to write to it.
					</p>
					<div class="clr">&nbsp;&nbsp;</div>
					<div class="ctr"></div>
				</div>

				<div class="install-form">
					<div class="form-block">
						<table class="content">
						<?php 
    writableCell('administrator/backups');
    writableCell('administrator/components');
    writableCell('administrator/modules');
    writableCell('administrator/templates');
    writableCell('cache');
    writableCell('components');
    writableCell('images');
    writableCell('images/banners');
    writableCell('images/stories');
    writableCell('language');
    writableCell('mambots');
    writableCell('mambots/content');
    writableCell('mambots/editors');
    writableCell('mambots/editors-xtd');
    writableCell('mambots/search');
    writableCell('mambots/system');
    writableCell('media');
    writableCell('modules');
    writableCell('templates');
    ?>
						</table>
					</div>
					<div class="clr"></div>
				</div>


				<div class="clr"></div>
			</div>
			<div class="clr"></div>
		</div>
	</div>

	<div class="ctr">
		<a href="http://www.joomla.org" target="_blank">Joomla!</a> is Free Software released under the GNU/GPL License.
	</div>

	</body>
	</html>
	<?php 
}