Browse code

Changed majority of files.

DoubleBastionAdmin authored on 30/11/2024 06:56:40
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,95 @@
1
+<?php
2
+/**
3
+ *  Copyright (C) 2022, 2024  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
+
10
+session_start();
11
+
12
+define('RESTRICTED', TRUE);
13
+
14
+include 'install-signup-check.php';
15
+
16
+if ($installcheck == true) {
17
+
18
+if ($_SERVER['REQUEST_SCHEME'] == 'http') { exit("Roundpin cannot be installed over HTTP. It needs a domain that uses HTTPS."); }
19
+
20
+ if(isset($_POST['createconfigbttn'])) {
21
+
22
+   if (isset($_POST['databasename']) && $_POST['databasename'] != '' && isset($_POST['databaseuser']) && $_POST['databaseuser'] != '' &&
23
+       isset($_POST['dbuserpassword']) && $_POST['dbuserpassword'] != '') {
24
+
25
+       // Create the configuration file
26
+       $dbname = $_POST['databasename'];
27
+       $dbuser = $_POST['databaseuser'];
28
+       $dbuserpswd = $_POST['dbuserpassword'];
29
+
30
+       // Generate the secret
31
+       $keypassin = substr(sha1((string) mt_rand()), 0, 32);
32
+       $keysaltin = openssl_random_pseudo_bytes(24);
33
+       $keyLengthin = 80;
34
+       $iterationin = 100;
35
+       $generated_keyin = openssl_pbkdf2($keypassin, $keysaltin, $keyLengthin, $iterationin, 'sha256');
36
+       $keypwd = bin2hex($generated_keyin);
37
+
38
+       $texttofill = "<?php\r\nif(!defined('ACCESSCONST')){die();}\r\n\r\n\$databasename='".$dbname."';\r\n\$username='".$dbuser."';\r\n\$password='".$dbuserpswd."';\r\n\$secret='".$keypwd."';\r\n?>";
39
+
40
+       file_put_contents("roundpin-config.php", $texttofill);
41
+
42
+       $_SESSION['validateaccess'] = "accessallowed";
43
+
44
+       header("Location: roundpin-initializedb.php");
45
+   } 
46
+ }
47
+
48
+?>
49
+
50
+<!DOCTYPE html>
51
+<html>
52
+<head>
53
+  <title>Roundpin Setup</title>
54
+
55
+  <link rel="stylesheet" href="css/setup.min.css">
56
+  <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
57
+  <script type="text/javascript" src="js/roundpin-setup.min.js"></script>
58
+
59
+</head>
60
+
61
+<body>
62
+
63
+  <div id="mainarea">
64
+
65
+    <img class="logosetuppage" src="images/login-logo.svg" />
66
+
67
+    <h3 style="text-align:center;">Roundpin Setup</h3><br>
68
+
69
+    <img class="setupStage" src="images/roundpin-setup-stages-1.svg" />
70
+
71
+    <form id="roundpincredform" action="" method="POST">
72
+
73
+       <label for="databasename" class="fieldlabels">Roundpin database name:</label><br>
74
+       <input type="text" id="databasename" class="textinput" name="databasename"/><br><br>
75
+
76
+       <label for="databaseuser" class="fieldlabels">Roundpin database user:</label><br>
77
+       <input type="text" id="databaseuser" class="textinput" name="databaseuser"/><br><br>
78
+
79
+       <label for="userpassword" class="fieldlabels">Roundpin database user password:</label><br>
80
+       <input type="password" id="dbuserpassword" class="textinput" name="dbuserpassword"/><br><br>
81
+
82
+       <input type="submit" id="createconfigbttn" name="createconfigbttn" value="Next" />
83
+
84
+   </form>
85
+
86
+  </div>
87
+
88
+</body>
89
+
90
+</html>
91
+
92
+<?php
93
+}
94
+
95
+?>