From f47c427d465f15fb869dc03b4664cdd3980faecd Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 30 Oct 2013 01:28:08 +0000 Subject: [PATCH] Add concept of system information page Add information about current software versions, server software, php extensions loaded, and database space usage. In the future, this will offer a nice place to add an import/export button for data backup and restore, announcements, and more --- include/class.nav.php | 1 + include/staff/system.inc.php | 66 ++++++++++++++++++++++++++++++++++++ scp/css/scp.css | 5 +++ scp/system.php | 25 ++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 include/staff/system.inc.php create mode 100644 scp/system.php diff --git a/include/class.nav.php b/include/class.nav.php index 89f47ed75..9dc4a79f2 100644 --- a/include/class.nav.php +++ b/include/class.nav.php @@ -191,6 +191,7 @@ class AdminNav extends StaffNav{ switch(strtolower($k)){ case 'dashboard': $subnav[]=array('desc'=>'System Logs','href'=>'logs.php','iconclass'=>'logs'); + $subnav[]=array('desc'=>'Information','href'=>'system.php','iconclass'=>'preferences'); break; case 'settings': $subnav[]=array('desc'=>'System Preferences','href'=>'settings.php?t=system','iconclass'=>'preferences'); diff --git a/include/staff/system.inc.php b/include/staff/system.inc.php new file mode 100644 index 000000000..9c45c3dab --- /dev/null +++ b/include/staff/system.inc.php @@ -0,0 +1,66 @@ +<?php +if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied'); + +?> +<h2>About this osTicket Installation</h2> +<br/> +<table class="list" width="100%";> +<thead> + <tr><th colspan="2">Server Information</th></tr> +</thead> +<tbody> + <tr><td>osTicket Version</td> + <td><?php echo THIS_VERSION; ?></td></tr> + <tr><td>Server Software</td> + <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td></tr> + <tr><td>PHP Version</td> + <td><?php echo phpversion(); ?></td></tr> + <tr><td>MySQL Version</td> + <td><?php echo db_version(); ?></td></tr> + + <tr><td>PHP Extensions</td> + <td><table><tbody> + <tr><td><i class="icon icon-<?php + echo extension_loaded('gd')?'check':'warning-sign'; ?>"></i></td> + <td>gdlib</td> + <td>Used for image manipulation and PDF printing</td></tr> + <tr><td><i class="icon icon-<?php + echo extension_loaded('imap')?'check':'warning-sign'; ?>"></i></td> + <td>imap</td> + <td>Used for email fetching</td></tr> + <tr><td><i class="icon icon-<?php + echo extension_loaded('xml')?'check':'warning-sign'; ?>"></i></td> + <td>xml</td> + <td>Used for HTML email processing and XML API</td></tr> + <tr><td><i class="icon icon-<?php + echo extension_loaded('json')?'check':'warning-sign'; ?>"></i></td> + <td>json</td> + <td>Improves performance creating and processing JSON</td></tr> + <tr><td><i class="icon icon-<?php + echo extension_loaded('gettext')?'check':'warning-sign'; ?>"></i></td> + <td>gettext</td> + <td>Improves performance for non US-English configurations</td></tr> + <tr><td><i class="icon icon-<?php + echo extension_loaded('mbstring')?'check':'warning-sign'; ?>"></i></td> + <td>mbstring</td> + <td>Highly recommended for non western european language content</td></tr> + </tbody></table></td></tr> +</tbody> +<thead> + <tr><th colspan="2">Database Usage</th></tr> +</thead> +<tbody> + <tr><td>Database Space Used</td> + <td><?php + $sql = 'SELECT sum( data_length + index_length ) / 1048576 total_size + FROM information_schema.TABLES WHERE table_schema = ' + .db_input(DBNAME); + $space = db_result(db_query($sql)); + echo sprintf('%.2f MiB', $space); ?></td> + <tr><td>Database Space for Attachments</td> + <td><?php + $sql = 'SELECT SUM(LENGTH(filedata)) / 1048576 FROM '.FILE_CHUNK_TABLE; + $space = db_result(db_query($sql)); + echo sprintf('%.2f MiB', $space); ?></td> +</tbody> +</table> diff --git a/scp/css/scp.css b/scp/css/scp.css index 5ace67940..62ecb2750 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1485,6 +1485,11 @@ input[type=text]:disabled, input[type=checkbox]:disabled { background-color: #eee; } + input.dp { width: 10em; } + +.icon-warning-sign { + color: #d33; +} diff --git a/scp/system.php b/scp/system.php new file mode 100644 index 000000000..5106fda52 --- /dev/null +++ b/scp/system.php @@ -0,0 +1,25 @@ +<?php +/********************************************************************* + system.php + + System information about this http server, database, php, and osticket. + Includes useful configuration informations. + + Peter Rotich <peter@osticket.com> + Jared Hancock <jared@osticket.com> + Copyright (c) 2006-2013 osTicket + http://www.osticket.com + + Released under the GNU General Public License WITHOUT ANY WARRANTY. + See LICENSE.TXT for details. + + vim: expandtab sw=4 ts=4 sts=4: +**********************************************************************/ +require('admin.inc.php'); + +$page='system.inc.php'; +$nav->setTabActive('dashboard'); +require(STAFFINC_DIR.'header.inc.php'); +require(STAFFINC_DIR.$page); +include(STAFFINC_DIR.'footer.inc.php'); +?> -- GitLab