Browse code

Created repository.

DoubleBastionAdmin authored on 26/01/2022 20:32:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,50 @@
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
+if (isset($_POST['s_ajax_call']) && ($_POST['s_ajax_call'] == $_SESSION['validate_s_access'])) {
13
+
14
+ define('ACCESSCONST', TRUE);
15
+
16
+ require('db-connect.php');
17
+
18
+    $username = $_POST['username'];
19
+
20
+    // Get the configuration data for the current user from the 'app_users' table
21
+    $querysel = $mysqli->query("SELECT userrole, username, wss_server, web_socket_port, server_path, profile_name, sip_username, sip_password, stun_server, audio_output_id, video_src_id,
22
+                                video_height, frame_rate, aspect_ratio, video_orientation, audio_src_id, auto_gain_control, echo_cancellation, noise_suppression, ring_output_id,
23
+                                video_conf_extension, video_conf_window_width, profile_picture, notifications, use_roundcube, rcdomain, rcbasicauthuser, rcbasicauthpass, rcuser, rcpassword, 
24
+                                enabled FROM app_users WHERE BINARY username = '$username' AND enabled = 1");
25
+    $confdatafromdb = $querysel->fetch_assoc();
26
+
27
+    // Replace the SIP password, Roundcube password (if any) and Roundcube basic auth password (if any) with placeholders
28
+    $psswdaddedkey = file_get_contents('restr/'.$username.'/pwdkey');
29
+
30
+    if ($confdatafromdb['sip_password'] != '' && $confdatafromdb['sip_password'] != null && $confdatafromdb['sip_password'] != 'undefined') {
31
+            $confdatafromdb['sip_password'] = "%20%20%20%20%20%20%20";
32
+    } else { $confdatafromdb['sip_password'] = ''; }
33
+
34
+    if ($confdatafromdb['rcbasicauthpass'] != '' && $confdatafromdb['rcbasicauthpass'] != null && $confdatafromdb['rcbasicauthpass'] != 'undefined') {
35
+	    $confdatafromdb['rcbasicauthpass'] = "%20%20%20%20%20%20%20";
36
+    } else { $confdatafromdb['rcbasicauthpass'] = ''; }
37
+
38
+    if ($confdatafromdb['rcpassword'] != '' && $confdatafromdb['rcpassword'] != null && $confdatafromdb['rcpassword'] != 'undefined') {
39
+	    $confdatafromdb['rcpassword'] = "%20%20%20%20%20%20%20";
40
+    } else { $confdatafromdb['rcpassword'] = ''; }
41
+
42
+    $datafromdb = $confdatafromdb;
43
+
44
+    echo json_encode($datafromdb);
45
+
46
+} else {
47
+    header("Location: roundpin-login.php");
48
+}
49
+
50
+?>