fixes #532, "environment" infos moved to "maintenance" page

This commit is contained in:
plegall
2016-10-06 12:23:19 +02:00
parent 4e24768989
commit 0a753a9162
3 changed files with 67 additions and 0 deletions
+50
View File
@@ -27,6 +27,7 @@ if (!defined('PHPWG_ROOT_PATH'))
}
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php');
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
@@ -47,6 +48,11 @@ $action = isset($_GET['action']) ? $_GET['action'] : '';
switch ($action)
{
case 'phpinfo' :
{
phpinfo();
exit();
}
case 'lock_gallery' :
{
conf_update_param('gallery_locked', 'true');
@@ -200,6 +206,7 @@ DELETE
}
}
// +-----------------------------------------------------------------------+
// | template init |
// +-----------------------------------------------------------------------+
@@ -215,6 +222,10 @@ foreach(ImageStdParams::get_defined_type_map() as $params)
}
$purge_urls[ l10n(IMG_CUSTOM) ] = sprintf($url_format, 'derivatives').'&type='.IMG_CUSTOM;
$php_current_timestamp = date("Y-m-d H:i:s");
$db_version = pwg_get_db_version();
list($db_current_date) = pwg_db_fetch_row(pwg_query('SELECT now();'));
$template->assign(
array(
'U_MAINT_CATEGORIES' => sprintf($url_format, 'categories'),
@@ -232,9 +243,48 @@ $template->assign(
'U_MAINT_DERIVATIVES' => sprintf($url_format, 'derivatives'),
'purge_derivatives' => $purge_urls,
'U_HELP' => get_root_url().'admin/popuphelp.php?page=maintenance',
'PHPWG_URL' => PHPWG_URL,
'PWG_VERSION' => PHPWG_VERSION,
'OS' => PHP_OS,
'PHP_VERSION' => phpversion(),
'DB_ENGINE' => 'MySQL',
'DB_VERSION' => $db_version,
'U_PHPINFO' => sprintf($url_format, 'phpinfo'),
'PHP_DATATIME' => $php_current_timestamp,
'DB_DATATIME' => $db_current_date,
)
);
// graphics library
switch (pwg_image::get_library())
{
case 'imagick':
$library = 'ImageMagick';
$img = new Imagick();
$version = $img->getVersion();
if (preg_match('/ImageMagick \d+\.\d+\.\d+-?\d*/', $version['versionString'], $match))
{
$library = $match[0];
}
$template->assign('GRAPHICS_LIBRARY', $library);
break;
case 'ext_imagick':
$library = 'External ImageMagick';
exec($conf['ext_imagick_dir'].'convert -version', $returnarray);
if (preg_match('/Version: ImageMagick (\d+\.\d+\.\d+-?\d*)/', $returnarray[0], $match))
{
$library .= ' ' . $match[1];
}
$template->assign('GRAPHICS_LIBRARY', $library);
break;
case 'gd':
$gd_info = gd_info();
$template->assign('GRAPHICS_LIBRARY', 'GD '.@$gd_info['GD Version']);
break;
}
if ($conf['gallery_locked'])
{
@@ -39,3 +39,15 @@
{foreach from=$purge_derivatives key=name item=url name=loop}{if !$smarty.foreach.loop.first}, {/if}<a href="{$url}"{if $smarty.foreach.loop.first} onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"{/if}>{$name}</a>{/foreach}
</li>
</ul>
<fieldset id="environment">
<legend><i class="icon-cog"></i> {'Environment'|@translate}</legend>
<ul>
<li>{'Operating system'|@translate}: {$OS}</li>
<li>PHP: {$PHP_VERSION} (<a href="{$U_PHPINFO}" class="externalLink">{'Show info'|@translate}</a>) [{$PHP_DATATIME}]</li>
<li>{$DB_ENGINE}: {$DB_VERSION} [{$DB_DATATIME}]</li>
{if isset($GRAPHICS_LIBRARY)}
<li>{'Graphics Library'|@translate}: {$GRAPHICS_LIBRARY}</li>
{/if}
</ul>
</fieldset>
+5
View File
@@ -1324,3 +1324,8 @@ table.qsearch_help_table td {
.font-checkbox input[type=checkbox], .font-checkbox input[type=radio] {
display:none;
}
/* icons */
fieldset#environment legend i[class*="icon-"] {
font-size:14px;
}