Browse code

Created repository.

DoubleBastionAdmin authored on 26/01/2022 20:32:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,119 @@
1
+<?php
2
+/**
3
+ *  Copyright (C) 2021  Double Bastion LLC
4
+ *
5
+ *  This file is part of Roundpin, which is licensed under the
6
+ *  GNU Affero General Public License Version 3.0. The license terms
7
+ *  are detailed in the "LICENSE.txt" file located in the root directory.
8
+
9
+ *  This is a modified version of the original file "index.html",
10
+ *  first modified in 2020. The copyright notice for the original
11
+ *  content follows:
12
+ *
13
+ *  Copyright (c) 2019 by Daniel Zawadzki (https://codepen.io/danzawadzki/pen/EgqKRr)
14
+ *  License: The MIT License
15
+ */
16
+
17
+define('ACCESSCONST', TRUE);
18
+
19
+define('RESTRICTED', TRUE);
20
+
21
+require 'db-connect.php';
22
+
23
+// Extract the sign up parameter from 'install-signup-check.php' to activate or deactivate the 'Sign Up' tab
24
+if (is_file(dirname(__FILE__) . '/install-signup-check.php')) {
25
+
26
+    $setupfile = file(dirname(__FILE__) . '/install-signup-check.php');
27
+
28
+    $signup_check = 'false';
29
+    foreach ($setupfile as $keyfile => $valuefile) {
30
+         if ((strpos($valuefile, "\$signupcheck") !== false) && (strpos($valuefile, "//") === false)) {
31
+              $signup_init = explode("=", $valuefile);
32
+              $firsttwo_init = str_replace(" ","", $signup_init[0]);
33
+              $signup_sec = explode(";", $signup_init[1]);
34
+              $signup_check = str_replace(" ","", $signup_sec[0]);
35
+              break;
36
+         }
37
+    }
38
+
39
+    if ($signup_check == 'true') {
40
+
41
+       // Generate a random string to prevent direct access to 'register-user.php'
42
+       function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') {
43
+           $pieces = [];
44
+           $max = mb_strlen($keyspace, '8bit') - 1;
45
+
46
+           for ($i = 0; $i < $length; ++$i) {
47
+               $pieces []= $keyspace[random_int(0, $max)];
48
+           }
49
+           return implode('', $pieces);
50
+       }
51
+
52
+       $token = random_str(40);
53
+
54
+       session_start();
55
+
56
+       $_SESSION['validate_access'] = $token;
57
+
58
+       ?>
59
+       <script type="text/javascript">
60
+         var signupCheck = "<?php print_r($signup_check); ?>";
61
+         var validateToken = "<?php print_r($_SESSION['validate_access']); ?>";
62
+       </script>
63
+       <?php
64
+
65
+    } else { header("Location: roundpin-login.php"); }
66
+
67
+} else { header("Location: roundpin-login.php"); }
68
+
69
+?>
70
+
71
+
72
+<!doctype html>
73
+<head>
74
+   <meta charset="utf-8">
75
+   <title>Roundpin</title>
76
+   <link rel="stylesheet" href="css/login.min.css"/>
77
+   <link rel="stylesheet" href="css/inter.min.css"/>
78
+   <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
79
+   <script type="text/javascript" src="js/roundpin-signup.min.js"></script>
80
+   <link rel="shortcut icon" type="image/svg" href="images/favicon.svg" />
81
+</head>
82
+<body>
83
+
84
+  <div class="wrapper">
85
+  <div id="formContent">
86
+
87
+    <!-- Tabs Titles -->
88
+    <a href="roundpin-login.php"><h2 id="signintab" class="underlineHover">Log In</h2></a>
89
+    <a id="signupsec" href="roundpin-signup.php"><h2 id="signuptab" class="active underlineHover">Sign Up</h2></a>
90
+
91
+    <!-- Icon -->
92
+    <div id="logosection">
93
+      <img src="images/login-logo.svg" id="login-logo" alt="Roundpin logo" />
94
+    </div>
95
+
96
+    <div id="submitmessage"></div>
97
+
98
+    <!-- Signup fields -->
99
+    <span id="emailaddressLabel" class="fadeInSpec">Email Address</span>
100
+    <input type="text" id="emailaddress" name="emailaddress" placeholder="Email Address" />
101
+    <span id="regusernameLabel" class="fadeInSpec">Username</span>
102
+    <input type="text" id="login" name="login" placeholder="Username" />
103
+    <span id="regpasswordLabel" class="fadeInSpec">Password</span>
104
+    <input type="password" id="password" name="password" placeholder="Password (Eg.: d?t5&c!9b~2yq4)" title="At least 10 characters, including at least one letter, one
105
+             digit and one special character" />
106
+    <span id="regpasswordrepLabel" class="fadeInSpec">Repeat Password</span>
107
+    <input type="password" id="passwordrepeat" name="passwordrepeat" placeholder="Repeat Password" title="Enter password again." />
108
+    <select id="selectrole" name="selectrole"><option class="selectoption" value="" disabled="disabled" selected="selected">select your role</option><option class="selectoption" value="regular_user">Regular User</option><option class="selectoption" value="superadmin">Superadmin</option></select>
109
+    <input type="submit" id="signupbutton" name="signupbutton" value="Sign Up" />
110
+
111
+    <!-- Remind Passowrd -->
112
+    <div id="formFooter">
113
+        <a id="forgotpass" class="underlineHover" href="forgot-password.php">Forgot Password?</a>
114
+    </div>
115
+  </div>
116
+  </div>
117
+
118
+</body>
119
+</html>