<?php /** * LoadAvg - Server Monitoring & Analytics * http://www.loadavg.com * * logout module interface * * @link https://github.com/loadavg/loadavg * @author Karsten Becker * @copyright 2014 Sputnik7 * * This file is licensed under the Affero General Public License version 3 or * later. */ ?> <?php LoadAvg::logOut(); header('Location: index.php');
* @link https://github.com/loadavg/loadavg * @author Karsten Becker * @copyright 2014 Sputnik7 * * This file is licensed under the Affero General Public License version 3 or * later. */ ?> <?php /* * Security wrapper for private pages * */ if (!$loadavg->isLoggedIn() && !LoadAvg::checkInstall()) { include 'login.php'; } else { ?> <?php //run this code if the settings have been changed or updated if (isset($_POST['update_settings'])) { //get current settings $settings = LoadAvg::$_settings->general; //need to check all modules status first //as form drops unchecked values when posted for some reason $modules = LoadPlugins::$_plugins; foreach ($plugins as $plugin => $pluginName) { $_POST['formsettings']['plugins'][$plugin] = !isset($_POST['formsettings']['plugins'][$plugin]) ? "false" : "true"; }
require_once '../globals.php'; /* Session */ ob_start(); session_start(); if (DEBUG) { $memory_usage['start'] = memory_get_usage(); } /* Initialize LoadAvg Utility Class */ include_once 'class.Utility.php'; if (DEBUG) { $memory_usage['utility'] = memory_get_usage(); } /* Initialize LoadAvg Utility Class */ /* Initialize LoadAvg */ include_once 'class.LoadAvg.php'; $loadavg = new LoadAvg(); if (DEBUG) { $memory_usage['loadavg'] = memory_get_usage(); } //http://mobiledetect.net/ require_once 'Mobile_Detect.php'; $detect = new Mobile_Detect(); if ($detect->isMobile()) { LoadAvg::$isMobile = true; } /* Initialize LoadAvg Charts module */ include_once 'class.Modules.php'; $loadModules = new LoadModules(); if (DEBUG) { $memory_usage['modules'] = memory_get_usage(); }
</div> </div> <?php } ?> </div> <?php if (isset($_GET['test']) && !empty($_GET['test'])) { ?> <div class="separator bottom"></div> <div class="well"> <?php $status = LoadAvg::testApiConnection(true); if ($status) { ?> <div class="row-fluid"> <div class="center"> <br> <strong>Account Status:</strong> Active </div> </div> <?php } else { ?> <div class="row-fluid"> <div class="center"> <br> <strong>Account Status:</strong> Inactive
* @link https://github.com/loadavg/loadavg * @author Karsten Becker * @copyright 2014 Sputnik7 * * This file is licensed under the Affero General Public License version 3 or * later. */ require_once '../globals.php'; // including required globals /* Session */ ob_start(); /* Initialize LoadAvg Utility Class */ include 'class.Utility.php'; /* Initialize LoadAvg */ include 'class.LoadAvg.php'; $loadavg = new LoadAvg(); /* Initialize LoadAvg Charts module */ include 'class.Modules.php'; $loadModules = new LoadModules(); /* Initialize LoadAvg plugins */ include_once 'class.Plugins.php'; $loadPlugins = new loadPlugins(); // Grab Default settings $settings = LoadAvg::$_settings->general; $flooding = false; //first lets see if a name has been set... $pageName = "installer"; // Including header view require_once APP_PATH . '/layout/header.php'; //check for settings $settings_file = APP_PATH . '/config/settings.ini.php';
public function getDateRange() { /* * Grab the current period if a period has been selected * TODO: if min date and no max date then set max date to todays date * max date alone does nothing... */ $minDate = $maxDate = false; if (isset($_GET['minDate']) && !empty($_GET['minDate'])) { $minDate = true; } if (isset($_GET['maxDate']) && !empty($_GET['maxDate'])) { $maxDate = true; } //for some reason when max date is todays date we cant plot the range ? if ($minDate) { LoadAvg::$period = true; LoadAvg::$period_minDate = date("Y-m-d", strtotime($_GET['minDate'])); if ($maxDate) { LoadAvg::$period_maxDate = date("Y-m-d", strtotime($_GET['maxDate'])); } else { LoadAvg::$period = false; } //else // LoadAvg::$period_maxDate = self::$current_date; } //echo "minDate" . LoadAvg::$period_minDate . "<br>"; //echo "maxDate" . LoadAvg::$period_maxDate . "<br>"; $currentDate = self::$current_date; //dates of all the log files in logs folder $dates = self::getDates(); $dateArray = array(); //$period is set when we are pulling a range of data if (LoadAvg::$period) { //here we check that we have log files inside the range $loop = 0; foreach ($dates as $date) { if ($date >= self::$period_minDate && $date <= self::$period_maxDate) { $dateArray[$loop] = $date; $loop++; } } } else { $dateArray[0] = $currentDate; } return $dateArray; }
echo isset($_GET['minDate']) && !empty($_GET['minDate']) ? $_GET['minDate'] : ''; ?> " placeholder="Period from" style="width: 70px;height: 18px;"> - <input type="text" id="maxDate" name="maxDate" value="<?php echo isset($_GET['minDate']) && !empty($_GET['maxDate']) ? $_GET['maxDate'] : ''; ?> " placeholder="Period to" style="width: 70px;height: 18px;"> <?php } ?> <b class="innerL">Log file:</b> <select name="logdate" id="logdate" style="width: 110px;height: 28px;"> <?php $dates = LoadAvg::getDates(); $date_counter = 1; $totalDates = (int) count($dates); foreach ($dates as $date) { if ($date_counter != $totalDates) { ?> <option<?php echo isset($_GET['logdate']) && !empty($_GET['logdate']) && $_GET['logdate'] == $date || !isset($_GET['logdate']) && $date == date('Y-m-d') ? ' selected="selected"' : ''; ?> value="<?php echo $date; ?> "><?php echo $date; ?> </option><?php