-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.php
40 lines (39 loc) · 1.02 KB
/
reset.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require 'inc/functions.php';
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if( isset( $_GET['yes'] ) ) {
// Delete DB
$machines = $db->query( "DELETE FROM `machines`" );
$apps = $db->query( "DELETE FROM `applications`" );
// Delete
$files = scandir( "data" );
foreach( $files as $file ) {
if( $file !== "." or $file !== ".." ) {
$bang = explode( "." , $file );
if( $bang[1] == "zip" or $bang[1] == "rdp" ) {
unlink( "data/" . $file );
}
}
}
}
?>
<!doctype html>
<html lang="en">
<head>
<?php
require 'inc/header.php';
?>
</head>
<body>
<?php require 'inc/menu.php'; ?>
<main role="main" class="container">
<h1>Configuration</h1>
<br />
<p>Are you 100% sure you want to delete your configuration and reset?</p>
<button class="btn btn-danger" onclick="window.location='reset.php?yes'">Yes</button> <button class="btn btn-success" onclick="window.location='index.php'">No</button>
</main>
<?php require 'inc/footer.php'; ?>
</body>
</html>