Browse code

Created repository.

DoubleBastionAdmin authored on 29/11/2024 03:10:08
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,154 @@
1
+<?php
2
+/**
3
+ * @copyright 2024 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+define('ACCESSCONST', TRUE);
25
+
26
+require('db-connect.php');
27
+
28
+session_start();
29
+
30
+if ($_SESSION['loggedtorspanel'] == true) {
31
+
32
+?>
33
+
34
+<!doctype html>
35
+<head>
36
+    <meta charset="utf-8">
37
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
38
+    <title>RED SCARF Suite Panel</title>
39
+    <meta name="description" content="RED SCARF Suite Panel">
40
+    <meta name="viewport" content="width=device-width, initial-scale=1">
41
+
42
+    <link rel="shortcut icon" type="image/png" href="images/favicon.png" />
43
+    <link rel="stylesheet" href="assets/css/normalize.min.css">
44
+    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
45
+    <link rel="stylesheet" href="assets/css/font-awesome-4.7.0/css/font-awesome.min.css">
46
+    <link rel="stylesheet" href="assets/css/themify-icons/themify-icons.css">
47
+    <link rel="stylesheet" href="assets/css/cs-skin-elastic.css">
48
+    <link rel="stylesheet" href="assets/css/style.css">
49
+
50
+    <script type="text/javascript" src="assets/js/jquery-3.3.1.min.js"></script>
51
+    <script type="text/javascript" src="assets/js/jquery.min.js"></script>
52
+    <script type="text/javascript" src="assets/js/popper.min.js"></script>
53
+    <script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
54
+    <script type="text/javascript" src="assets/js/jquery.matchHeight.min.js"></script>
55
+    <script type="text/javascript" src="assets/js/main.js"></script>
56
+    <script type="text/javascript" src="assets/js/moment.min.js"></script>
57
+
58
+    <script type="text/javascript" src="assets/js/settingsmenu.js"></script>
59
+    <script type="text/javascript" src="assets/js/change-password.js"></script>
60
+
61
+</head>
62
+
63
+<body>
64
+
65
+<?php include 'panels.php'; ?>
66
+
67
+        <!-- Content -->
68
+
69
+        <div class="content">
70
+
71
+                <div class="pagetitle">Change Password</div>
72
+
73
+                <div class="col-lg-8">
74
+                    <div class="card newpasscard">
75
+                        <div class="card-header">Change Password</div>
76
+                        <div class="card-body card-block">
77
+                                <div class="form-group">
78
+                                    <div class="input-group">
79
+                                        <div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
80
+                                        <input type="password" id="currentpassword" name="currentpassword" placeholder="Current Password" class="form-control">
81
+                                    </div>
82
+                                </div>
83
+                                <div class="form-group">
84
+                                    <div class="input-group">
85
+                                        <div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
86
+                                        <input type="password" id="newpassword" name="newpassword" placeholder="New Password  (at least 10 characters, at least one letter, one digit, one special character)" class="form-control">
87
+                                    </div>
88
+                                </div>
89
+                                <div class="form-group">
90
+                                    <div class="input-group">
91
+                                        <div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
92
+                                        <input type="password" id="confirmpassword" name="confirmpassword" placeholder="Confirm New Password" class="form-control">
93
+                                    </div>
94
+                                </div>
95
+                                <span id="savenewpasstext"></span>
96
+                                <input type="button" id="savenewpassword" value="Save New Password" />
97
+                        </div>
98
+                    </div>
99
+                </div>
100
+
101
+
102
+<?php include 'about.php'; ?>
103
+
104
+        </div>
105
+
106
+        <!-- /.content -->
107
+
108
+        <div class="clearfix"></div>
109
+
110
+<?php include 'footer.php'; ?>
111
+
112
+    </div>
113
+    <!-- /#right-panel -->
114
+
115
+    <script type="text/javascript">
116
+      $("#settingsdroparea").show();
117
+      $("#changepassword").css("color", "#03A9F3");
118
+    </script>
119
+
120
+</body>
121
+</html>
122
+
123
+<?php
124
+
125
+    // Generate a random string to prevent direct access to 'save-password.php'
126
+    function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') {
127
+        $pieces = [];
128
+        $max = mb_strlen($keyspace, '8bit') - 1;
129
+
130
+        for ($i = 0; $i < $length; ++$i) {
131
+            $pieces []= $keyspace[random_int(0, $max)];
132
+        }
133
+        return implode('', $pieces);
134
+    }
135
+
136
+    $token = random_str(45);
137
+
138
+    session_start();
139
+
140
+    $_SESSION['valid_access'] = $token;
141
+
142
+    ?>
143
+    <script type="text/javascript">
144
+         var getVerifyKey = "<?php print_r($_SESSION['valid_access']); ?>";
145
+    </script>
146
+    <?php
147
+
148
+} else {
149
+
150
+      header("Location: panel-login.php");
151
+}
152
+
153
+?>
154
+