Skip to content

Commit

Permalink
v15 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bhdresh authored and bhdresh committed Jan 26, 2023
1 parent bdd93d1 commit cd68aff
Show file tree
Hide file tree
Showing 52 changed files with 612 additions and 1,568 deletions.
83 changes: 0 additions & 83 deletions Console/Decoify/addEdit.php

This file was deleted.

30 changes: 16 additions & 14 deletions Console/Decoify/backupSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

if(!isset($_SESSION))
{
session_start();
session_start();
}
require_once('includes/common.php');

include "db.php";
if(!isset($_SESSION['user_name']) && !isAdmin($_SESSION))
if(!isset($_SESSION['user_name']) && $_SESSION['role'] != 'admin')
{
header('location:loginView.php');
exit();
header('location:loginView.php');
exit();

}


if(isset($_SESSION['user_name']) && isAdmin($_SESSION)) {
if(isset($_SESSION['user_name']) && $_SESSION['role'] == 'admin') {

?>

Expand Down Expand Up @@ -86,10 +85,11 @@
</div>
<!-- /.box-body -->


<div class="box box-primary">


<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Upgrade DejaVu Console</h3>
<h3 class="box-title">Upgrade DejaVu</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
Expand All @@ -108,7 +108,7 @@

echo "<form role=\"form\" action=\"updateFramework.php\" method=\"post\" enctype=\"multipart/form-data\">";
echo "<input type=\"hidden\" name=\"csrf_token\" value=\"$csrf_token\"/>";
echo "<button type=\"submit\" class=\"btn btn-primary\">Upgrade DejaVu Console</button>";
echo "<button type=\"submit\" class=\"btn btn-primary\">Upgrade DejaVu Engine</button>";
echo "</form>";

}
Expand All @@ -124,9 +124,11 @@











<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Reboot/Shutdown/Reset DejaVu Console</h3>
Expand Down Expand Up @@ -179,6 +181,6 @@
}
else
{
header('location:loginView.php');
header('location:loginView.php');
}
?>
3 changes: 1 addition & 2 deletions Console/Decoify/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
{
session_start();
}
require_once('includes/common.php');

include 'db.php';

if(isset($_SESSION['user_name']) && isAuthorized($_SESSION)) {
if(isset($_SESSION['user_name']) && $_SESSION['role'] == 'admin') {

$user_id=$_SESSION['user_id'];

Expand Down
192 changes: 0 additions & 192 deletions Console/Decoify/db.class.php

This file was deleted.

7 changes: 3 additions & 4 deletions Console/Decoify/db.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

//Connection to database
require_once('includes/common.php');

function db_connect() {

Expand Down Expand Up @@ -43,7 +42,7 @@ function check_session(){
}


if(isset($_SESSION['user_name']) && isAuthorized($_SESSION))
if(isset($_SESSION['user_name']) && $_SESSION['role'] == 'admin')
{
$logged_in = 'true';
return $logged_in;
Expand Down Expand Up @@ -105,8 +104,8 @@ function activeAlerts()

$mysqli = db_connect();
$user_id=$_SESSION['user_id'];
$stmt = $mysqli->prepare("select COUNT(Status) as active_events from Alerts where Status=1;");
//$stmt->bind_param("s", $user_id);
$stmt = $mysqli->prepare("select COUNT(Status) as active_events from Alerts where Status=1 and user_id=?;");
$stmt->bind_param("s", $user_id);
$stmt->execute();
$result = $stmt->get_result();

Expand Down
Loading

0 comments on commit cd68aff

Please sign in to comment.