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,117 @@
1
+<!doctype html>
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
+<head>
23
+   <meta charset="utf-8">
24
+   <title>RED SCARF Suite Panel</title>
25
+   <link rel="stylesheet" href="assets/css/login-style.css"/>
26
+   <script type="text/javascript" src="assets/js/jquery-3.3.1.min.js"></script>
27
+   <script type="text/javascript" src="assets/js/forgot-password.js"></script>
28
+   <link rel="shortcut icon" type="image/png" href="images/favicon.png" />
29
+</head>
30
+<body>
31
+
32
+  <div class="wrapper">
33
+  <div id="formContent">
34
+    <!-- Tabs Titles -->
35
+    <a href="panel-login.php"><h2 id="signintab" class="underlineHover">Log In</h2></a>
36
+    <a id="signupsec" href="panel-signup.php"><h2 id="signuptab" class="underlineHover">Sign Up</h2></a>
37
+
38
+    <!-- Icon -->
39
+    <div id="logosection">
40
+      <img src="images/red-scarf-suite-panel_logo_login.svg" id="panel-logo" alt="RED SCARF Suite Panel logo" />
41
+    </div>
42
+
43
+    <div id="submitmessage"></div>
44
+
45
+    <input type="text" id="emailforgotpass" name="emailforgotpass" placeholder="enter your email address" />
46
+    <input type="button" id="forgotpassbutton" name="forgotpassbutton" value="Request Account Access" />
47
+
48
+
49
+    <div id="formFooter">
50
+      <a id="forgotpass" class="underlineHover">Forgot Password?</a>
51
+    </div>
52
+
53
+  </div>
54
+</div>
55
+
56
+<?php
57
+
58
+define('RESTRICTED', TRUE);
59
+
60
+ // Extract the sign up parameter from 'install-signup-check.php' to activate or deactivate the 'Sign Up' tab
61
+ if (is_file(dirname(__FILE__) . '/install-signup-check.php')) {
62
+
63
+    $setupfile = file(dirname(__FILE__) . '/install-signup-check.php');
64
+
65
+    $signup_check = 'false';
66
+    foreach ($setupfile as $keyfile => $valuefile) {
67
+         if ((strpos($valuefile, "\$signupcheck") !== false) && (strpos($valuefile, "//") === false)) {
68
+              $signup_init = explode("=", $valuefile);
69
+              $firsttwo_init = str_replace(" ","", $signup_init[0]);
70
+              $signup_sec = explode(";", $signup_init[1]);
71
+              $signup_check = str_replace(" ","", $signup_sec[0]);
72
+              break;
73
+         }
74
+    }
75
+
76
+    if ($signup_check != 'true') {
77
+
78
+         ?>
79
+         <script type="text/javascript">
80
+             $("#signupsec").css("cursor", "default");
81
+             $("#signupsec").attr("href", "");
82
+
83
+             $("#signuptab").addClass("inactive");
84
+             $("#signuptab").removeClass("underlineHover");
85
+             $("#signuptab").css("cursor", "default");
86
+         </script>
87
+         <?php
88
+
89
+    }
90
+ }
91
+
92
+ // Generate a random string to prevent direct access to 'register-user.php'
93
+ function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') {
94
+      $pieces = [];
95
+      $max = mb_strlen($keyspace, '8bit') - 1;
96
+
97
+      for ($i = 0; $i < $length; ++$i) {
98
+          $pieces []= $keyspace[random_int(0, $max)];
99
+      }
100
+      return implode('', $pieces);
101
+ }
102
+
103
+ $token = random_str(40);
104
+
105
+ session_start();
106
+
107
+ $_SESSION['forgotpass_access'] = $token;
108
+
109
+ ?>
110
+
111
+ <script type="text/javascript">
112
+      var getVerifyToken = "<?php print_r($_SESSION['forgotpass_access']); ?>";
113
+ </script>
114
+
115
+</body>
116
+</html>
117
+