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,42 @@
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
+$retrieved = $_GET['key'];
13
+
14
+if (($retrieved != '') && (strlen($retrieved) == 50)) {
15
+
16
+  define('ACCESSCONST', TRUE);
17
+
18
+  require('db-connect.php');
19
+
20
+    // Find the user who has a token identical with the one retrieved from the link that has been clicked
21
+    $registereduser = '0';
22
+    $enabled = 1;
23
+    $query0 = $mysqli->prepare("SELECT id, registered, token, enabled FROM app_users WHERE registered = ? AND token = ? AND enabled = ?");
24
+    $query0->bind_param("ssi", $registereduser, $retrieved, $enabled);
25
+    $query0->execute();
26
+    $fetchdata = $query0->get_result()->fetch_assoc();
27
+
28
+    if (!$fetchdata) {
29
+        $query0->close();
30
+        exit("Error !");
31
+    } else {
32
+        $ID = $fetchdata['id'];
33
+        $registered = 1;
34
+        $crtoken = '';
35
+        $query1 = $mysqli->prepare("UPDATE app_users SET registered = ?, token = ?  WHERE id = ?");
36
+        $query1->bind_param("isi", $registered, $crtoken, $ID);
37
+        $query1->execute();
38
+        header("Location: registration-success.php");
39
+    }
40
+}
41
+
42
+?>