Navigation Menu

Skip to content

Commit

Permalink
restrict access if not emoncms_exec
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Jul 27, 2021
1 parent f9f06f1 commit 58af4fd
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 147 deletions.
1 change: 1 addition & 0 deletions Views/dashboard_config.php
Expand Up @@ -9,6 +9,7 @@
http://openenergymonitor.org
*/
global $path;
defined('EMONCMS_EXEC') or die('Restricted access');
?>

<div id="dashConfigModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="dashConfigModalLabel" aria-hidden="true" data-backdrop="static">
Expand Down
3 changes: 2 additions & 1 deletion Views/dashboard_edit_view.php
Expand Up @@ -9,6 +9,7 @@
http://openenergymonitor.org
*/

defined('EMONCMS_EXEC') or die('Restricted access');
global $session,$path;

load_language_files("Modules/vis/locale", "vis_messages");
Expand Down Expand Up @@ -178,4 +179,4 @@ function showSuccess() {
$(window).resize(function(){
designer.draw();
});
</script>
</script>
125 changes: 0 additions & 125 deletions Views/dashboard_list.old.php

This file was deleted.

4 changes: 4 additions & 0 deletions Views/dashboard_list.php
@@ -1,3 +1,7 @@
<?php
defined('EMONCMS_EXEC') or die('Restricted access');
?>

<style>
#app {
max-width: 990px;
Expand Down
19 changes: 0 additions & 19 deletions Views/dashboard_menu.php
Expand Up @@ -8,22 +8,3 @@
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org
*/

global $path;

$result = "";

/*
if ($type=="view" && isset($id)) {
$result .= "<a class='btn btn-mini' href='" . $path . "dashboard/edit?id=" . $id . "'><span class='icon-edit' title='" . _("Draw Editor") . "'></span></a>";
}
*/

//CHAVEIRO: Removed, dashboard list is accessible via setup menu now
//if ($type!="list") {
// $result .= "<a class='btn btn-mini' href='" . $path . "dashboard/list'><span class='icon-th-list' title='" . _('List view') ."'></span></a>";
//}

if ($result) {
echo "<div class='btn-toolbar' style='padding:2px; margin: 0;' align='right'><div class='btn-group'>".$result."</div></div>";
}
1 change: 1 addition & 0 deletions Views/dashboard_view.php
Expand Up @@ -8,6 +8,7 @@
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org
*/
defined('EMONCMS_EXEC') or die('Restricted access');

global $session,$path,$dashboard_editor_icon,$embed;

Expand Down
2 changes: 2 additions & 0 deletions Views/loadwidgets.php
Expand Up @@ -10,6 +10,8 @@
http://openenergymonitor.org
*/

defined('EMONCMS_EXEC') or die('Restricted access');

define("MODULE_PATH","Modules");
echo "<script type='application/javascript'>var requestTime = Date.now() /1000;var offsetofTime = 0;offsetofTime = Math.round(requestTime - ".time()."); // Offset in s from local to server time</script>";
Expand Down
1 change: 0 additions & 1 deletion dashboard

This file was deleted.

2 changes: 1 addition & 1 deletion module.json
@@ -1,6 +1,6 @@
{
"name" : "Dashboard",
"version" : "2.1.3",
"version" : "2.1.4",
"location" : "/var/www/emoncms/Modules",
"branches_available": ["stable","master"]
}

0 comments on commit 58af4fd

Please sign in to comment.