| 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['crntvconfext']) && |
|
| 14 |
+ $_POST['crntvconfext'] != '') {
|
|
| 15 |
+ |
|
| 16 |
+ define('ACCESSCONST', TRUE);
|
|
| 17 |
+ |
|
| 18 |
+ require('db-connect.php');
|
|
| 19 |
+ |
|
| 20 |
+ $vconfExtension = $_POST['vconfextension']; |
|
| 21 |
+ $extenPassEnc = $_POST['encextenpass']; |
|
| 22 |
+ |
|
| 23 |
+ $videoConfExt = $_POST['crntvconfext']; |
|
| 24 |
+ |
|
| 25 |
+ // 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 |
|
| 26 |
+ $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 = ?");
|
|
| 27 |
+ $query->bind_param("sss", $vconfExtension, $extenPassEnc, $videoConfExt);
|
|
| 28 |
+ $query->execute(); |
|
| 29 |
+ $extqueryres = $query->get_result()->fetch_array(); |
|
| 30 |
+ |
|
| 31 |
+ if (!$extqueryres) {
|
|
| 32 |
+ |
|
| 33 |
+ http_response_code(400); |
|
| 34 |
+ exit(); |
|
| 35 |
+ |
|
| 36 |
+ } else {
|
|
| 37 |
+ |
|
| 38 |
+ if (file_exists('../textchat/' . $videoConfExt . '/rsa_1024_priv.pem')) {
|
|
| 39 |
+ |
|
| 40 |
+ $chatPrivKey = file('../textchat/' . $videoConfExt . '/rsa_1024_priv.pem');
|
|
| 41 |
+ |
|
| 42 |
+ if (!empty($chatPrivKey)) { $message = 'success'; } else { $message = 'error'; }
|
|
| 43 |
+ |
|
| 44 |
+ } else { $chatPrivKey = ''; $message = 'error'; }
|
|
| 45 |
+ |
|
| 46 |
+ } |
|
| 47 |
+ |
|
| 48 |
+ $result = ['chatprivkey' => $chatPrivKey, 'resmessage' => $message]; |
|
| 49 |
+ |
|
| 50 |
+ echo json_encode($result); |
|
| 51 |
+ |
|
| 52 |
+} else {
|
|
| 53 |
+ header("Location: ../login.php");
|
|
| 54 |
+} |
|
| 55 |
+ |
|
| 56 |
+?> |