Portions created by the Initial Developer are Copyright (C) 2021 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //include the root directory include "root.php"; //if config.php file does not exist then redirect to the install page if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) { //do nothing } elseif (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) { //original directory } elseif (file_exists("/etc/fusionpbx/config.php")){ //linux } elseif (file_exists("/usr/local/etc/fusionpbx/config.php")){ //bsd } else { header("Location: ".PROJECT_PATH."/core/install/install.php"); exit; } //additional includes require_once "resources/check_auth.php"; //disable login message if (isset($_GET['msg']) && $_GET['msg'] == 'dismiss') { unset($_SESSION['login']['message']['text']); $sql = "update v_default_settings "; $sql .= "set default_setting_enabled = 'false' "; $sql .= "where "; $sql .= "default_setting_category = 'login' "; $sql .= "and default_setting_subcategory = 'message' "; $sql .= "and default_setting_name = 'text' "; $database = new database; $database->execute($sql); unset($sql); } //build a list of groups the user is a member of to be used in a SQL in foreach($_SESSION['user']['groups'] as $group) { $group_uuids[] = $group['group_uuid']; } $group_uuids_in = "'".implode("','", $group_uuids)."'"; //get the list $sql = "select \n"; $sql .= "dashboard_uuid, \n"; $sql .= "dashboard_name, \n"; $sql .= "dashboard_path, \n"; $sql .= "dashboard_order, \n"; $sql .= "cast(dashboard_enabled as text), \n"; $sql .= "dashboard_description \n"; $sql .= "from v_dashboard as d \n"; $sql .= "where dashboard_enabled = 'true' \n"; $sql .= "and dashboard_uuid in (\n"; $sql .= " select dashboard_uuid from v_dashboard_groups where group_uuid in (\n"; $sql .= " ".$group_uuids_in." \n"; $sql .= " )\n"; $sql .= ")\n"; $sql .= "order by dashboard_order asc \n"; $database = new database; $dashboard = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); //add multi-lingual support $language = new text; $text = $language->get(); //load the header $document['title'] = $text['title-dashboard']; require_once "resources/header.php"; //include chart.js echo ""; //chart variables ?> \n"; echo " \n"; echo " "; echo " ".$text['title-dashboard']."
"; echo " \n"; echo " \n"; if ($_SESSION['theme']['menu_style']['text'] != 'side') { echo " ".$text['label-welcome']." ".$_SESSION["username"].""; } echo " \n"; echo " \n"; echo " \n"; echo " "; echo " ".$text['description-dashboard']; echo " \n"; echo " \n"; echo "\n"; echo "
"; */ //show the content echo "
\n"; echo "
".$text['title-dashboard']."
\n"; echo "
\n"; if ($_SESSION['theme']['menu_style']['text'] != 'side') { echo " ".$text['label-welcome']." ".$_SESSION["username"]."   "; } if (permission_exists('dashboard_edit')) { echo button::create(['type'=>'button','label'=>$text['button-settings'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','name'=>'btn_add','link'=>'dashboard.php']); } echo "
\n"; echo "
".$text['description-dashboard']."
\n"; echo "
\n"; //display login message //if (if_group("superadmin") && isset($_SESSION['login']['message']['text']) && $_SESSION['login']['message']['text'] != '') { // echo "
".$text['login-message_attention']."  ".$_SESSION['login']['message']['text']."  (".$text['login-message_dismiss'].")
"; //} //include the dashboards echo "
\n"; $n = 0; foreach($dashboard as $row) { echo "
\n"; echo "
\n"; echo "
\n"; include($row['dashboard_path']); echo "
\n"; echo "
\n"; echo "
\n"; $n++; } echo "
\n"; //show the footer require_once "resources/footer.php"; ?>