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,56 @@
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['vidconfextension']) && 
14
+    $_POST['vidconfextension'] != '') {
15
+
16
+    define('ACCESSCONST', TRUE);
17
+
18
+    require('db-connect.php');
19
+
20
+    $extForExternal = $_POST['vconfextension'];
21
+    $extenPassEnc = $_POST['encextenpass'];
22
+    $vconfExtension = $_POST['vidconfextension'];
23
+
24
+    // 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
25
+    $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 = ?");
26
+    $query->bind_param("sss", $extForExternal, $extenPassEnc, $vconfExtension);
27
+    $query->execute();
28
+    $extqueryres = $query->get_result()->fetch_array();
29
+
30
+    if (!$extqueryres) {
31
+
32
+        http_response_code(400);
33
+        exit();
34
+
35
+    } else {
36
+
37
+	if (is_dir('../textchat/' . $extForExternal . 'vconf' . '/uploads')) {
38
+
39
+	    try {
40
+	      array_map('unlink', glob('../textchat/' . $extForExternal . 'vconf' . '/uploads/*'));
41
+	      if (glob('../textchat/' . $extForExternal . 'vconf' . '/uploads/*')) { throw new Exception('Directory not empty'); } else { throw new Exception(''); }
42
+	    } catch (Exception $e) { if ($e->getMessage() == '') { $cmessage = 'success'; } else { $cmessage = 'failure'; } }
43
+
44
+	} else { $cmessage = 'success'; }
45
+
46
+    }
47
+
48
+    $resresult = ["note" => $cmessage];
49
+
50
+    echo json_encode($resresult);
51
+
52
+} else {
53
+       header("Location: ../login.php");
54
+}
55
+
56
+?>