Add a missing file sip_profile_copy.php to the dev branch.
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
//application details
|
||||
$apps[$x]['name'] = "System";
|
||||
$apps[$x]['uuid'] = 'b7ef56fd-57c5-d4e8-bb4b-7887eede2e78';
|
||||
$apps[$x]['category'] = 'System';
|
||||
$apps[$x]['subcategory'] = '';
|
||||
$apps[$x]['version'] = '';
|
||||
$apps[$x]['license'] = 'Mozilla Public License 1.1';
|
||||
$apps[$x]['url'] = 'http://www.fusionpbx.com';
|
||||
$apps[$x]['description']['en'] = 'Displays information for CPU, HDD, RAM and more.';
|
||||
|
||||
//menu details
|
||||
$apps[$x]['menu'][0]['title']['en'] = 'System Status';
|
||||
$apps[$x]['menu'][0]['uuid'] = '5243e0d2-0e8b-277a-912e-9d8b5fcdb41d';
|
||||
$apps[$x]['menu'][0]['parent_uuid'] = '0438b504-8613-7887-c420-c837ffb20cb1';
|
||||
$apps[$x]['menu'][0]['category'] = 'internal';
|
||||
$apps[$x]['menu'][0]['path'] = '/app/system/system.php';
|
||||
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
|
||||
//permission details
|
||||
$apps[$x]['permissions'][0]['name'] = 'system_view_info';
|
||||
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][1]['name'] = 'system_view_cpu';
|
||||
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][2]['name'] = 'system_view_hdd';
|
||||
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][3]['name'] = 'system_view_ram';
|
||||
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][4]['name'] = 'system_view_backup';
|
||||
$apps[$x]['permissions'][4]['groups'][] = 'superadmin';
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_software';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'software_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'softwarename';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'software_url';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'softwareurl';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'software_version';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'softwareversion';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
// make sure the PATH_SEPARATOR is defined
|
||||
if (!defined("PATH_SEPARATOR")) {
|
||||
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
|
||||
}
|
||||
|
||||
// make sure the document_root is set
|
||||
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
|
||||
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
|
||||
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||
//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
|
||||
//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
|
||||
//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
|
||||
|
||||
// if the project directory exists then add it to the include path otherwise add the document root to the include path
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
|
||||
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
|
||||
}
|
||||
else {
|
||||
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,332 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('system_view_info')
|
||||
|| permission_exists('system_view_cpu')
|
||||
|| permission_exists('system_view_hdd')
|
||||
|| permission_exists('system_view_ram')
|
||||
|| permission_exists('system_view_backup')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "includes/header.php";
|
||||
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
|
||||
// OS Support
|
||||
//
|
||||
// For each section below wrap in an OS detection statement like:
|
||||
// if (stristr(PHP_OS, 'Linux')) {}
|
||||
//
|
||||
// Some possibilites for PHP_OS...
|
||||
//
|
||||
// CYGWIN_NT-5.1
|
||||
// Darwin
|
||||
// FreeBSD
|
||||
// HP-UX
|
||||
// IRIX64
|
||||
// Linux
|
||||
// NetBSD
|
||||
// OpenBSD
|
||||
// SunOS
|
||||
// Unix
|
||||
// WIN32
|
||||
// WINNT
|
||||
// Windows
|
||||
//
|
||||
|
||||
//system information
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th class='th' colspan='2' align='left'>System Information</th>\n";
|
||||
echo "</tr>\n";
|
||||
if (permission_exists('system_view_info')) {
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Version: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " ".software_version()."\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<!--\n";
|
||||
$tmp_result = shell_exec('uname -a');
|
||||
echo "-->\n";
|
||||
if (strlen($tmp_result) > 0) {
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Operating System: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " ".$tmp_result." \n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
unset($tmp_result);
|
||||
|
||||
echo "<!--\n";
|
||||
$tmp_result = shell_exec('uptime');
|
||||
echo "-->\n";
|
||||
if (strlen($tmp_result) > 0) {
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Uptime: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " ".$tmp_result." \n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
unset($tmp_result);
|
||||
}
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Date: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " ".date('r')." \n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<br />\n";
|
||||
|
||||
|
||||
//memory information
|
||||
if (permission_exists('system_view_ram')) {
|
||||
//linux
|
||||
if (stristr(PHP_OS, 'Linux')) {
|
||||
echo "<!--\n";
|
||||
$shellcmd='free';
|
||||
$shell_result = shell_exec($shellcmd);
|
||||
echo "-->\n";
|
||||
if (strlen($shell_result) > 0) {
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th colspan='2' align='left' valign='top'>Memory Information</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Memory Status:\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " <pre>\n";
|
||||
echo "$shell_result<br>";
|
||||
echo "</pre>\n";
|
||||
unset($shell_result);
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
//freebsd
|
||||
if (stristr(PHP_OS, 'FreeBSD')) {
|
||||
echo "<!--\n";
|
||||
$shellcmd='sysctl vm.vmtotal';
|
||||
$shell_result = shell_exec($shellcmd);
|
||||
echo "-->\n";
|
||||
if (strlen($shell_result) > 0) {
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th colspan='2' align='left' valign='top'>Memory Information</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Memory Status:\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " <pre>\n";
|
||||
echo "$shell_result<br>";
|
||||
echo "</pre>\n";
|
||||
unset($shell_result);
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//cpu information
|
||||
if (permission_exists('system_view_cpu')) {
|
||||
//linux
|
||||
if (stristr(PHP_OS, 'Linux')) {
|
||||
echo "<!--\n";
|
||||
$shellcmd="ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'";
|
||||
$shell_result = shell_exec($shellcmd);
|
||||
echo "-->\n";
|
||||
if (strlen($shell_result) > 0) {
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th class='th' colspan='2' align='left' valign='top'>CPU Information</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " CPU Status:\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " <pre>\n";
|
||||
|
||||
//$last_line = shell_exec($shellcmd, $shell_result);
|
||||
//foreach ($shell_result as $value) {
|
||||
// echo substr($value, 0, 100);
|
||||
// echo "<br />";
|
||||
//}
|
||||
|
||||
echo "$shell_result<br>";
|
||||
|
||||
echo "</pre>\n";
|
||||
unset($shell_result);
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
//freebsd
|
||||
if (stristr(PHP_OS, 'FreeBSD')) {
|
||||
echo "<!--\n";
|
||||
$shellcmd='top';
|
||||
$shell_result = shell_exec($shellcmd);
|
||||
echo "-->\n";
|
||||
if (strlen($shell_result) > 0) {
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th class='th' colspan='2' align='left' valign='top'>CPU Information</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " CPU Status:\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " <pre>\n";
|
||||
echo "$shell_result<br>";
|
||||
echo "</pre>\n";
|
||||
unset($shell_result);
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//drive space
|
||||
if (permission_exists('system_view_hdd')) {
|
||||
if (stristr(PHP_OS, 'Linux') || stristr(PHP_OS, 'FreeBSD')) {
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th class='th' colspan='2' align='left'>Drive Information</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Drive Space: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo "<pre>\n";
|
||||
$shellcmd = 'df -h';
|
||||
$shell_result = shell_exec($shellcmd);
|
||||
echo "$shell_result<br>";
|
||||
echo "</pre>\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
} else if (stristr(PHP_OS, 'WIN')) {
|
||||
//disk_free_space returns the number of bytes available on the drive;
|
||||
//1 kilobyte = 1024 byte
|
||||
//1 megabyte = 1024 kilobyte
|
||||
$driveletter = substr($_SERVER["DOCUMENT_ROOT"], 0, 2);
|
||||
$disksize = round(disk_total_space($driveletter)/1024/1024, 2);
|
||||
$disksizefree = round(disk_free_space($driveletter)/1024/1024, 2);
|
||||
$diskpercentavailable = round(($disksizefree/$disksize) * 100, 2);
|
||||
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th class='th' colspan='2' align='left'>Drive Space</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Capacity: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " $disksize mb\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Free Space: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " $disksizefree mb\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " Percent Free: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " $diskpercentavailable% \n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "\n";
|
||||
}
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
}
|
||||
|
||||
//backup
|
||||
if (permission_exists('zzz') && $db_type == 'sqlite') {
|
||||
require_once "core/backup/backupandrestore.php";
|
||||
}
|
||||
|
||||
//include the footer
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
Reference in New Issue
Block a user