Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css js/settings.js js/adminsettings.js lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/settings/personal.php templates/settings/admin.php lib/Migration/Version135Date20240420221527.php lib/Migration/Version136Date20240502081941.php

DoubleBastionAdmin authored on 02/05/2024 04:12:37
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,327 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'adminsettings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+
33
+        <div class="section">
34
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
+               Flowroute, or all of them:')); ?></h3></p><br>
37
+           <div class="sms_followupsection">
38
+
39
+                <form id="admin_conf" action="#" >
40
+
41
+                   <div class="providerSettings">
42
+                   <p class="providerName">Telnyx Settings</p>
43
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
+                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
+                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
+                          placeholder="e.g. d6f172ce92e4f2 ..." /><br>
48
+
49
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
+                          below.):</label></p>
52
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
+                          placeholder="e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=" /><br>
54
+
55
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
+                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
+                       Copy it and enter it in the field from below.):
58
+                   </label></p>
59
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
+                          placeholder="e.g. 9d4f47b6-26c9-d25c-c2f5 ..." /><br>
61
+
62
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
+                       the database.)</label></p>
68
+                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
+
72
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
+                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
+                       You don't have to enter this URL into your Telnyx account. Also, after entering all the credentials, click the 'Save' button at the bottom of this page, 
75
+                       to save all the settings to the database.)</label></p>
76
+                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
+
79
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
+                          placeholder="e.g. Smart Inc" /><br><br>
88
+
89
+                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
+                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
+                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
+                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
+
94
+                   <table id="tnxKeysAccessTbl">
95
+
96
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
+                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
+                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
100
+                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
+
102
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-tnx" class="alwDelCkbx" autocomplete="false" />
103
+                      <label for="alwDelGrps-tnx">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
104
+                      </label></div></td><td></td>
105
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-tnx" class="alwDelCkbx" autocomplete="false" />
106
+                      <label for="alwDelUsrs-tnx">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
107
+                      </div></td><td></td><td></td></tr>
108
+
109
+                   </table><br>
110
+
111
+                   </div><br><br><br>
112
+
113
+                   <div class="providerSettings">
114
+                   <p class="providerName">Plivo Settings</p>
115
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
116
+                          and enter it in the field from below.):</label></p>
117
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
118
+                          placeholder="e.g. r5g974cb92e4t1 ...'" /><br>
119
+
120
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
121
+                          enter it in the field from below.):</label></p>
122
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
123
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
124
+
125
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
126
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
127
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
128
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
129
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
130
+                       to the database.)</label></p>
131
+                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
132
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
133
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
134
+
135
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
136
+                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
137
+                       You don't have to enter this URL into your Plivo account. Also, after entering all the credentials, click the 'Save' button at the bottom of this page, 
138
+                       to save all the settings to the database.)</label></p>
139
+                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
140
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
141
+
142
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
143
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
144
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
145
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
146
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
147
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
148
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
149
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
150
+                          placeholder="e.g. Global Inc" /><br><br>
151
+
152
+                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
153
+                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
154
+                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
155
+                          button at the bottom of that page):</b></label></p><br>
156
+
157
+                   <table id="plvKeysAccessTbl">
158
+
159
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
160
+                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
161
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
162
+                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
163
+                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
164
+
165
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-plv" class="alwDelCkbx" autocomplete="false" />
166
+                      <label for="alwDelGrps-plv">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
167
+                      </label></div></td><td></td>
168
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-plv" class="alwDelCkbx" autocomplete="false" />
169
+                      <label for="alwDelUsrs-plv">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
170
+                      </div></td><td></td><td></td></tr>
171
+
172
+                   </table><br>
173
+
174
+                   </div><br><br><br>
175
+
176
+                   <div class="providerSettings">
177
+                   <p class="providerName">Twilio Settings</p>
178
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
179
+                          and enter it in the field from below.):</label></p>
180
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
181
+                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
182
+
183
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
184
+                          and enter it in the field from below.):</label></p>
185
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
186
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
187
+
188
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
189
+                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
190
+                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
191
+                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
192
+                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
193
+                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
194
+                       credentials, to save all the settings to the database.)</label></p>
195
+                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
196
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
197
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
198
+
199
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
200
+                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
201
+                       You don't have to enter this URL into your Twilio account. Also, after entering all the credentials, click the 'Save' button at the bottom of this page, 
202
+                       to save all the settings to the database.)</label></p>
203
+                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
204
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
205
+
206
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
207
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
208
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
209
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
210
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
211
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
212
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
213
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
214
+                          placeholder="e.g. Global Inc" /><br><br>
215
+
216
+                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
217
+                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
218
+                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
219
+                          'Save' button at the bottom of that page):</b></label></p><br>
220
+
221
+                   <table id="twlKeysAccessTbl">
222
+
223
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
224
+                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
225
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td>
226
+                      <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
227
+                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
228
+                      <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
229
+
230
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-twl" class="alwDelCkbx" autocomplete="false" />
231
+                      <label for="alwDelGrps-twl">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
232
+                      </label></div></td><td></td>
233
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-twl" class="alwDelCkbx" autocomplete="false" />
234
+                      <label for="alwDelUsrs-twl">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
235
+                      </div></td><td></td><td></td></tr>
236
+
237
+                   </table><br>
238
+
239
+                   </div><br><br><br>
240
+
241
+                   <div class="providerSettings">
242
+                   <p class="providerName">Flowroute Settings</p>
243
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
244
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
245
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
246
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
247
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
248
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
249
+                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
250
+
251
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
252
+                          below.):</label></p>
253
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
254
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
255
+
256
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
257
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
258
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
259
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
260
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
261
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
262
+                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
263
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
264
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
265
+
266
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
267
+                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
268
+                          into your Flowroute account. Also, after entering all the credentials, click the 'Save' button at the bottom of this page, 
269
+                          to save all the settings to the database.)</label></p>
270
+                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
271
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
272
+                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
273
+
274
+                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
275
+                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
276
+                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
277
+                          bottom of that page):</b></label></p><br>
278
+
279
+                   <table id="flrKeysAccessTbl">
280
+
281
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
282
+                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
283
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td>
284
+                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
285
+                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
286
+                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
287
+
288
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-flr" class="alwDelCkbx" autocomplete="false" />
289
+                      <label for="alwDelGrps-flr">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
290
+                      </label></div></td><td></td>
291
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-flr" class="alwDelCkbx" autocomplete="false" />
292
+                      <label for="alwDelUsrs-flr">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
293
+                      </div></td><td></td><td></td></tr>
294
+
295
+                   </table><br>
296
+
297
+                   </div><br><br><br>
298
+
299
+
300
+                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list not only my messages but also the messages of all the Nextcloud users 
301
+                   with whom I share the access keys mentioned above:</b></label></p>
302
+                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
303
+
304
+                   <p><div class="setlabeltext"><b>Restrict access to the following phone numbers:</b><div class="tooltiprestrict">
305
+                        <div id="inforestrict">i</div><div class="restricttooltext">After you allow non-admin users to use your API keys for a provider, to send and
306
+                        receive messages, they will be able to see and use all the phone numbers associated with those API keys. However, if you restrict shared phone 
307
+                        numbers to specific non-admin users, they will be able to see and use only those numbers and won't be able to see and use the other numbers 
308
+                        associated with those shared API keys.</div></div></p><br>
309
+
310
+                   <table id="phoneNmbrRestr">
311
+
312
+                        <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
313
+                        <th style="max-width: 40px !important"></th><th></th><th></th></tr>
314
+
315
+                   </table><br>
316
+
317
+                   <input type="hidden" id="user_id" name="user_id" />
318
+
319
+                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
320
+
321
+                   <span id="smsr_save_msg"></span>
322
+
323
+               </form>
324
+           </div>
325
+        </div>
326
+</div>
327
+
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css js/settings.js js/adminsettings.js lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/settings/personal.php templates/settings/admin.php lib/Migration/Version135Date20240420221527.php

DoubleBastionAdmin authored on 02/05/2024 04:04:23
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,327 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'adminsettings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-
33
-        <div class="section">
34
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
-               Flowroute, or all of them:')); ?></h3></p><br>
37
-           <div class="sms_followupsection">
38
-
39
-                <form id="admin_conf" action="#" >
40
-
41
-                   <div class="providerSettings">
42
-                   <p class="providerName">Telnyx Settings</p>
43
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
-                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
-                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
-                          placeholder="e.g. d6f172ce92e4f2 ..." /><br>
48
-
49
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
-                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
-                          below.):</label></p>
52
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
-                          placeholder="e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=" /><br>
54
-
55
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
-                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
-                       Copy it and enter it in the field from below.):
58
-                   </label></p>
59
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
-                          placeholder="e.g. 9d4f47b6-26c9-d25c-c2f5 ..." /><br>
61
-
62
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
-                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
-                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
-                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
-                       the database.)</label></p>
68
-                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
-
72
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
-                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
-                       to save all the settings to the database.)</label></p>
76
-                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
-
79
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
-                          placeholder="e.g. Smart Inc" /><br><br>
88
-
89
-                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
-                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
-                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
-                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
-
94
-                   <table id="tnxKeysAccessTbl">
95
-
96
-                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
-                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
-                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
-                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
100
-                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
-
102
-                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-tnx" class="alwDelCkbx" autocomplete="false" />
103
-                      <label for="alwDelGrps-tnx">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
104
-                      </label></div></td><td></td>
105
-                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-tnx" class="alwDelCkbx" autocomplete="false" />
106
-                      <label for="alwDelUsrs-tnx">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
107
-                      </div></td><td></td><td></td></tr>
108
-
109
-                   </table><br>
110
-
111
-                   </div><br><br><br>
112
-
113
-                   <div class="providerSettings">
114
-                   <p class="providerName">Plivo Settings</p>
115
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
116
-                          and enter it in the field from below.):</label></p>
117
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
118
-                          placeholder="e.g. r5g974cb92e4t1 ...'" /><br>
119
-
120
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
121
-                          enter it in the field from below.):</label></p>
122
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
123
-                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
124
-
125
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
126
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
127
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
128
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
129
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
130
-                       to the database.)</label></p>
131
-                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
132
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
133
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
134
-
135
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
136
-                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
137
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
138
-                       to save all the settings to the database.)</label></p>
139
-                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
140
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
141
-
142
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
143
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
144
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
145
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
146
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
147
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
148
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
149
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
150
-                          placeholder="e.g. Global Inc" /><br><br>
151
-
152
-                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
153
-                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
154
-                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
155
-                          button at the bottom of that page):</b></label></p><br>
156
-
157
-                   <table id="plvKeysAccessTbl">
158
-
159
-                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
160
-                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
161
-                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
162
-                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
163
-                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
164
-
165
-                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-plv" class="alwDelCkbx" autocomplete="false" />
166
-                      <label for="alwDelGrps-plv">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
167
-                      </label></div></td><td></td>
168
-                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-plv" class="alwDelCkbx" autocomplete="false" />
169
-                      <label for="alwDelUsrs-plv">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
170
-                      </div></td><td></td><td></td></tr>
171
-
172
-                   </table><br>
173
-
174
-                   </div><br><br><br>
175
-
176
-                   <div class="providerSettings">
177
-                   <p class="providerName">Twilio Settings</p>
178
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
179
-                          and enter it in the field from below.):</label></p>
180
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
181
-                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
182
-
183
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
184
-                          and enter it in the field from below.):</label></p>
185
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
186
-                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
187
-
188
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
189
-                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
190
-                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
191
-                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
192
-                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
193
-                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
194
-                       credentials, to save all the settings to the database.)</label></p>
195
-                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
196
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
197
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
198
-
199
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
200
-                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
201
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
202
-                       to save all the settings to the database.)</label></p>
203
-                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
204
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
205
-
206
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
207
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
208
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
209
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
210
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
211
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
212
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
213
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
214
-                          placeholder="e.g. Global Inc" /><br><br>
215
-
216
-                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
217
-                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
218
-                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
219
-                          'Save' button at the bottom of that page):</b></label></p><br>
220
-
221
-                   <table id="twlKeysAccessTbl">
222
-
223
-                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
224
-                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
225
-                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td>
226
-                      <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
227
-                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
228
-                      <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
229
-
230
-                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-twl" class="alwDelCkbx" autocomplete="false" />
231
-                      <label for="alwDelGrps-twl">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
232
-                      </label></div></td><td></td>
233
-                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-twl" class="alwDelCkbx" autocomplete="false" />
234
-                      <label for="alwDelUsrs-twl">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
235
-                      </div></td><td></td><td></td></tr>
236
-
237
-                   </table><br>
238
-
239
-                   </div><br><br><br>
240
-
241
-                   <div class="providerSettings">
242
-                   <p class="providerName">Flowroute Settings</p>
243
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
244
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
245
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
246
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
247
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
248
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
249
-                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
250
-
251
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
252
-                          below.):</label></p>
253
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
254
-                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
255
-
256
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
257
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
258
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
259
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
260
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
261
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
262
-                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
263
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
264
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
265
-
266
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
267
-                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
268
-                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
269
-                          to the database.)</label></p>
270
-                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
271
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
272
-                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
273
-
274
-                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
275
-                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
276
-                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
277
-                          bottom of that page):</b></label></p><br>
278
-
279
-                   <table id="flrKeysAccessTbl">
280
-
281
-                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
282
-                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
283
-                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td>
284
-                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
285
-                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
286
-                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
287
-
288
-                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-flr" class="alwDelCkbx" autocomplete="false" />
289
-                      <label for="alwDelGrps-flr">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
290
-                      </label></div></td><td></td>
291
-                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-flr" class="alwDelCkbx" autocomplete="false" />
292
-                      <label for="alwDelUsrs-flr">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
293
-                      </div></td><td></td><td></td></tr>
294
-
295
-                   </table><br>
296
-
297
-                   </div><br><br><br>
298
-
299
-
300
-                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list not only my messages but also the messages of all the Nextcloud users 
301
-                   with whom I share the access keys mentioned above:</b></label></p>
302
-                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
303
-
304
-                   <p><div class="setlabeltext"><b>Restrict access to the following phone numbers:</b><div class="tooltiprestrict">
305
-                        <div id="inforestrict">i</div><div class="restricttooltext">After you allow non-admin users to use your API keys for a provider, to send and
306
-                        receive messages, they will be able to see and use all the phone numbers associated with those API keys. However, if you restrict shared phone 
307
-                        numbers to specific non-admin users, they will be able to see and use only those numbers and won't be able to see and use the other numbers 
308
-                        associated with those shared API keys.</div></div></p><br>
309
-
310
-                   <table id="phoneNmbrRestr">
311
-
312
-                        <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
313
-                        <th style="max-width: 40px !important"></th><th></th><th></th></tr>
314
-
315
-                   </table><br>
316
-
317
-                   <input type="hidden" id="user_id" name="user_id" />
318
-
319
-                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
320
-
321
-                   <span id="smsr_save_msg"></span>
322
-
323
-               </form>
324
-           </div>
325
-        </div>
326
-</div>
327
-
Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt js/showsmstables.js js/adminsettings.js css/style.css lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/settings/admin.php lib/Migration/Version135Date20240420221527.php

DoubleBastionAdmin authored on 20/04/2024 03:36:59
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,327 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'adminsettings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+
33
+        <div class="section">
34
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
+               Flowroute, or all of them:')); ?></h3></p><br>
37
+           <div class="sms_followupsection">
38
+
39
+                <form id="admin_conf" action="#" >
40
+
41
+                   <div class="providerSettings">
42
+                   <p class="providerName">Telnyx Settings</p>
43
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
+                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
+                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
+                          placeholder="e.g. d6f172ce92e4f2 ..." /><br>
48
+
49
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
+                          below.):</label></p>
52
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
+                          placeholder="e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=" /><br>
54
+
55
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
+                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
+                       Copy it and enter it in the field from below.):
58
+                   </label></p>
59
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
+                          placeholder="e.g. 9d4f47b6-26c9-d25c-c2f5 ..." /><br>
61
+
62
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
+                       the database.)</label></p>
68
+                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
+
72
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
+                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
+                       to save all the settings to the database.)</label></p>
76
+                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
+
79
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
+                          placeholder="e.g. Smart Inc" /><br><br>
88
+
89
+                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
+                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
+                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
+                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
+
94
+                   <table id="tnxKeysAccessTbl">
95
+
96
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
+                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
+                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
100
+                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
+
102
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-tnx" class="alwDelCkbx" autocomplete="false" />
103
+                      <label for="alwDelGrps-tnx">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
104
+                      </label></div></td><td></td>
105
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-tnx" class="alwDelCkbx" autocomplete="false" />
106
+                      <label for="alwDelUsrs-tnx">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
107
+                      </div></td><td></td><td></td></tr>
108
+
109
+                   </table><br>
110
+
111
+                   </div><br><br><br>
112
+
113
+                   <div class="providerSettings">
114
+                   <p class="providerName">Plivo Settings</p>
115
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
116
+                          and enter it in the field from below.):</label></p>
117
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
118
+                          placeholder="e.g. r5g974cb92e4t1 ...'" /><br>
119
+
120
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
121
+                          enter it in the field from below.):</label></p>
122
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
123
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
124
+
125
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
126
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
127
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
128
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
129
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
130
+                       to the database.)</label></p>
131
+                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
132
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
133
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
134
+
135
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
136
+                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
137
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
138
+                       to save all the settings to the database.)</label></p>
139
+                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
140
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
141
+
142
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
143
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
144
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
145
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
146
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
147
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
148
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
149
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
150
+                          placeholder="e.g. Global Inc" /><br><br>
151
+
152
+                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
153
+                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
154
+                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
155
+                          button at the bottom of that page):</b></label></p><br>
156
+
157
+                   <table id="plvKeysAccessTbl">
158
+
159
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
160
+                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
161
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
162
+                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
163
+                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
164
+
165
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-plv" class="alwDelCkbx" autocomplete="false" />
166
+                      <label for="alwDelGrps-plv">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
167
+                      </label></div></td><td></td>
168
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-plv" class="alwDelCkbx" autocomplete="false" />
169
+                      <label for="alwDelUsrs-plv">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
170
+                      </div></td><td></td><td></td></tr>
171
+
172
+                   </table><br>
173
+
174
+                   </div><br><br><br>
175
+
176
+                   <div class="providerSettings">
177
+                   <p class="providerName">Twilio Settings</p>
178
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
179
+                          and enter it in the field from below.):</label></p>
180
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
181
+                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
182
+
183
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
184
+                          and enter it in the field from below.):</label></p>
185
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
186
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
187
+
188
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
189
+                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
190
+                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
191
+                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
192
+                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
193
+                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
194
+                       credentials, to save all the settings to the database.)</label></p>
195
+                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
196
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
197
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
198
+
199
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
200
+                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
201
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
202
+                       to save all the settings to the database.)</label></p>
203
+                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
204
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
205
+
206
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
207
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
208
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
209
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
210
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
211
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
212
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
213
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
214
+                          placeholder="e.g. Global Inc" /><br><br>
215
+
216
+                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
217
+                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
218
+                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
219
+                          'Save' button at the bottom of that page):</b></label></p><br>
220
+
221
+                   <table id="twlKeysAccessTbl">
222
+
223
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
224
+                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
225
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td>
226
+                      <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
227
+                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
228
+                      <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
229
+
230
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-twl" class="alwDelCkbx" autocomplete="false" />
231
+                      <label for="alwDelGrps-twl">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
232
+                      </label></div></td><td></td>
233
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-twl" class="alwDelCkbx" autocomplete="false" />
234
+                      <label for="alwDelUsrs-twl">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
235
+                      </div></td><td></td><td></td></tr>
236
+
237
+                   </table><br>
238
+
239
+                   </div><br><br><br>
240
+
241
+                   <div class="providerSettings">
242
+                   <p class="providerName">Flowroute Settings</p>
243
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
244
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
245
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
246
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
247
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
248
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
249
+                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
250
+
251
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
252
+                          below.):</label></p>
253
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
254
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
255
+
256
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
257
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
258
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
259
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
260
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
261
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
262
+                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
263
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
264
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
265
+
266
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
267
+                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
268
+                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
269
+                          to the database.)</label></p>
270
+                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
271
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
272
+                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
273
+
274
+                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
275
+                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
276
+                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
277
+                          bottom of that page):</b></label></p><br>
278
+
279
+                   <table id="flrKeysAccessTbl">
280
+
281
+                      <tr><th style="padding-bottom:3px">Groups Allowed</th><th style="max-width: 40px !important"></th><th style="padding-bottom:3px">Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
282
+                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
283
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td>
284
+                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
285
+                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
286
+                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
287
+
288
+                      <tr><td class="topLeftCorner"><div class="alwdDelGroups"><input type="checkbox" id="alwDelGrps-flr" class="alwDelCkbx" autocomplete="false" />
289
+                      <label for="alwDelGrps-flr">Allow the users in these groups to delete the messages sent from or received on the numbers shared with them.
290
+                      </label></div></td><td></td>
291
+                      <td class="topLeftCorner"><div class="alwdDelUsrs"><input type="checkbox" id="alwDelUsrs-flr" class="alwDelCkbx" autocomplete="false" />
292
+                      <label for="alwDelUsrs-flr">Allow these users to delete the messages sent from or received on the numbers shared with them.</label>
293
+                      </div></td><td></td><td></td></tr>
294
+
295
+                   </table><br>
296
+
297
+                   </div><br><br><br>
298
+
299
+
300
+                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list not only my messages but also the messages of all the Nextcloud users 
301
+                   with whom I share the access keys mentioned above:</b></label></p>
302
+                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
303
+
304
+                   <p><div class="setlabeltext"><b>Restrict access to the following phone numbers:</b><div class="tooltiprestrict">
305
+                        <div id="inforestrict">i</div><div class="restricttooltext">After you allow non-admin users to use your API keys for a provider, to send and
306
+                        receive messages, they will be able to see and use all the phone numbers associated with those API keys. However, if you restrict shared phone 
307
+                        numbers to specific non-admin users, they will be able to see and use only those numbers and won't be able to see and use the other numbers 
308
+                        associated with those shared API keys.</div></div></p><br>
309
+
310
+                   <table id="phoneNmbrRestr">
311
+
312
+                        <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
313
+                        <th style="max-width: 40px !important"></th><th></th><th></th></tr>
314
+
315
+                   </table><br>
316
+
317
+                   <input type="hidden" id="user_id" name="user_id" />
318
+
319
+                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
320
+
321
+                   <span id="smsr_save_msg"></span>
322
+
323
+               </form>
324
+           </div>
325
+        </div>
326
+</div>
327
+
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt js/showsmstables.js js/adminsettings.js css/style.css lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/settings/admin.php

DoubleBastionAdmin authored on 20/04/2024 03:30:52
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,299 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'adminsettings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-
33
-        <div class="section">
34
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
-               Flowroute, or all of them:')); ?></h3></p><br>
37
-           <div class="sms_followupsection">
38
-
39
-                <form id="admin_conf" action="#" >
40
-
41
-                   <div class="providerSettings">
42
-                   <p class="providerName">Telnyx Settings</p>
43
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
-                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
-                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
-                          placeholder="e.g. d6f172ce92e4f2 ..." /><br>
48
-
49
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
-                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
-                          below.):</label></p>
52
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
-                          placeholder="e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=" /><br>
54
-
55
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
-                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
-                       Copy it and enter it in the field from below.):
58
-                   </label></p>
59
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
-                          placeholder="e.g. 9d4f47b6-26c9-d25c-c2f5 ..." /><br>
61
-
62
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
-                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
-                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
-                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
-                       the database.)</label></p>
68
-                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
-
72
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
-                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
-                       to save all the settings to the database.)</label></p>
76
-                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
-
79
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
-                          placeholder="e.g. Smart Inc" /><br><br>
88
-
89
-                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
-                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
-                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
-                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
-
94
-                   <table id="tnxKeysAccessTbl">
95
-
96
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
-                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
-                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
-                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
100
-                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
-
102
-                   </table><br>
103
-
104
-                   </div><br><br><br>
105
-
106
-                   <div class="providerSettings">
107
-                   <p class="providerName">Plivo Settings</p>
108
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
109
-                          and enter it in the field from below.):</label></p>
110
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
111
-                          placeholder="e.g. r5g974cb92e4t1 ...'" /><br>
112
-
113
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
114
-                          enter it in the field from below.):</label></p>
115
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
116
-                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
117
-
118
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
119
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
120
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
121
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
122
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
123
-                       to the database.)</label></p>
124
-                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
125
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
126
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
127
-
128
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
129
-                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
130
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
131
-                       to save all the settings to the database.)</label></p>
132
-                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
133
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
134
-
135
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
136
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
137
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
138
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
139
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
140
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
141
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
142
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
143
-                          placeholder="e.g. Global Inc" /><br><br>
144
-
145
-                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
146
-                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
147
-                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
148
-                          button at the bottom of that page):</b></label></p><br>
149
-
150
-                   <table id="plvKeysAccessTbl">
151
-
152
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
153
-                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
154
-                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
155
-                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
156
-                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
157
-
158
-                   </table><br>
159
-
160
-                   </div><br><br><br>
161
-
162
-                   <div class="providerSettings">
163
-                   <p class="providerName">Twilio Settings</p>
164
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
165
-                          and enter it in the field from below.):</label></p>
166
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
167
-                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
168
-
169
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
170
-                          and enter it in the field from below.):</label></p>
171
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
172
-                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
173
-
174
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
175
-                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
176
-                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
177
-                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
178
-                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
179
-                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
180
-                       credentials, to save all the settings to the database.)</label></p>
181
-                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
182
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
183
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
184
-
185
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
186
-                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
187
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
188
-                       to save all the settings to the database.)</label></p>
189
-                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
190
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
191
-
192
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
193
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
194
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
195
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
196
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
197
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
198
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
199
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
200
-                          placeholder="e.g. Global Inc" /><br><br>
201
-
202
-                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
203
-                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
204
-                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
205
-                          'Save' button at the bottom of that page):</b></label></p><br>
206
-
207
-                   <table id="twlKeysAccessTbl">
208
-
209
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
210
-                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
211
-                          <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td>
212
-                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
213
-                          <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
214
-                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
215
-
216
-                   </table><br>
217
-
218
-                   </div><br><br><br>
219
-
220
-                   <div class="providerSettings">
221
-                   <p class="providerName">Flowroute Settings</p>
222
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
223
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
224
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
225
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
226
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
227
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
228
-                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
229
-
230
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
231
-                          below.):</label></p>
232
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
233
-                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
234
-
235
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
236
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
237
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
238
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
239
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
240
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
241
-                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
242
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
243
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
244
-
245
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
246
-                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
247
-                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
248
-                          to the database.)</label></p>
249
-                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
250
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
251
-                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
252
-
253
-                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
254
-                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
255
-                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
256
-                          bottom of that page):</b></label></p><br>
257
-
258
-                   <table id="flrKeysAccessTbl">
259
-
260
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
261
-                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
262
-                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td>
263
-                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
264
-                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
265
-                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
266
-
267
-                   </table><br>
268
-
269
-                   </div><br><br><br>
270
-
271
-
272
-                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list not only my messages but also the messages of all the Nextcloud users 
273
-                   with whom I share the access keys mentioned above:</b></label></p>
274
-                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
275
-
276
-                   <p><div class="setlabeltext"><b>Restrict access to the following phone numbers:</b><div class="tooltiprestrict">
277
-                        <div id="inforestrict">i</div><div class="restricttooltext">After you allow non-admin users to use your API keys for a provider, to send and
278
-                        receive messages, they will be able to see and use all the phone numbers associated with those API keys. However, if you restrict shared phone 
279
-                        numbers to specific non-admin users, they will be able to see and use only those numbers and won't be able to see and use the other numbers 
280
-                        associated with those shared API keys.</div></div></p><br>
281
-
282
-                   <table id="phoneNmbrRestr">
283
-
284
-                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
285
-                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
286
-
287
-                   </table><br>
288
-
289
-                   <input type="hidden" id="user_id" name="user_id" />
290
-
291
-                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
292
-
293
-                   <span id="smsr_save_msg"></span>
294
-
295
-               </form>
296
-           </div>
297
-        </div>
298
-</div>
299
-
Browse code

added appinfo/info.xml appinfo/signature.json appinfo/routes.php CHANGELOG.txt README.md css/style.css js/settings.js js/sendsms.js js/adminsettings.js js/showsmstables.js templates/settings/admin.php templates/settings/personal.php templates/navigation/index.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php l10n/en_GB.js l10n/en_GB.json l10n/en_US.js l10n/en_US.json lib/Migration/Version133Date20240215094712.php

DoubleBastionAdmin authored on 14/02/2024 22:47:20
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,299 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'adminsettings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+
33
+        <div class="section">
34
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
+               Flowroute, or all of them:')); ?></h3></p><br>
37
+           <div class="sms_followupsection">
38
+
39
+                <form id="admin_conf" action="#" >
40
+
41
+                   <div class="providerSettings">
42
+                   <p class="providerName">Telnyx Settings</p>
43
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
+                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
+                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
+                          placeholder="e.g. d6f172ce92e4f2 ..." /><br>
48
+
49
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
+                          below.):</label></p>
52
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
+                          placeholder="e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=" /><br>
54
+
55
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
+                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
+                       Copy it and enter it in the field from below.):
58
+                   </label></p>
59
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
+                          placeholder="e.g. 9d4f47b6-26c9-d25c-c2f5 ..." /><br>
61
+
62
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
+                       the database.)</label></p>
68
+                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
+
72
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
+                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
+                       to save all the settings to the database.)</label></p>
76
+                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
+
79
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
+                          placeholder="e.g. Smart Inc" /><br><br>
88
+
89
+                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
+                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
+                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
+                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
+
94
+                   <table id="tnxKeysAccessTbl">
95
+
96
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
+                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
+                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
100
+                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
+
102
+                   </table><br>
103
+
104
+                   </div><br><br><br>
105
+
106
+                   <div class="providerSettings">
107
+                   <p class="providerName">Plivo Settings</p>
108
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
109
+                          and enter it in the field from below.):</label></p>
110
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
111
+                          placeholder="e.g. r5g974cb92e4t1 ...'" /><br>
112
+
113
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
114
+                          enter it in the field from below.):</label></p>
115
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
116
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
117
+
118
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
119
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
120
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
121
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
122
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
123
+                       to the database.)</label></p>
124
+                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
125
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
126
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
127
+
128
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
129
+                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
130
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
131
+                       to save all the settings to the database.)</label></p>
132
+                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
133
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
134
+
135
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
136
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
137
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
138
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
139
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
140
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
141
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
142
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
143
+                          placeholder="e.g. Global Inc" /><br><br>
144
+
145
+                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
146
+                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
147
+                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
148
+                          button at the bottom of that page):</b></label></p><br>
149
+
150
+                   <table id="plvKeysAccessTbl">
151
+
152
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
153
+                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
154
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
155
+                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
156
+                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
157
+
158
+                   </table><br>
159
+
160
+                   </div><br><br><br>
161
+
162
+                   <div class="providerSettings">
163
+                   <p class="providerName">Twilio Settings</p>
164
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
165
+                          and enter it in the field from below.):</label></p>
166
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
167
+                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
168
+
169
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
170
+                          and enter it in the field from below.):</label></p>
171
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
172
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
173
+
174
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
175
+                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
176
+                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
177
+                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
178
+                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
179
+                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
180
+                       credentials, to save all the settings to the database.)</label></p>
181
+                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
182
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
183
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
184
+
185
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
186
+                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
187
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
188
+                       to save all the settings to the database.)</label></p>
189
+                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
190
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
191
+
192
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
193
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
194
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
195
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
196
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
197
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
198
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
199
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
200
+                          placeholder="e.g. Global Inc" /><br><br>
201
+
202
+                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
203
+                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
204
+                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
205
+                          'Save' button at the bottom of that page):</b></label></p><br>
206
+
207
+                   <table id="twlKeysAccessTbl">
208
+
209
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
210
+                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
211
+                          <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td>
212
+                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
213
+                          <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
214
+                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
215
+
216
+                   </table><br>
217
+
218
+                   </div><br><br><br>
219
+
220
+                   <div class="providerSettings">
221
+                   <p class="providerName">Flowroute Settings</p>
222
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
223
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
224
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
225
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
226
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
227
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
228
+                          placeholder="e.g. r5g974cb92e4t1 ..." /><br>
229
+
230
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
231
+                          below.):</label></p>
232
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
233
+                          placeholder="e.g. k6f489d8awn4p9 ..." /><br>
234
+
235
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
236
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
237
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
238
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
239
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
240
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
241
+                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
242
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
243
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
244
+
245
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
246
+                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
247
+                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
248
+                          to the database.)</label></p>
249
+                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
250
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
251
+                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
252
+
253
+                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
254
+                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
255
+                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
256
+                          bottom of that page):</b></label></p><br>
257
+
258
+                   <table id="flrKeysAccessTbl">
259
+
260
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
261
+                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
262
+                      <img class="srGroupImg" style="cursor:pointer" title="Show all groups"></div></td><td>
263
+                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
264
+                      <img class="srUserImg" style="cursor:pointer" title="Show all users"></div></td>
265
+                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
266
+
267
+                   </table><br>
268
+
269
+                   </div><br><br><br>
270
+
271
+
272
+                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list not only my messages but also the messages of all the Nextcloud users 
273
+                   with whom I share the access keys mentioned above:</b></label></p>
274
+                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
275
+
276
+                   <p><div class="setlabeltext"><b>Restrict access to the following phone numbers:</b><div class="tooltiprestrict">
277
+                        <div id="inforestrict">i</div><div class="restricttooltext">After you allow non-admin users to use your API keys for a provider, to send and
278
+                        receive messages, they will be able to see and use all the phone numbers associated with those API keys. However, if you restrict shared phone 
279
+                        numbers to specific non-admin users, they will be able to see and use only those numbers and won't be able to see and use the other numbers 
280
+                        associated with those shared API keys.</div></div></p><br>
281
+
282
+                   <table id="phoneNmbrRestr">
283
+
284
+                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
285
+                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
286
+
287
+                   </table><br>
288
+
289
+                   <input type="hidden" id="user_id" name="user_id" />
290
+
291
+                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
292
+
293
+                   <span id="smsr_save_msg"></span>
294
+
295
+               </form>
296
+           </div>
297
+        </div>
298
+</div>
299
+
Browse code

removed appinfo/info.xml appinfo/signature.json appinfo/routes.php CHANGELOG.txt README.md css/style.css js/settings.js js/sendsms.js js/adminsettings.js js/showsmstables.js templates/settings/admin.php templates/settings/personal.php templates/navigation/index.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php l10n/en_GB.js l10n/en_GB.json l10n/en_US.js l10n/en_US.json

DoubleBastionAdmin authored on 14/02/2024 22:37:16
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,298 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'adminsettings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-
33
-        <div class="section">
34
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
-               Flowroute, or all of them:')); ?></h3></p><br>
37
-           <div class="sms_followupsection">
38
-
39
-                <form id="admin_conf" action="#" >
40
-
41
-                   <div class="providerSettings">
42
-                   <p class="providerName">Telnyx Settings</p>
43
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
-                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
-                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
48
-
49
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
-                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
-                          below.):</label></p>
52
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
54
-
55
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
-                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
-                       Copy it and enter it in the field from below.):
58
-                   </label></p>
59
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
61
-
62
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
-                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
-                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
-                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
-                       the database.)</label></p>
68
-                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
-
72
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
-                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
-                       to save all the settings to the database.)</label></p>
76
-                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
-
79
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" /><br><br>
88
-
89
-                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
-                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
-                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
-                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
-
94
-                   <table id="tnxKeysAccessTbl">
95
-
96
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
-                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
-                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
100
-                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
-
102
-                   </table><br>
103
-
104
-                   </div><br><br><br>
105
-
106
-                   <div class="providerSettings">
107
-                   <p class="providerName">Plivo Settings</p>
108
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
109
-                          and enter it in the field from below.):</label></p>
110
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
111
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
112
-
113
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
114
-                          enter it in the field from below.):</label></p>
115
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
116
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
117
-
118
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
119
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
120
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
121
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
122
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
123
-                       to the database.)</label></p>
124
-                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
125
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
126
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
127
-
128
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
129
-                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
130
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
131
-                       to save all the settings to the database.)</label></p>
132
-                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
133
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
134
-
135
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
136
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
137
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
138
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
139
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
140
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
141
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
142
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
143
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
144
-
145
-                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
146
-                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
147
-                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
148
-                          button at the bottom of that page):</b></label></p><br>
149
-
150
-                   <table id="plvKeysAccessTbl">
151
-
152
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
153
-                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
154
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
155
-                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
156
-                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
157
-
158
-                   </table><br>
159
-
160
-                   </div><br><br><br>
161
-
162
-                   <div class="providerSettings">
163
-                   <p class="providerName">Twilio Settings</p>
164
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
165
-                          and enter it in the field from below.):</label></p>
166
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
167
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
168
-
169
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
170
-                          and enter it in the field from below.):</label></p>
171
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
172
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
173
-
174
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
175
-                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
176
-                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
177
-                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
178
-                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
179
-                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
180
-                       credentials, to save all the settings to the database.)</label></p>
181
-                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
182
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
183
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
184
-
185
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
186
-                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
187
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
188
-                       to save all the settings to the database.)</label></p>
189
-                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
190
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
191
-
192
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
193
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
194
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
195
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
196
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
197
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
198
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
199
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
200
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
201
-
202
-                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
203
-                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
204
-                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
205
-                          'Save' button at the bottom of that page):</b></label></p><br>
206
-
207
-                   <table id="twlKeysAccessTbl">
208
-
209
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
210
-                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
211
-                          <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td>
212
-                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
213
-                          <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
214
-                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
215
-
216
-                   </table><br>
217
-
218
-                   </div><br><br><br>
219
-
220
-                   <div class="providerSettings">
221
-                   <p class="providerName">Flowroute Settings</p>
222
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
223
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
224
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
225
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
226
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
227
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
228
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
229
-
230
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
231
-                          below.):</label></p>
232
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
233
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
234
-
235
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
236
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
237
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
238
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
239
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
240
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
241
-                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
242
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
243
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
244
-
245
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
246
-                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
247
-                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
248
-                          to the database.)</label></p>
249
-                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
250
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
251
-                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
252
-
253
-                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
254
-                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
255
-                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
256
-                          bottom of that page):</b></label></p><br>
257
-
258
-                   <table id="flrKeysAccessTbl">
259
-
260
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
261
-                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
262
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td>
263
-                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
264
-                      <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
265
-                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
266
-
267
-                   </table><br>
268
-
269
-                   </div><br><br><br>
270
-
271
-
272
-                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list not only my messages but also the messages of all the Nextcloud users 
273
-                   with whom I share the access keys mentioned above:</b></label></p>
274
-                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
275
-
276
-                   <p><div class="setlabeltext"><b>Restrict access to the following phone numbers:</b><div class="tooltiprestrict">
277
-                        <div id="inforestrict">i</div><div class="restricttooltext">After you allow non-admin users to use your API keys for a provider, to send and
278
-                        receive messages, they will be able to see and use all the phone numbers associated with those API keys. However, if you restrict a shared phone number
279
-                        to a specific non-admin user, he will be able to see and use only that number.</div></div></p><br>
280
-
281
-                   <table id="phoneNmbrRestr">
282
-
283
-                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
284
-                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
285
-
286
-                   </table><br>
287
-
288
-                   <input type="hidden" id="user_id" name="user_id" />
289
-
290
-                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
291
-
292
-                   <span id="smsr_save_msg"></span>
293
-
294
-               </form>
295
-           </div>
296
-        </div>
297
-</div>
298
-
Browse code

added CHANGELOG.txt appinfo/info.xml appinfo/signature.json css/style.css js/settings.js lib/Service/SmsrelentlessService.php lib/Controller/AuthorApiController.php templates/settings/admin.php

DoubleBastionAdmin authored on 03/11/2023 19:56:13
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,298 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'adminsettings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+
33
+        <div class="section">
34
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
+               Flowroute, or all of them:')); ?></h3></p><br>
37
+           <div class="sms_followupsection">
38
+
39
+                <form id="admin_conf" action="#" >
40
+
41
+                   <div class="providerSettings">
42
+                   <p class="providerName">Telnyx Settings</p>
43
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
+                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
+                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
48
+
49
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
+                          below.):</label></p>
52
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
54
+
55
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
+                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
+                       Copy it and enter it in the field from below.):
58
+                   </label></p>
59
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
61
+
62
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
+                       the database.)</label></p>
68
+                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
+
72
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
+                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
+                       to save all the settings to the database.)</label></p>
76
+                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
+
79
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" /><br><br>
88
+
89
+                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
+                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
+                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
+                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
+
94
+                   <table id="tnxKeysAccessTbl">
95
+
96
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
+                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
+                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
100
+                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
+
102
+                   </table><br>
103
+
104
+                   </div><br><br><br>
105
+
106
+                   <div class="providerSettings">
107
+                   <p class="providerName">Plivo Settings</p>
108
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
109
+                          and enter it in the field from below.):</label></p>
110
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
111
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
112
+
113
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
114
+                          enter it in the field from below.):</label></p>
115
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
116
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
117
+
118
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
119
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
120
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
121
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
122
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
123
+                       to the database.)</label></p>
124
+                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
125
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
126
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
127
+
128
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
129
+                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
130
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
131
+                       to save all the settings to the database.)</label></p>
132
+                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
133
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
134
+
135
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
136
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
137
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
138
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
139
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
140
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
141
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
142
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
143
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
144
+
145
+                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
146
+                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
147
+                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
148
+                          button at the bottom of that page):</b></label></p><br>
149
+
150
+                   <table id="plvKeysAccessTbl">
151
+
152
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
153
+                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
154
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
155
+                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
156
+                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
157
+
158
+                   </table><br>
159
+
160
+                   </div><br><br><br>
161
+
162
+                   <div class="providerSettings">
163
+                   <p class="providerName">Twilio Settings</p>
164
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
165
+                          and enter it in the field from below.):</label></p>
166
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
167
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
168
+
169
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
170
+                          and enter it in the field from below.):</label></p>
171
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
172
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
173
+
174
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
175
+                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
176
+                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
177
+                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
178
+                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
179
+                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
180
+                       credentials, to save all the settings to the database.)</label></p>
181
+                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
182
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
183
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
184
+
185
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
186
+                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
187
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
188
+                       to save all the settings to the database.)</label></p>
189
+                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
190
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
191
+
192
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
193
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
194
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
195
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
196
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
197
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
198
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
199
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
200
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
201
+
202
+                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
203
+                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
204
+                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
205
+                          'Save' button at the bottom of that page):</b></label></p><br>
206
+
207
+                   <table id="twlKeysAccessTbl">
208
+
209
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
210
+                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
211
+                          <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td>
212
+                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
213
+                          <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
214
+                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
215
+
216
+                   </table><br>
217
+
218
+                   </div><br><br><br>
219
+
220
+                   <div class="providerSettings">
221
+                   <p class="providerName">Flowroute Settings</p>
222
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
223
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
224
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
225
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
226
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
227
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
228
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
229
+
230
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
231
+                          below.):</label></p>
232
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
233
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
234
+
235
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
236
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
237
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
238
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
239
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
240
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
241
+                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
242
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
243
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
244
+
245
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
246
+                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
247
+                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
248
+                          to the database.)</label></p>
249
+                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
250
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
251
+                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
252
+
253
+                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
254
+                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
255
+                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
256
+                          bottom of that page):</b></label></p><br>
257
+
258
+                   <table id="flrKeysAccessTbl">
259
+
260
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
261
+                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
262
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td>
263
+                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
264
+                      <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
265
+                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
266
+
267
+                   </table><br>
268
+
269
+                   </div><br><br><br>
270
+
271
+
272
+                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list not only my messages but also the messages of all the Nextcloud users 
273
+                   with whom I share the access keys mentioned above:</b></label></p>
274
+                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
275
+
276
+                   <p><div class="setlabeltext"><b>Restrict access to the following phone numbers:</b><div class="tooltiprestrict">
277
+                        <div id="inforestrict">i</div><div class="restricttooltext">After you allow non-admin users to use your API keys for a provider, to send and
278
+                        receive messages, they will be able to see and use all the phone numbers associated with those API keys. However, if you restrict a shared phone number
279
+                        to a specific non-admin user, he will be able to see and use only that number.</div></div></p><br>
280
+
281
+                   <table id="phoneNmbrRestr">
282
+
283
+                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
284
+                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
285
+
286
+                   </table><br>
287
+
288
+                   <input type="hidden" id="user_id" name="user_id" />
289
+
290
+                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
291
+
292
+                   <span id="smsr_save_msg"></span>
293
+
294
+               </form>
295
+           </div>
296
+        </div>
297
+</div>
298
+
Browse code

removed CHANGELOG.txt appinfo/info.xml appinfo/signature.json css/style.css js/settings.js lib/Service/SmsrelentlessService.php lib/Controller/AuthorApiController.php templates/settings/admin.php

DoubleBastionAdmin authored on 03/11/2023 19:51:29
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,295 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'adminsettings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-
33
-        <div class="section">
34
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
-               Flowroute, or all of them:')); ?></h3></p><br>
37
-           <div class="sms_followupsection">
38
-
39
-                <form id="admin_conf" action="#" >
40
-
41
-                   <div class="providerSettings">
42
-                   <p class="providerName">Telnyx Settings</p>
43
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
-                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
-                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
48
-
49
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
-                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
-                          below.):</label></p>
52
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
54
-
55
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
-                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
-                       Copy it and enter it in the field from below.):
58
-                   </label></p>
59
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
61
-
62
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
-                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
-                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
-                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
-                       the database.)</label></p>
68
-                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
-
72
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
-                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
-                       to save all the settings to the database.)</label></p>
76
-                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
-
79
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" /><br><br>
88
-
89
-                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
-                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
-                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
-                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
-
94
-                   <table id="tnxKeysAccessTbl">
95
-
96
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
-                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
-                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
100
-                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
-
102
-                   </table><br>
103
-
104
-                   </div><br><br><br>
105
-
106
-                   <div class="providerSettings">
107
-                   <p class="providerName">Plivo Settings</p>
108
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
109
-                          and enter it in the field from below.):</label></p>
110
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
111
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
112
-
113
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
114
-                          enter it in the field from below.):</label></p>
115
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
116
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
117
-
118
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
119
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
120
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
121
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
122
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
123
-                       to the database.)</label></p>
124
-                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
125
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
126
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
127
-
128
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
129
-                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
130
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
131
-                       to save all the settings to the database.)</label></p>
132
-                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
133
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
134
-
135
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
136
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
137
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
138
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
139
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
140
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
141
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
142
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
143
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
144
-
145
-                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
146
-                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
147
-                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
148
-                          button at the bottom of that page):</b></label></p><br>
149
-
150
-                   <table id="plvKeysAccessTbl">
151
-
152
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
153
-                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
154
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
155
-                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
156
-                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
157
-
158
-                   </table><br>
159
-
160
-                   </div><br><br><br>
161
-
162
-                   <div class="providerSettings">
163
-                   <p class="providerName">Twilio Settings</p>
164
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
165
-                          and enter it in the field from below.):</label></p>
166
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
167
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
168
-
169
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
170
-                          and enter it in the field from below.):</label></p>
171
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
172
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
173
-
174
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
175
-                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
176
-                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
177
-                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
178
-                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
179
-                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
180
-                       credentials, to save all the settings to the database.)</label></p>
181
-                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
182
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
183
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
184
-
185
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
186
-                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
187
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
188
-                       to save all the settings to the database.)</label></p>
189
-                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
190
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
191
-
192
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
193
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
194
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
195
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
196
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
197
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
198
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
199
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
200
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
201
-
202
-                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
203
-                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
204
-                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
205
-                          'Save' button at the bottom of that page):</b></label></p><br>
206
-
207
-                   <table id="twlKeysAccessTbl">
208
-
209
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
210
-                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
211
-                          <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td>
212
-                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
213
-                          <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
214
-                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
215
-
216
-                   </table><br>
217
-
218
-                   </div><br><br><br>
219
-
220
-                   <div class="providerSettings">
221
-                   <p class="providerName">Flowroute Settings</p>
222
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
223
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
224
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
225
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
226
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
227
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
228
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
229
-
230
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
231
-                          below.):</label></p>
232
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
233
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
234
-
235
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
236
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
237
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
238
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
239
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
240
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
241
-                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
242
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
243
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
244
-
245
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
246
-                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
247
-                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
248
-                          to the database.)</label></p>
249
-                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
250
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
251
-                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
252
-
253
-                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
254
-                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
255
-                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
256
-                          bottom of that page):</b></label></p><br>
257
-
258
-                   <table id="flrKeysAccessTbl">
259
-
260
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
261
-                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
262
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td>
263
-                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
264
-                      <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
265
-                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
266
-
267
-                   </table><br>
268
-
269
-                   </div><br><br><br>
270
-
271
-
272
-                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables list not only my messages but also the messages of all the Nextcloud users 
273
-                   with whom I share the access keys mentioned above:</b></label></p>
274
-                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
275
-
276
-                   <p><label for="restrNmbrAccess" class="setlabeltext"><b>Restrict access to the following phone numbers:</b></label></p><br>
277
-
278
-                   <table id="phoneNmbrRestr">
279
-
280
-                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
281
-                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
282
-
283
-                   </table><br>
284
-
285
-                   <input type="hidden" id="user_id" name="user_id" />
286
-
287
-                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
288
-
289
-                   <span id="smsr_save_msg"></span>
290
-
291
-               </form>
292
-           </div>
293
-        </div>
294
-</div>
295
-
Browse code

added CHANGELOG.txt README.md appinfo/info.xml appinfo/signature.json img/sms_relentless_screenshot.png css/style.css js/showsmstables.js js/settings.js templates/settings/admin.php templates/settings/personal.php templates/navigation/index.php

DoubleBastionAdmin authored on 30/10/2023 14:55:39
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,295 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'adminsettings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+
33
+        <div class="section">
34
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
+               Flowroute, or all of them:')); ?></h3></p><br>
37
+           <div class="sms_followupsection">
38
+
39
+                <form id="admin_conf" action="#" >
40
+
41
+                   <div class="providerSettings">
42
+                   <p class="providerName">Telnyx Settings</p>
43
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
+                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
+                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
48
+
49
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
+                          below.):</label></p>
52
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
54
+
55
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
+                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
+                       Copy it and enter it in the field from below.):
58
+                   </label></p>
59
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
61
+
62
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
+                       the database.)</label></p>
68
+                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
+
72
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
+                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
+                       to save all the settings to the database.)</label></p>
76
+                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
+
79
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" /><br><br>
88
+
89
+                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
+                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared 
91
+                          will have to access their app Settings page, generate the two webhook URLs for Telnyx by clicking the corresponding 'Generate new webhook URL ...' buttons, and
92
+                          then click the 'Save' button at the bottom of that page):</b></label></p><br>
93
+
94
+                   <table id="tnxKeysAccessTbl">
95
+
96
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
97
+                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
98
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
99
+                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
100
+                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
101
+
102
+                   </table><br>
103
+
104
+                   </div><br><br><br>
105
+
106
+                   <div class="providerSettings">
107
+                   <p class="providerName">Plivo Settings</p>
108
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
109
+                          and enter it in the field from below.):</label></p>
110
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
111
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
112
+
113
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
114
+                          enter it in the field from below.):</label></p>
115
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
116
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
117
+
118
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
119
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
120
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
121
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
122
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
123
+                       to the database.)</label></p>
124
+                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
125
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
126
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
127
+
128
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
129
+                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
130
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
131
+                       to save all the settings to the database.)</label></p>
132
+                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
133
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
134
+
135
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
136
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
137
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
138
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
139
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
140
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
141
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
142
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
143
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
144
+
145
+                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
146
+                          Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their 
147
+                          app Settings page, generate the two webhook URLs for Plivo by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' 
148
+                          button at the bottom of that page):</b></label></p><br>
149
+
150
+                   <table id="plvKeysAccessTbl">
151
+
152
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
153
+                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
154
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
155
+                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
156
+                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
157
+
158
+                   </table><br>
159
+
160
+                   </div><br><br><br>
161
+
162
+                   <div class="providerSettings">
163
+                   <p class="providerName">Twilio Settings</p>
164
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
165
+                          and enter it in the field from below.):</label></p>
166
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
167
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
168
+
169
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
170
+                          and enter it in the field from below.):</label></p>
171
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
172
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
173
+
174
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
175
+                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
176
+                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
177
+                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
178
+                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
179
+                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
180
+                       credentials, to save all the settings to the database.)</label></p>
181
+                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
182
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
183
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
184
+
185
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
186
+                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
187
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
188
+                       to save all the settings to the database.)</label></p>
189
+                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
190
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
191
+
192
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
193
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
194
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
195
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
196
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
197
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
198
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
199
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
200
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
201
+
202
+                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
203
+                          Auth Token and alphanumeric Sender ID mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access 
204
+                          their app Settings page, generate the two webhook URLs for Twilio by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 
205
+                          'Save' button at the bottom of that page):</b></label></p><br>
206
+
207
+                   <table id="twlKeysAccessTbl">
208
+
209
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
210
+                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
211
+                          <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td>
212
+                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
213
+                          <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
214
+                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
215
+
216
+                   </table><br>
217
+
218
+                   </div><br><br><br>
219
+
220
+                   <div class="providerSettings">
221
+                   <p class="providerName">Flowroute Settings</p>
222
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
223
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
224
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
225
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
226
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
227
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
228
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
229
+
230
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
231
+                          below.):</label></p>
232
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
233
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
234
+
235
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
236
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
237
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
238
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
239
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
240
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
241
+                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
242
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
243
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
244
+
245
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
246
+                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
247
+                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
248
+                          to the database.)</label></p>
249
+                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
250
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
251
+                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
252
+
253
+                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
254
+                          and Secret Key mentioned above (to be able to use them properly, the users with whom these credentials are shared will have to access their app Settings page, 
255
+                          generate the two webhook URLs for Flowroute by clicking the corresponding 'Generate new webhook URL ...' buttons, and then click the 'Save' button at the 
256
+                          bottom of that page):</b></label></p><br>
257
+
258
+                   <table id="flrKeysAccessTbl">
259
+
260
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
261
+                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
262
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td>
263
+                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
264
+                      <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
265
+                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
266
+
267
+                   </table><br>
268
+
269
+                   </div><br><br><br>
270
+
271
+
272
+                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables list not only my messages but also the messages of all the Nextcloud users 
273
+                   with whom I share the access keys mentioned above:</b></label></p>
274
+                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
275
+
276
+                   <p><label for="restrNmbrAccess" class="setlabeltext"><b>Restrict access to the following phone numbers:</b></label></p><br>
277
+
278
+                   <table id="phoneNmbrRestr">
279
+
280
+                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
281
+                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
282
+
283
+                   </table><br>
284
+
285
+                   <input type="hidden" id="user_id" name="user_id" />
286
+
287
+                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
288
+
289
+                   <span id="smsr_save_msg"></span>
290
+
291
+               </form>
292
+           </div>
293
+        </div>
294
+</div>
295
+
Browse code

removed CHANGELOG.txt README.md appinfo/info.xml appinfo/signature.json img/sms_relentless_screenshot.png css/style.css js/showsmstables.js js/settings.js templates/settings/admin.php templates/settings/personal.php templates/navigation/index.php

DoubleBastionAdmin authored on 30/10/2023 14:44:44
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,287 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'adminsettings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-
33
-        <div class="section">
34
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
-               Flowroute, or all of them:')); ?></h3></p><br>
37
-           <div class="sms_followupsection">
38
-
39
-                <form id="admin_conf" action="#" >
40
-
41
-                   <div class="providerSettings">
42
-                   <p class="providerName">Telnyx Settings</p>
43
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
-                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
-                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
48
-
49
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
-                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
-                          below.):</label></p>
52
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
54
-
55
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
-                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
-                       Copy it and enter it in the field from below.):
58
-                   </label></p>
59
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
61
-
62
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
-                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
-                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
-                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
-                       the database.)</label></p>
68
-                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
-
72
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
-                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
-                       to save all the settings to the database.)</label></p>
76
-                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
-
79
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" /><br><br>
88
-
89
-                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
-                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above:</b></label></p><br>
91
-
92
-                   <table id="tnxKeysAccessTbl">
93
-
94
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
95
-                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
96
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
97
-                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
98
-                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
99
-
100
-                   </table><br>
101
-
102
-                   </div><br><br><br>
103
-
104
-                   <div class="providerSettings">
105
-                   <p class="providerName">Plivo Settings</p>
106
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
107
-                          and enter it in the field from below.):</label></p>
108
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
109
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
110
-
111
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
112
-                          enter it in the field from below.):</label></p>
113
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
114
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
115
-
116
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
117
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
118
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
119
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
120
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
121
-                       to the database.)</label></p>
122
-                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
123
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
124
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
125
-
126
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
127
-                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
128
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
129
-                       to save all the settings to the database.)</label></p>
130
-                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
131
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
132
-
133
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
134
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
135
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
136
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
137
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
138
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
139
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
140
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
141
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
142
-
143
-                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
144
-                          Token and alphanumeric Sender ID mentioned above:</b></label></p><br>
145
-
146
-                   <table id="plvKeysAccessTbl">
147
-
148
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
149
-                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
150
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
151
-                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
152
-                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
153
-
154
-                   </table><br>
155
-
156
-                   </div><br><br><br>
157
-
158
-                   <div class="providerSettings">
159
-                   <p class="providerName">Twilio Settings</p>
160
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
161
-                          and enter it in the field from below.):</label></p>
162
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
163
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
164
-
165
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
166
-                          and enter it in the field from below.):</label></p>
167
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
168
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
169
-
170
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
171
-                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
172
-                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
173
-                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
174
-                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
175
-                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
176
-                       credentials, to save all the settings to the database.)</label></p>
177
-                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
178
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
179
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
180
-
181
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
182
-                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
183
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
184
-                       to save all the settings to the database.)</label></p>
185
-                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
186
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
187
-
188
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
189
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
190
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
191
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
192
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
193
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
194
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
195
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
196
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
197
-
198
-                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
199
-                          Auth Token and alphanumeric Sender ID mentioned above:</b></label></p><br>
200
-
201
-                   <table id="twlKeysAccessTbl">
202
-
203
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
204
-                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
205
-                          <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td>
206
-                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
207
-                          <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
208
-                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
209
-
210
-                   </table><br>
211
-
212
-                   </div><br><br><br>
213
-
214
-                   <div class="providerSettings">
215
-                   <p class="providerName">Flowroute Settings</p>
216
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
217
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
218
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
219
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
220
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
221
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
222
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
223
-
224
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
225
-                          below.):</label></p>
226
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
227
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
228
-
229
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
230
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
231
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
232
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
233
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
234
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
235
-                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
236
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
237
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
238
-
239
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
240
-                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
241
-                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
242
-                          to the database.)</label></p>
243
-                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
244
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
245
-                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
246
-
247
-                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
248
-                          and Secret Key mentioned above:</b></label></p><br>
249
-
250
-                   <table id="flrKeysAccessTbl">
251
-
252
-                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
253
-                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
254
-                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td>
255
-                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
256
-                      <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
257
-                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
258
-
259
-                   </table><br>
260
-
261
-                   </div><br><br><br>
262
-
263
-
264
-                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables list not only my messages but also the messages of all the Nextcloud users 
265
-                   with whom I share the access keys mentioned above:</b></label></p>
266
-                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
267
-
268
-                   <p><label for="restrNmbrAccess" class="setlabeltext"><b>Restrict access to the following phone numbers:</b></label></p><br>
269
-
270
-                   <table id="phoneNmbrRestr">
271
-
272
-                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
273
-                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
274
-
275
-                   </table><br>
276
-
277
-                   <input type="hidden" id="user_id" name="user_id" />
278
-
279
-                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
280
-
281
-                   <span id="smsr_save_msg"></span>
282
-
283
-               </form>
284
-           </div>
285
-        </div>
286
-</div>
287
-
Browse code

added files to implement pop-up windows, etc.

DoubleBastionAdmin authored on 20/05/2023 01:06:57
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,287 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'adminsettings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+
33
+        <div class="section">
34
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx, Plivo, Twilio or 
36
+               Flowroute, or all of them:')); ?></h3></p><br>
37
+           <div class="sms_followupsection">
38
+
39
+                <form id="admin_conf" action="#" >
40
+
41
+                   <div class="providerSettings">
42
+                   <p class="providerName">Telnyx Settings</p>
43
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper 
44
+                          right corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, 
45
+                          click the 'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
46
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
47
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
48
+
49
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
50
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
51
+                          below.):</label></p>
52
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
53
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
54
+
55
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable 
56
+                       Messaging' on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. 
57
+                       Copy it and enter it in the field from below.):
58
+                   </label></p>
59
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
60
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
61
+
62
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
63
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
64
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
65
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
66
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
67
+                       the database.)</label></p>
68
+                   <input type="button" id="generate_tel_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
69
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
70
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
71
+
72
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
73
+                       requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
74
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
75
+                       to save all the settings to the database.)</label></p>
76
+                   <input type="button" id="generate_tel_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
77
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
78
+
79
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
80
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
81
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
82
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
83
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
84
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
85
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
86
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
87
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" /><br><br>
88
+
89
+                   <p><label for="tnxKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Telnyx API Secret Key, 
90
+                          Public Key, messaging profile ID and alphanumeric Sender ID mentioned above:</b></label></p><br>
91
+
92
+                   <table id="tnxKeysAccessTbl">
93
+
94
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th></tr>
95
+                      <tr><td><div id="alwdakeyGrps-tnx" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-tnx" class="showAllGroupsak">
96
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-tnx" class="alwdKeysUsers"></div>
97
+                      </td><td><div id="showakeyUsrs-tnx" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
98
+                      <td><input type="submit" id="alwdrstsave-tnx" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
99
+
100
+                   </table><br>
101
+
102
+                   </div><br><br><br>
103
+
104
+                   <div class="providerSettings">
105
+                   <p class="providerName">Plivo Settings</p>
106
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
107
+                          and enter it in the field from below.):</label></p>
108
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
109
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
110
+
111
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
112
+                          enter it in the field from below.):</label></p>
113
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
114
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
115
+
116
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
117
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
118
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
119
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
120
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
121
+                       to the database.)</label></p>
122
+                   <input type="button" id="generate_nex_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
123
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
124
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
125
+
126
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
127
+                       requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
128
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
129
+                       to save all the settings to the database.)</label></p>
130
+                   <input type="button" id="generate_nex_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
131
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
132
+
133
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
134
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
135
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
136
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
137
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
138
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
139
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
140
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
141
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
142
+
143
+                   <p><label for="plvKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Plivo Auth ID, Auth 
144
+                          Token and alphanumeric Sender ID mentioned above:</b></label></p><br>
145
+
146
+                   <table id="plvKeysAccessTbl">
147
+
148
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
149
+                      <tr><td><div id="alwdakeyGrps-plv" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-plv" class="showAllGroupsak">
150
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td><div id="alwdakeyUsrs-plv" class="alwdKeysUsers"></div>
151
+                      </td><td><div id="showakeyUsrs-plv" class="showAllUsersak"><img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
152
+                      <td><input type="submit" id="alwdrstsave-plv" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
153
+
154
+                   </table><br>
155
+
156
+                   </div><br><br><br>
157
+
158
+                   <div class="providerSettings">
159
+                   <p class="providerName">Twilio Settings</p>
160
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
161
+                          and enter it in the field from below.):</label></p>
162
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
163
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
164
+
165
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
166
+                          and enter it in the field from below.):</label></p>
167
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
168
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
169
+
170
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
171
+                       Twilio account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button 
172
+                       from below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to 
173
+                       use for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just 
174
+                       generated and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple 
175
+                       SMS/MMS enabled phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the 
176
+                       credentials, to save all the settings to the database.)</label></p>
177
+                   <input type="button" id="generate_twil_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
178
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
179
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
180
+
181
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
182
+                       requests, so that Twilio will know where to send the delivery receipts. Just generate it by pressing the button from below.
183
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
184
+                       to save all the settings to the database.)</label></p>
185
+                   <input type="button" id="generate_twil_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
186
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
187
+
188
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
189
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
190
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
191
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
192
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
193
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
194
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
195
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
196
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" /><br><br>
197
+
198
+                   <p><label for="twlKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Twilio Account SID, 
199
+                          Auth Token and alphanumeric Sender ID mentioned above:</b></label></p><br>
200
+
201
+                   <table id="twlKeysAccessTbl">
202
+
203
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
204
+                      <tr><td><div id="alwdakeyGrps-twl" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-twl" class="showAllGroupsak">
205
+                          <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td>
206
+                          <td><div id="alwdakeyUsrs-twl" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-twl" class="showAllUsersak">
207
+                          <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
208
+                          <td><input type="submit" id="alwdrstsave-twl" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
209
+
210
+                   </table><br>
211
+
212
+                   </div><br><br><br>
213
+
214
+                   <div class="providerSettings">
215
+                   <p class="providerName">Flowroute Settings</p>
216
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
217
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
218
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
219
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
220
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
221
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
222
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
223
+
224
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
225
+                          below.):</label></p>
226
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
227
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
228
+
229
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
230
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
231
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
232
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
233
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
234
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
235
+                   <input type="button" id="generate_flow_rcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
236
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
237
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
238
+
239
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
240
+                          requests, so that Flowroute will know where to send the delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL 
241
+                          into your Flowroute account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
242
+                          to the database.)</label></p>
243
+                   <input type="button" id="generate_flow_delrcpt" class="generateUrl" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
244
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
245
+                   <span style='color:#272727'>Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.</span><br><br>
246
+
247
+                   <p><label for="flrKeysAccessTbl" class="setlabeltext"><b>Allow the following groups and non-admin users to send and receive messages using the Flowroute Access Key 
248
+                          and Secret Key mentioned above:</b></label></p><br>
249
+
250
+                   <table id="flrKeysAccessTbl">
251
+
252
+                      <tr><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th></th><th></tr>
253
+                      <tr><td><div id="alwdakeyGrps-flr" class="alwdKeysGroups"></div></td><td><div id="showakeyGrps-flr" class="showAllGroupsak">
254
+                      <img src="/apps/sms_relentless/img/group.svg" style="cursor:pointer" title="Show all groups"></div></td><td>
255
+                      <div id="alwdakeyUsrs-flr" class="alwdKeysUsers"></div></td><td><div id="showakeyUsrs-flr" class="showAllUsersak">
256
+                      <img src="/apps/sms_relentless/img/user.svg" style="cursor:pointer" title="Show all users"></div></td>
257
+                      <td><input type="submit" id="alwdrstsave-flr" class="savealwdKeys" value="Edit" title="Edit Row" /></td></tr>
258
+
259
+                   </table><br>
260
+
261
+                   </div><br><br><br>
262
+
263
+
264
+                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables list not only my messages but also the messages of all the Nextcloud users 
265
+                   with whom I share the access keys mentioned above:</b></label></p>
266
+                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
267
+
268
+                   <p><label for="restrNmbrAccess" class="setlabeltext"><b>Restrict access to the following phone numbers:</b></label></p><br>
269
+
270
+                   <table id="phoneNmbrRestr">
271
+
272
+                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th>
273
+                      <th style="max-width: 40px !important"></th><th></th><th></th></tr>
274
+
275
+                   </table><br>
276
+
277
+                   <input type="hidden" id="user_id" name="user_id" />
278
+
279
+                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
280
+
281
+                   <span id="smsr_save_msg"></span>
282
+
283
+               </form>
284
+           </div>
285
+        </div>
286
+</div>
287
+
Browse code

removed files to implement auto-reply fix, etc.

DoubleBastionAdmin authored on 20/05/2023 00:46:30
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,61 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'adminsettings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-
33
-        <div class="section">
34
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your options in the fields from below:')); ?></h3></p><br>
36
-           <div class="sms_followupsection">
37
-
38
-                <form id="admin_conf" action="#" >
39
-
40
-                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list all the sent/received messages of all the users, not only my messages:</b></label></p>
41
-                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
42
-
43
-                   <p><label for="restrNmbrAccess" class="setlabeltext"><b>Restrict access to the following phone numbers:</b></label></p><br>
44
-
45
-                   <table id="phoneNmbrRestr">
46
-
47
-                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th><th></th></tr>
48
-
49
-                   </table><br>
50
-
51
-                   <input type="hidden" id="user_id" name="user_id" />
52
-
53
-                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
54
-
55
-                   <span id="smsr_save_msg"></span>
56
-
57
-               </form>
58
-           </div>
59
-        </div>
60
-</div>
61
-
Browse code

added changes for origination, auto-reply, etc.

DoubleBastionAdmin authored on 08/05/2023 20:50:18
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,61 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'adminsettings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+
33
+        <div class="section">
34
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
35
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your options in the fields from below:')); ?></h3></p><br>
36
+           <div class="sms_followupsection">
37
+
38
+                <form id="admin_conf" action="#" >
39
+
40
+                   <p><label for="showallmessages" class="setlabeltext"><b>In my message tables, list all the sent/received messages of all the users, not only my messages:</b></label></p>
41
+                   <input type="checkbox" class="sms_rel_checkbox" id="showallmessages" name="showallmessages" autocomplete="false" /><br>
42
+
43
+                   <p><label for="restrNmbrAccess" class="setlabeltext"><b>Restrict access to the following phone numbers:</b></label></p><br>
44
+
45
+                   <table id="phoneNmbrRestr">
46
+
47
+                      <tr><th>Restriction Author</th><th id="phoneNumberTh">Phone Number</th><th>Groups Allowed</th><th style="max-width: 40px !important"></th><th>Users Allowed</th><th style="max-width: 40px !important"></th><th></th><th></th></tr>
48
+
49
+                   </table><br>
50
+
51
+                   <input type="hidden" id="user_id" name="user_id" />
52
+
53
+                   <input id="save_admin_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
54
+
55
+                   <span id="smsr_save_msg"></span>
56
+
57
+               </form>
58
+           </div>
59
+        </div>
60
+</div>
61
+