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,59 @@
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
+
12
+ // header('Set-Cookie: PHPSESSID= ' . session_id() . '; SameSite=strict; Secure=true; HttpOnly=true;');
13
+
14
+if (isset($_POST['s_ajax_call']) && ($_POST['s_ajax_call'] == $_SESSION['validate_s_access'])) {
15
+
16
+ define('ACCESSCONST', TRUE);
17
+
18
+ require('db-connect.php');
19
+
20
+    $callerExt = $_POST['clrextension'];
21
+    $callerExtMod = substr($callerExt, 0, -5);
22
+
23
+    if ($callerExt != null && $callerExt != 'undefined' && $callerExt != '') {
24
+
25
+	$query2 = $mysqli->prepare("SELECT id, wss_server, profile_name, sip_username, display_vconf_user FROM app_users WHERE sip_username = ?");
26
+	$query2->bind_param("s", $callerExtMod);
27
+	$query2->execute();
28
+	$userpref = $query2->get_result()->fetch_assoc();
29
+
30
+	if ($userpref) {
31
+
32
+            $userDesc = $userpref['profile_name'];
33
+	    $nameDisplay = $userpref['display_vconf_user'];
34
+	    $messagetosend = 'success';
35
+
36
+	} else {
37
+
38
+	    $query3 = $mysqli->prepare("SELECT id, profile_name, exten_for_external, display_vconf_user FROM external_users WHERE exten_for_external = ?");
39
+	    $query3->bind_param("s", $callerExt);
40
+	    $query3->execute();
41
+	    $userdisplay = $query3->get_result()->fetch_assoc();
42
+
43
+	    if ($userdisplay) {
44
+
45
+                $userDesc = $userdisplay['profile_name'];
46
+	        $nameDisplay = $userdisplay['display_vconf_user'];
47
+	        $messagetosend = 'success';
48
+
49
+	    } else { $userDesc = null; $nameDisplay = null; $messagetosend = "An error occurred while getting the user data!"; }
50
+	}
51
+    }
52
+
53
+    $response = ['result' => $messagetosend, 'userdescription' => $userDesc, 'namedisplay' => $nameDisplay];
54
+
55
+    echo json_encode($response);
56
+
57
+} else { header("Location: ../login.php"); }
58
+
59
+?>
0 60
\ No newline at end of file