@@ -378,6 +305,7 @@ if ( $user and $user['Username'] ) {
if ( (!ZM_OPT_USE_AUTH) or $user ) {
if ($reload == 'reload') ob_start();
?>
+
@@ -386,10 +314,12 @@ if ( (!ZM_OPT_USE_AUTH) or $user ) {
-
-
-
-
+
@@ -403,6 +333,7 @@ if ( (!ZM_OPT_USE_AUTH) or $user ) {
return ob_get_clean();
} // end function getNavBarHTML()
+// Returns the html representing the current unix style system load
function getSysLoadHTML() {
echo '
';
@@ -411,6 +342,7 @@ function getSysLoadHTML() {
echo '
';
}
+// Returns the html representing the current number of connections made to the database
function getDbConHTML() {
$connections = dbFetchOne('SHOW status WHERE variable_name=\'threads_connected\'', 'Value');
$max_connections = dbFetchOne('SHOW variables WHERE variable_name=\'max_connections\'', 'Value');
@@ -421,6 +353,7 @@ function getDbConHTML() {
echo '
';
}
+// Returns the html representing up to 4 storage areas and their current capacity
function getStorageHTML() {
$func = function($S) {
@@ -456,6 +389,7 @@ function getStorageHTML() {
echo '';
}
+// Returns the html representing the current capacity of mapped memory filesystem (usually /dev/shm)
function getShmHTML() {
$shm_percent = getDiskPercent(ZM_PATH_MAP);
$shm_total_space = disk_total_space(ZM_PATH_MAP);
@@ -470,6 +404,7 @@ function getShmHTML() {
echo ' '.ZM_PATH_MAP.': '.$shm_percent.'%';
}
+// Returns the html representing the optional web console banner text
function getConsoleBannerHTML() {
if ( defined('ZM_WEB_CONSOLE_BANNER') and ZM_WEB_CONSOLE_BANNER != '' ) {
@@ -477,16 +412,153 @@ function getConsoleBannerHTML() {
}
}
+// Returns the html representing the current high,medium,low bandwidth setting
function getBandwidthHTML($bandwidth_options,$user) {
-
echo makePopupLink( '?view=bandwidth', 'zmBandwidth', 'bandwidth', "network_check ".$bandwidth_options[$_COOKIE['zmBandwidth']] . ' ', ($user && $user['MaxBandwidth'] != 'low' ));
}
+// Returns the html representing the version of ZoneMinder
function getZMVersionHTML($versionClass) {
-
echo makePopupLink( '?view=version', 'zmVersion', 'version', 'v'.ZM_VERSION.'', canEdit('System') );
}
+// Returns the html representing the Console menu item
+function getConsoleHTML() {
+ if ( canView('Monitors') ) {
+ echo '
';
+ }
+}
+
+// Returns the html representing the Log menu item
+function getLogHTML() {
+ if ( canView('System') ) {
+ if ( ZM\logToDatabase() > ZM\Logger::NOLOG ) {
+ if ( ! ZM_RUN_AUDIT ) {
+ # zmaudit can clean the logs, but if we aren't running it, then we should clean them regularly
+ if ( preg_match('/^\d+$/', ZM_LOG_DATABASE_LIMIT) ) {
+ # Number of lines, instead of an interval
+ $rows = dbFetchOne('SELECT Count(*) AS `Rows` FROM `Logs`', 'Rows');
+ if ( $rows > ZM_LOG_DATABASE_LIMIT ) {
+ dbQuery('DELETE low_priority FROM `Logs` ORDER BY `TimeKey` ASC LIMIT ?', array($rows - ZM_LOG_DATABASE_LIMIT));
+ }
+ } else if ( preg_match('/^\d\s*(hour|minute|day|week|month|year)$/', ZM_LOG_DATABASE_LIMIT, $matches) ) {
+ dbQuery('DELETE FROM `Logs` WHERE `TimeKey` < unix_timestamp( NOW() - interval '.ZM_LOG_DATABASE_LIMIT.') LIMIT 100');
+ } else {
+ ZM\Error('Potentially invalid value for ZM_LOG_DATABASE_LIMIT: ' . ZM_LOG_DATABASE_LIMIT);
+ }
+ }
+ echo '
';
+}
+
+// Returns the html representing the logged in user name and avatar
+function getAcctCircleHTML($user=null) {
+ if ( ZM_OPT_USE_AUTH and $user ) {
+ echo '