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,57 @@
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
+
10
+session_start();
11
+ // header('Set-Cookie: PHPSESSID= ' . session_id() . '; SameSite=strict; Secure=true; HttpOnly=true;');
12
+
13
+if (isset($_POST['vconfextension']) && $_POST['vconfextension'] != '' && isset($_POST['encextenpass']) && $_POST['encextenpass'] != '' && isset($_POST['conferenceext']) && 
14
+    $_POST['conferenceext'] != '' && isset($_POST['recsendsipuser']) && $_POST['recsendsipuser'] != '') {
15
+
16
+    define('ACCESSCONST', TRUE);
17
+
18
+    require('db-connect.php');
19
+
20
+    $vconfExtension = $_POST['vconfextension'];
21
+    $extenPassEnc = $_POST['encextenpass'];
22
+    $videoConfExt = $_POST['conferenceext'];
23
+
24
+    $recsendsipuser = $_POST['recsendsipuser'];
25
+
26
+    // Check if the received external user extension, the corresponding encrypted password and the extension of the conference, match the data in the 'external_users' table
27
+    $query = $mysqli->prepare("SELECT id, exten_for_external, exten_for_ext_pass, conf_extension FROM external_users WHERE exten_for_external = ? AND exten_for_ext_pass = ? AND conf_extension = ?");
28
+    $query->bind_param("sss", $vconfExtension, $extenPassEnc, $videoConfExt);
29
+    $query->execute();
30
+    $extqueryres = $query->get_result()->fetch_array();
31
+
32
+    if (!$extqueryres) {
33
+
34
+        http_response_code(400);
35
+        exit();
36
+
37
+    } else {
38
+
39
+	    if (is_file('../textchat/' . $recsendsipuser . '/rsa_1024_pub.pem')) {
40
+
41
+		$chatKey = file('../textchat/' . $recsendsipuser . '/rsa_1024_pub.pem');
42
+
43
+		if (!empty($chatKey)) { $message = 'success'; } else { $message = 'error'; }
44
+
45
+	    } else { $chatKey = ''; $message = 'error'; }
46
+
47
+    }
48
+
49
+    $result = ['chatkey' => $chatKey, 'resmessage' => $message];
50
+
51
+    echo json_encode($result);
52
+
53
+} else {
54
+    header("Location: ../login.php");
55
+}
56
+
57
+?>