2006-12-02 04:36:16 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2009-11-12 14:30:07 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2009-11-18 01:06:08 +00:00
|
|
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
2009-11-12 14:30:07 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-01-16 13:32:35 -08:00
|
|
|
require_once(__DIR__.'/../class2.php');
|
2017-01-17 01:33:03 +01:00
|
|
|
|
|
|
|
if(!getperms("0"))
|
2016-01-13 19:17:37 -08:00
|
|
|
{
|
|
|
|
e107::redirect('admin');
|
2013-02-28 14:27:01 -08:00
|
|
|
exit;
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
2017-02-20 15:01:09 +01:00
|
|
|
|
|
|
|
e107::coreLan('phpinfo', true);
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
$e_sub_cat = 'phpinfo';
|
|
|
|
require_once("auth.php");
|
2013-02-28 14:27:01 -08:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
ob_start();
|
|
|
|
phpinfo();
|
2016-02-16 15:14:56 -08:00
|
|
|
$phpinfo = ob_get_contents();
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
$phpinfo = preg_replace("#^.*<body>#is", "", $phpinfo);
|
2013-02-28 14:27:01 -08:00
|
|
|
$phpinfo = str_replace("font","span",$phpinfo);
|
|
|
|
$phpinfo = str_replace("</body></html>","",$phpinfo);
|
|
|
|
$phpinfo = str_replace('border="0"','',$phpinfo);
|
2015-07-16 14:02:32 -07:00
|
|
|
//$phpinfo = str_replace('<table ','<table class="table table-striped adminlist" ',$phpinfo);
|
2013-02-28 14:27:01 -08:00
|
|
|
$phpinfo = str_replace('name=','id=',$phpinfo);
|
2015-07-16 14:02:32 -07:00
|
|
|
$phpinfo = str_replace('class="e"','class="forumheader2 text-left"',$phpinfo);
|
|
|
|
$phpinfo = str_replace('class="v"','class="forumheader3 text-left"',$phpinfo);
|
|
|
|
$phpinfo = str_replace('class="v"','class="forumheader3 text-left"',$phpinfo);
|
2013-02-28 14:27:01 -08:00
|
|
|
$phpinfo = str_replace('class="h"','class="fcaption"',$phpinfo);
|
2016-02-16 15:14:56 -08:00
|
|
|
$phpinfo = preg_replace('/<table[^>]*>/i', '<table class="table table-striped adminlist"><colgroup><col style="width:30%" /><col style="width:auto" /></colgroup>', $phpinfo);
|
|
|
|
|
2013-02-28 14:27:01 -08:00
|
|
|
|
|
|
|
$mes = e107::getMessage();
|
|
|
|
|
2020-06-24 14:35:49 -07:00
|
|
|
$extensionCheck = array(
|
2021-12-01 11:59:49 -08:00
|
|
|
'curl' => array('label'=> 'Curl Library', 'status' => function_exists('curl_version'), 'url'=> 'http://php.net/manual/en/book.curl.php'),
|
|
|
|
'exif' => array('label'=> "EXIF Extension", 'status' => function_exists('exif_imagetype'), 'url'=> 'http://php.net/manual/en/book.exif.php'),
|
|
|
|
'fileinfo' => array('label'=> "FileInfo. Extension", 'status' => extension_loaded('fileinfo'), 'url'=> 'https://www.php.net/manual/en/book.fileinfo'),
|
|
|
|
'gd' => array('label'=> 'GD Library', 'status' => function_exists('gd_info'), 'url'=> 'http://php.net/manual/en/book.image.php'),
|
|
|
|
'mb' => array('label'=> 'MB String Library', 'status' => extension_loaded('mbstring'), 'url'=> 'http://php.net/manual/en/book.mbstring.php'),
|
|
|
|
'pdo' => array('label'=> "PDO (MySQL)", 'status' => extension_loaded('pdo_mysql'), 'url'=> 'https://php.net/manual/en/book.pdo.php'),
|
|
|
|
'xml' => array('label'=> "XML Extension", 'status' => function_exists('utf8_encode') && class_exists('DOMDocument', false), 'url'=> 'http://php.net/manual/en/ref.xml.php'),
|
2020-06-24 14:35:49 -07:00
|
|
|
);
|
|
|
|
|
2021-12-01 11:59:49 -08:00
|
|
|
$languages = e107::getLanguage()->installed('abbr');
|
2021-02-12 14:32:20 -08:00
|
|
|
|
2021-12-01 11:59:49 -08:00
|
|
|
if(isset($languages['en']))
|
|
|
|
{
|
|
|
|
unset($languages['en']);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!empty($languages)) // non-english languages present.
|
|
|
|
{
|
|
|
|
$extensionCheck['intl'] = array('label'=> 'Internationalization Functions', 'status' => extension_loaded('intl'), 'url'=> 'https://www.php.net/manual/en/book.intl.php');
|
|
|
|
}
|
2021-02-12 14:32:20 -08:00
|
|
|
|
|
|
|
|
2020-06-24 14:35:49 -07:00
|
|
|
foreach($extensionCheck as $var)
|
|
|
|
{
|
|
|
|
if($var['status'] !== true)
|
|
|
|
{
|
|
|
|
$erTitle = deftrue('PHP_LAN_7', "PHP Configuration Issue(s) Found:");
|
2021-02-12 14:32:20 -08:00
|
|
|
$def = deftrue('PHP_LAN_8', "[x] is missing from the PHP configuration and needs to be installed.");
|
2020-12-08 07:29:17 -08:00
|
|
|
$message = e107::getParser()->lanVars($def,$var['label'],true);
|
2020-06-24 14:35:49 -07:00
|
|
|
|
|
|
|
$mes->setIcon('fa-hand-stop-o', E_MESSAGE_ERROR)->setTitle($erTitle,E_MESSAGE_ERROR)->addError($message." <a class='alert-link' href='".$var['url']."' target='_blank' title=\"".$var['url']."\">".ADMIN_INFO_ICON."</a> ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-28 14:27:01 -08:00
|
|
|
$security_risks = array(
|
2017-02-20 15:01:09 +01:00
|
|
|
"allow_url_fopen" => PHP_LAN_1,
|
|
|
|
"allow_url_include" => PHP_LAN_2,
|
|
|
|
"display_errors" => PHP_LAN_3,
|
|
|
|
"expose_php" => PHP_LAN_4,
|
|
|
|
"register_globals" => PHP_LAN_5
|
2013-02-28 14:27:01 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
foreach($security_risks as $risk=>$diz)
|
|
|
|
{
|
|
|
|
if(ini_get($risk))
|
|
|
|
{
|
2015-07-16 14:02:32 -07:00
|
|
|
$srch = '<tr><td class="forumheader2 text-left">'.$risk.'</td><td class="forumheader3">';
|
2020-12-08 07:29:17 -08:00
|
|
|
$repl = '<tr><td class="forumheader2 text-left">'.$risk.'</td><td title="'.e107::getParser()->toAttribute($diz).'" class="forumheader3 alert alert-danger">';
|
2013-02-28 14:27:01 -08:00
|
|
|
$phpinfo = str_replace($srch,$repl,$phpinfo);
|
|
|
|
$mes->addWarning("<b>".$risk."</b>: ".$diz);
|
|
|
|
}
|
|
|
|
}
|
2017-01-12 12:06:25 -08:00
|
|
|
|
|
|
|
$sessionSaveMethod = ini_get('session.save_handler');
|
|
|
|
|
2013-06-01 02:53:06 -07:00
|
|
|
if($sessionSavePath = ini_get('session.save_path'))
|
|
|
|
{
|
2017-01-12 12:06:25 -08:00
|
|
|
if(!is_writable($sessionSavePath) && $sessionSaveMethod === 'files')
|
2013-06-01 02:53:06 -07:00
|
|
|
{
|
2017-02-22 09:43:10 +01:00
|
|
|
$mes->addError(e107::getParser()->toHTML(PHP_LAN_6, true));
|
2013-06-01 02:53:06 -07:00
|
|
|
}
|
|
|
|
}
|
2013-02-28 14:27:01 -08:00
|
|
|
|
|
|
|
|
|
|
|
// $phpinfo = preg_replace("#^.*<body>#is", "", $phpinfo);
|
2006-12-02 04:36:16 +00:00
|
|
|
ob_end_clean();
|
2015-11-30 14:30:37 -08:00
|
|
|
|
|
|
|
|
2020-06-24 14:35:49 -07:00
|
|
|
|
2015-11-30 14:30:37 -08:00
|
|
|
if(deftrue('e_DEBUG'))
|
|
|
|
{
|
|
|
|
$mes->addDebug("Session ID: ".session_id());
|
|
|
|
}
|
|
|
|
|
2020-12-08 07:29:17 -08:00
|
|
|
e107::getRender()->tablerender("PHPInfo", $mes->render(). $phpinfo);
|
2006-12-02 04:36:16 +00:00
|
|
|
require_once("footer.php");
|
2020-06-24 14:35:49 -07:00
|
|
|
|