Browse code

added appinfo/info.xml appinfo/signature.json appinfo/routes.php CHANGELOG.txt lib/Controller/PaxfaxController.php js/settings.js js/sendfax.js

DoubleBastionAdmin authored on 10/03/2025 14:08:37
Showing 7 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,77 @@
1
+======= CHANGELOG =======
2
+
3
+Versions:
4
+
5
+== 1.0.0 - 2022-1-27 ==
6
+* Initial release.
7
+
8
+== 1.0.1 - 2022-3-31 ==
9
+* Changed presentation text.
10
+
11
+== 1.0.2 - 2022-4-11 ==
12
+* Respect custom 'datadirectory'.
13
+* Fixed received/sent faxes list not shown in the right hand pane when clicking the 'Received Faxes/Sent Faxes' button, while using Apache as a web server.
14
+* Fixed error when uploading pdf files, while using Apache as a web server.
15
+
16
+== 1.0.3 - 2022-4-14 ==
17
+* Changed the way the app gets the timezone.
18
+
19
+== 1.0.4 - 2022-4-29 ==
20
+* Specified how usernames containing an @ can be included in the callback URL, on the Settings page.
21
+* Adjusted pdf files paths, so that uploaded pdf files can be previewed when Nextcloud is served on a subdomain or on a subdirectory, by Nginx or by Apache. 
22
+
23
+== 1.0.5 - 2022-5-10 ==
24
+* Changed syntax of SQL queries and of encryption function.
25
+* Modified file paths to match changes in Nextcloud 24.
26
+* Text change on Settings page.
27
+
28
+== 1.0.6 - 2022-9-3 ==
29
+* Solved issue with viewing images picked from Nextcloud.
30
+* Small text changes on navigation pane.
31
+* Minor CSS modifications.
32
+
33
+== 1.0.7 - 2022-9-22 ==
34
+* Changed presentation text and text on Settings page.
35
+
36
+== 1.0.8 - 2022-10-27 ==
37
+* Changed CSS settings to match the modifications introduced in Nextcloud 25.
38
+
39
+== 1.0.9 - 2022-12-3 ==
40
+* Added support for dark themes.
41
+
42
+== 1.1.0 - 2023-3-22 ==
43
+* Fixed error when removing files in the 'temp_files' directory.
44
+* Renounced disabling the buttons 'Received Faxes', 'Sent Faxes', 'Failed Received Faxes' and 'Failed Sent Faxes' after successfull fax sending.
45
+
46
+== 1.1.1 - 2023-5-31 ==
47
+* Made app available for Nextcloud 26.
48
+
49
+== 1.1.2 - 2023-10-30 ==
50
+* Marked the app as compatible with Nextcloud 27.
51
+* Changed app presentation text.
52
+
53
+== 1.1.3 - 2023-11-2 ==
54
+* Changed how the app sends notifications for incoming faxes.
55
+
56
+== 1.1.4 - 2024-1-11 ==
57
+* Added the 'fonts' directory and stored the 'Open Sans' and 'Inter' fonts inside it.
58
+* Made small CSS changes.
59
+* Marked the app as compatible with Nextcloud 28.
60
+
61
+== 1.1.5 - 2024-1-12 ==
62
+* Fixed not being able to see the upper bar with the close button when viewing pdf files.
63
+* Added more screenshots to presentation page.
64
+
65
+== 1.1.6 - 2024-05-27 ==
66
+* Changed 'notnull' to false for 4 columns.
67
+* Made small text changes on the settings page.
68
+* Marked the app as compatible with Nextcloud 29.
69
+
70
+== 1.1.7 - 2024-10-10 ==
71
+* Fixed log warning related to path of notification icon.
72
+* Made small CSS changes.
73
+* Marked the app as compatible with Nextcloud 30.
74
+
75
+== 1.1.8 - 2025-03-10 ==
76
+* Modified how current user is obtained.
77
+* Verified compatibility with Nextcloud 31 and marked the app as compatible.
0 78
new file mode 100644
... ...
@@ -0,0 +1,83 @@
1
+<?xml version="1.0"?>
2
+<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
3
+      xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
4
+    <id>pax_fax</id>
5
+    <name>Pax Fax</name>
6
+    <summary>A fax sending application</summary>
7
+    <description><![CDATA[
8
+This application allows sending and receiving faxes in Nextcloud. A Phaxio account and a real fax number acquired from Phaxio are needed. 
9
+Complete instructions on how to configure and use this application are detailed in the 'Admin documentation' linked on this page.
10
+          
11
+### Features:
12
+
13
+* 🚀 Multiple documents can be sent in one fax call (up to 20 separate files with a cumulative size of up to 20 MB).
14
+
15
+* 📠 A fax can be sent to multiple fax numbers at once (up to 15 different fax numbers).
16
+
17
+* 📄 Users can send as fax any document in any of the following formats: pdf, doc, docx, odt, jpeg/jpg, png, tiff/tif, txt, html.
18
+
19
+* 📰 All incoming faxes are received as pdf documents and stored in a Nextcloud folder.
20
+
21
+* 📧 Users receive notifications and (optionally) emails when new faxes arrive.
22
+
23
+* 🔍 All the sent and received faxes are stored in specific Nextcloud folders, so that they can be searched by caller/callee phone number or date.
24
+
25
+* 💻 When they want to send a fax, users can upload files from their computer or choose them directly from Nextcloud.
26
+
27
+* 🔏 Incoming fax requests are checked for authenticity and integrity by verifying Phaxio's signature.
28
+
29
+* 💵 Current Phaxio balance can be always checked by pressing a button on the left panel.
30
+
31
+* 💰 The only ongoing cost is $2 per month for a fax number located in USA or Canada, in a city chosen by the user. No contracts.
32
+
33
+* 💸 Straightforward pricing: $0.07 per sent/received page for faxes to/from USA and Canada and $0.1 per sent/received page for faxes to/from other countries.
34
+
35
+We have no affiliation with Phaxio.
36
+
37
+### Documentation
38
+
39
+* [Admin documentation](https://www.doublebastion.com/install-nextcloud/#install-pax-fax)
40
+
41
+### Donations
42
+
43
+* 🎁 [Donate](https://www.doublebastion.com/donations/)
44
+
45
+    ]]></description>
46
+    <version>1.1.8</version>
47
+    <licence>AGPL</licence>
48
+    <author homepage="https://www.doublebastion.com">Double Bastion LLC</author>
49
+    <namespace>PaxFax</namespace>
50
+	<documentation>
51
+		<admin>https://www.doublebastion.com/install-nextcloud/#install-pax-fax</admin>
52
+	</documentation>
53
+    <category>office</category>
54
+    <category>organization</category>
55
+
56
+    <website>https://www.doublebastion.com/pax-fax/</website>
57
+    <bugs>https://git.doublebastion.com/pax-fax/issues/develop</bugs>
58
+    <repository>https://git.doublebastion.com/pax-fax/develop/</repository>
59
+
60
+    <screenshot>https://git.doublebastion.com/pax-fax/raw/develop/img/pax_fax_received_fax.png</screenshot>
61
+    <screenshot>https://git.doublebastion.com/pax-fax/raw/develop/img/pax_fax_send_uploaded_file_as_fax.png</screenshot>
62
+    <screenshot>https://git.doublebastion.com/pax-fax/raw/develop/img/pax_fax_files_from_pc_and_nextcloud.png</screenshot>
63
+    <screenshot>https://git.doublebastion.com/pax-fax/raw/develop/img/pax_fax_received_faxes.png</screenshot>
64
+    <screenshot>https://git.doublebastion.com/pax-fax/raw/develop/img/pax_fax_sent_faxes.png</screenshot>
65
+                
66
+    <dependencies>
67
+            <nextcloud min-version="26" max-version="31" />
68
+    </dependencies>
69
+
70
+    <navigations>
71
+        <navigation>
72
+            <name>Pax Fax</name>
73
+            <route>pax_fax.page.index</route>
74
+            <order>103</order>
75
+            <icon>pax_fax.svg</icon>
76
+        </navigation>
77
+    </navigations>
78
+
79
+    <settings>
80
+            <personal>OCA\PaxFax\Settings\Personal</personal>
81
+            <personal-section>OCA\PaxFax\Settings\PersonalSection</personal-section>
82
+    </settings>
83
+</info>
0 84
new file mode 100644
... ...
@@ -0,0 +1,44 @@
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
+return [
27
+  'routes' => [
28
+     // User views
29
+     ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
30
+     ['name' => 'author_api#receivefaxphaxio', 'url' => '/api/recfaxphaxio', 'verb' => 'POST'],
31
+     ['name' => 'paxfax#getbalance', 'url' => '/user/getbalance', 'verb' => 'POST'],
32
+     ['name' => 'paxfax#getfaxnumbers', 'url' => '/user/getfaxnumbers', 'verb' => 'POST'],
33
+     ['name' => 'paxfax#cleantempdir', 'url' => '/user/cleantempdir', 'verb' => 'POST'],
34
+     ['name' => 'paxfax#uploadfile', 'url' => '/user/uploadfile', 'verb' => 'POST'],
35
+     ['name' => 'paxfax#pickfile', 'url' => '/user/pickfile', 'verb' => 'POST'],
36
+     ['name' => 'paxfax#removeupfile', 'url' => '/user/removeupfile', 'verb' => 'POST'],
37
+     ['name' => 'paxfax#getpickedfile', 'url' => '/user/getpickedfile', 'verb' => 'POST'],
38
+     ['name' => 'paxfax#sendfax', 'url' => '/user/sendfax', 'verb' => 'POST'],
39
+     ['name' => 'paxfax#sendfaxpicked', 'url' => '/user/sendfaxpicked', 'verb' => 'POST'],
40
+     // Settings
41
+     ['name' => 'paxfax#getsettings', 'url' => '/user/getsettings', 'verb' => 'GET'],
42
+     ['name' => 'paxfax#updatesettings', 'url' => '/user/updatesettings', 'verb' => 'PUT']
43
+  ]
44
+];
0 45
\ No newline at end of file
1 46
new file mode 100644
... ...
@@ -0,0 +1,155 @@
1
+{
2
+    "hashes": {
3
+        "CHANGELOG.txt": "4b8e9fd128e578c4aaf2214ad16f64ab5dd7fad74e810a3b98e12262af38b3ff9312418fd00e5ebb9dad79a1ef6538edb1db52b201352df3c08c5f416466462e",
4
+        "COPYING.txt": "a0a86214ea153fb07ff35ceec0848dd1703eae22de036a825efc8394e50f65e3044832f3b49cf7e45a39edc470bdf738abc36a3a78ca7df3a6e73c14eaef94a8",
5
+        "Contributors.txt": "36bb17a05cb65b7ce8faf6b601396a2ff9b2e99b159a3eac35f21107f0457fbcee645b53c97aab653eac8433e59ad774b521aaf4f4dfdf8470817e51636d1535",
6
+        "Phaxio\/composer.json": "15a73bed2e5760f4c4dd1fd60abf746cbd245830ba502884261e9a0b6202844a8a37936e60a2761c6cd94a3054ebdf0c791fb866e191797a9f08227c125f5e4c",
7
+        "Phaxio\/composer.lock": "a6366b124ebbd604e11245e4e01f2f3a6d2bb63bccb861bf2e275f7be7d84d3380447cd9b84afd9dd5da0258cdaa01cdbde0f67ca27f2494d60b9304b092d2f9",
8
+        "Phaxio\/vendor\/autoload.php": "4eeb7a390556c23bed27d39fa0e9921347ccd07a8116f373f1d9ec45e6be608ba526392b6392722fd0aca67b14c8365f45773c50d983218df51f2b221d225761",
9
+        "Phaxio\/vendor\/composer\/ClassLoader.php": "2b6fa585122ace1ba816410acbd8372cb75329917aae6363dbad48e396cca581452616e1386a2e445a8fbb0e461b988279103f4f89adf704bce7726f761abf0e",
10
+        "Phaxio\/vendor\/composer\/InstalledVersions.php": "d7273807c70dea77e8708d58a8368ac9e1cd03a952f5cca0202d469a76d13ae84e17152a52b17768e16f54b18a84963959031c32485166a46b425bb4852b8a2a",
11
+        "Phaxio\/vendor\/composer\/LICENSE": "f3bb64009f41a425df5a9bbab53490f0eb9b74fa8d6aaa2f57efb928edc4ffff330260666edeaa04a91fed708c3663371cf01b284f3a08d6698aaef7a23f355a",
12
+        "Phaxio\/vendor\/composer\/autoload_classmap.php": "38cb0fcac43c6563d0320769be34f7020cecc2d172100930fb5f77043fafae1e1d7467bf681996316e41bb5e5d71a159a02f2b88fa5e067a1fa7883f1f734c79",
13
+        "Phaxio\/vendor\/composer\/autoload_namespaces.php": "e94d2ac452dac5c0a46d259cb9c142ce02d424db8ecd680e16eb604636cbe7b1cff5ce75406b8c99d762952343abfde8a29c3611994c77fb15ad3c9a4d3737f8",
14
+        "Phaxio\/vendor\/composer\/autoload_psr4.php": "1d78c03bc79c82476a9b806cba84ce9067f3dd1a2565f5616f6bcdb0c2eae4ccee33e7267f78a636c9e02904253c024cef43ec01d789918294586d2a1b4654fb",
15
+        "Phaxio\/vendor\/composer\/autoload_real.php": "8e0c72be16830e95bdac7c33043d1ad5144a294dbc28d078563274f379d81e957b2edc400382abd517adc74c0d295ecb606701e4240f55a7303686f424f5432c",
16
+        "Phaxio\/vendor\/composer\/autoload_static.php": "c1abaf9518c87901439bbdba91b10c144ab4fa5263fa35bafba3d56143febc7d045fb281f8fea746e82279c74fe4b22e323a6857cd9fc1ec688e70212546845a",
17
+        "Phaxio\/vendor\/composer\/installed.json": "4cb36f28c497f8d506b8570c0894262a37e98c4327737ed67a963b1ecfa561625a10bf7322e9b0fab7e2401182cc6864e529458ac5d421d8658610479c73cb5e",
18
+        "Phaxio\/vendor\/composer\/installed.php": "2dc2f106f98921818677d17f135455d02ad3946f06dbf85cbecbbef387adbc0d4ffaa53b0fa18697130c53977cccb5a745e69ba3e539fc2ace74997430283a7d",
19
+        "Phaxio\/vendor\/composer\/platform_check.php": "03262b35b0226cd690c4e88d4ac19edfa911b51cd3b49589f6a7d19100a566ee3848d5afedafc68f4dbdf0c1580e98be4bb929195e9e23906fc14d542dc921a1",
20
+        "Phaxio\/vendor\/phaxio\/phaxio\/CHANGELOG": "2eff47994cc1ef1ff374ab0e6d63c6504518b2731149c200ed7aa0aa5ea13fef070a7408741426c1c384a298061bc4c53c3dd91ef8eb6c5e4f62894aee1a3206",
21
+        "Phaxio\/vendor\/phaxio\/phaxio\/LICENSE": "a2a7604f0909b0e4b282508198c8e525d239a18995574b54569abd07ba784e872af3757b2a0802e1a8430fcbfe8260eee8f508f3821f29b0fe95ccc7e44874a2",
22
+        "Phaxio\/vendor\/phaxio\/phaxio\/composer.json": "37a15063347f6997ccebacc48942110158f8fd682ac5eb5c58465e3562a9cad346228dec018841d28be3d6afd282f5dce978a22d778f77b75dda05e1cf6a4213",
23
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/autoload.php": "fccd9008107c490da7808c70d27ea04f13ee3de4bde8291a69c3283ebf7b5efc0d0a440aaad0d68ebeadfe37241f924040c977dd0bc93a16b894638211bad1dd",
24
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/cancelFax.php": "590564fdaaef85e7b72b49c31ddc0a5cd9ae70a5c452f1ce4b08f56bec1e19ae9f8c826fe179dd0c68127f96333ddab1faa3d652879e35d27ac5e4b422586c07",
25
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/createPhaxCode.php": "8fd8fe39a97abc99afae8edc9363319bee3ef07841b91f0bc6f738d283a24b2e8e56f109ecd0b4d567e5da694abd4deae14008c1d247dd8690de7ad54e48238e",
26
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/deleteFax.php": "0f14c0147950102848ed065c3ca3f12bb56fad382a35e42f77f0acf67ed491050054bbc43f3ee49a96895d3081156ddbdc7640f3f7d9a0fc7848d13bf4921107",
27
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/downloadFaxDocument.php": "ee26536919405a2e5f4303c69cbaaa66d08eb946143f17dabc8636881b88cb08abdb56812d826424e756efa247dc1c6aeb585ad9f7bfaa21547d0827f4d2e934",
28
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/downloadFaxThumbnail.php": "b581ab76492911decadad4357e6d1cba800394dea1dd0be3ebe925b43b41efc0005ec66707f52ec8a21bcba46f9be0626ff8d08e2686da35e690ebd13302b4db",
29
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/files\/content.pdf": "515cdf6ba8271b7a17bd44e9458e28aa288cd9aee64db2daf721568d0eab1249d47243bfa6b2cf39563e848afa1f246453288682d16ddfd4a0a89c981424dbdc",
30
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/files\/coverPage.html": "8c14d034bd830269ab9df374f6bff8261b4641d121e4c5806c0e923f744e5b0eab82504924e474f04b9218b166edddb5ad1dc42524c64a018e21e9c968f8160a",
31
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/listFaxes.php": "4bd4e16ae654cd39df0f7b405537af034a48c4acee9107dec5fc7f5bb982c2b9cfd6ea030912f0190132664c80fad629bfebb1229d7650200d0ca096a5aabdfe",
32
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/phaxio_config.php.temp": "1efc886fce5ea24e9a650a35c497d45b8bae47bc035c6ce4f58aa2abd78ba46585c0401d8e4cc34614d3521b234d12d539536bc9bfe78a9e980f97f92ff898f9",
33
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/sendContentUrls.php": "f65f864142f8f856d504ddc89f37a570cb3f229563fdeb2a7a56d628c7f4d316c930cd0e4f944cea3c73c0349aba51340f9cf02a174fcdcb7dcf4823ecd4d3c7",
34
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/sendFiles.php": "ae986282c3c75b8e0162bbe95bd08100ce4ec10af67cd536b763e674d9c21a8168948a5f2b1fc3efeb9fd9d9daf46645ffbf179e1e3166ff0060c4ee39edd593",
35
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/sendFilesWithBatching.php": "5e4915fe1fb7fb1c916c776a962aff398ea8c0d3bb753fb0b6edd00ceea8374c8cdc6a528c1e36ee61368d072f8ef549c2ffc62ccff6057088b768d764fe5984",
36
+        "Phaxio\/vendor\/phaxio\/phaxio\/examples\/sendText.php": "914a594bdd09c08727c9f155945060212f6c03ecf920a9ffe3eeed9ed5ff35547e541a3bd18b242ef47ae356f2c1e55f74b8d790ca077950a07881ae926fa46e",
37
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio.php": "e13f967f4b54f99de59d91fe0dbcf8c653a388825fa1f84f76b391a839941586d38d215f63005fe4307a2a3658afaece45088c002de83f962bb1d936476e9b13",
38
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/AbstractResource.php": "48f68360a03312162d9aae7195345ba848216700f9a7d89f08d681d500d27af715af7d569aaab23b2426867519244d2cbec50fa3db7c8eee897bfd9e43aa30a8",
39
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/AbstractResourceCollection.php": "0365a3e8c6194b51633199d9123aa0789e2279f5b29455c1ae5feb0c01a7731d053ef5252d91f6aa62ac1a4726fa3b906ffffabf9e715f30f9aaa34780367aaa",
40
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/AbstractResources.php": "b22c82110e2f60cdf92c7546f1ec8e8039cb9f4b92298087290c9113698166e9ef7d25b9a2645809e0f2aceb3994e45f4c8904b1a2ca03cf00c05be8504df6bd",
41
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Account.php": "aea5b414544a9c3c7797146c15c4f419d732225de824113ece7a089f26bbc99426f11e980fa7214e4a3065b8efcd1e32ac1d29ea82ebb1eff445e9d27ff6aac0",
42
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Account\/Status.php": "678e00b88f00ce03ce1cdfacd7ff23608baa09f5298bdda06f834d73257b89ba60ced77df88c2604fcc828b5432f2bb7c13e0d5418674b76a5152a59138d8e35",
43
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Error.php": "db0e1a32af83054c31662c26b30bef0ce125d0269a3b762ee231af524df152698814fd479db55833f5a7e580a83f6e823130b4b4e81e6635cbcfca796c8154c1",
44
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Error\/APIConnectionException.php": "39411737aa1d7c4e8ac656908db977500fb3a5bc9a429e5367341525d010bb48c2785ec9eec0b7d84a244d21182cf0e0f635125a7aef96006a2222cb066ac353",
45
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Error\/AuthenticationException.php": "50dc9337d0e0339547d74d49fb608cb9434ec645b16a283f2feef6959de9ebcd0bd0134c113188c8ee4fb06e21a981ed4274670eb0adc51634b1de8c4f3be8ad",
46
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Error\/GeneralException.php": "d6d1d96f8ef2d89eff98814befa51b3f0f5a24a44611414c9bbeaf3046633f8a3b752d33b002738ddd5bbde167a1478f897a127e8ec90e710446ca53bf6a2af0",
47
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Error\/InvalidRequestException.php": "64988a6943b848b3f74614c27a16c109af76e4cca9df497ee7066b4ccac0719e2665460337b1e03dcc9ebc7d469f0f670c45b680bdf327c8a3ffaecf4e872846",
48
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Error\/NotFoundException.php": "cdbe663b94bd2fdef124570af93509a8080312b0ba13e8ac1664744d40a19c9701c35813da6b10f619c6ccd449ba863c012ef2613b24993e59ecb460dd901cf7",
49
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Error\/RateLimitException.php": "583aebaa33f59f697795034ea4053919e7203218a6984516ad8ffca8a5eb85a7804a30414b33595016b48ca6b83b1926f5b3eefb4bf8bca5fd88ecf173f0e0d1",
50
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Fax.php": "754cc2e5f039acfd3e6ee98311fb12519d83079bb8acfb21338a0ea175df1b53ae863a709c14e43ae1ef39eddc51bfcaaa577eb284d33da787e511c3abb56df0",
51
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Fax\/File.php": "650cf3c1e6aabd535c13c09de0525d73e695f813f0c267008b7722e7a594b5a25f2156bcf6d9fc0828dc0869fa250c138f55256d8aee6a10d83569f33228ed5e",
52
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/FaxCollection.php": "cd04652b9ff7b19af3d53436ca45cb82db41b611df18473b52cc6eb6f5051ad8db34fe751cec891ab315032f6dd109fff6c430baef95aba11cfae10fc073d2ce",
53
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/Faxes.php": "2e1c9c7c78e80fd6efbd49820002c423560bc2fc32d15799b70e26b754a9e659ef61aa707846724c999e1f98ac82366cf57ea49b0ea101a6d825b5bcc80ca278",
54
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/OperationResult.php": "3e85b6a921303cd1e03bc67a79203446e59f76714eed5b468ced130a33fe4e37d6198ef07059fc1f1b8784115ff2084d67e0c3a44b2d7c9433158873c67d7cd9",
55
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxCode.php": "3999628fee6f6f8488e49b8a03a587186a78c20f0ea1a07a5f60455de9dcc8fee644aab86b1942dfeef3b5510de3fa6c71bdf8ee4f2724ddd60309bc09e07fc6",
56
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxCodes.php": "b4d3e68f7c69646cc7e740496173504c8d5ba5956ca43e556c4da1b472500c2937f8ae81fdf8598a7c96899f8e9e9570236cf290547b3a604b0873495a39c4af",
57
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxioPublic.php": "9dcb4a790708f552289c28e12de86a5be8af96c1383e079ca626aaba2dc0ae0ac1930c2cc32547d328c69867476746caa7a0c1e9af4b162cee8ea98637720749",
58
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxioPublic\/AreaCode.php": "e40391514dc3ac86040436625c8cc977177269d878f97f1f7a26f441b75899fc0ac5f124e82563be63998b5009261287a709630bd5feb7f58d1ca0aff4e799c8",
59
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxioPublic\/AreaCodeCollection.php": "36ef6b3a17eaf0bbb45cafd7bc63a387b028c55759e9650c597ed9ad4d98a6788a5c4f2c59055dacaa7ba5cd958f1d8e0811b53962c3b9ad51e96b26ca85e418",
60
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxioPublic\/AreaCodes.php": "59b42f33330ad1856d9ecc01588abdcf34080e770f32134cbbf207144d10e1b65c1182df7e39c11f6ba9381fe845715eefd6891cbe29ffc06a8ce2e4e20a3987",
61
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxioPublic\/Countries.php": "c3214a5af911c09a2be6de5446c02c6b262082a0cfca057e9a135dbd29631f00a75bfea3bb9181bea1dbe45a7238afd05510275822857031726002ba7d9f2118",
62
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxioPublic\/Country.php": "df81c4fd6eaf3d3fd82b090e481cef2c19e34cf532c16753ec909b36c38ac2e87efda4133d8322a512cd0a31d53421fdd2009e6f04be0119a31a90c30c690db5",
63
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhaxioPublic\/CountryCollection.php": "5457c89d54da2c2f6ff8ae907e8c7e21e7fa8197e05c6209d7924e2ac02e422002c6d92e434b45cefe79630532d2c80f1ddd7f4508c0867db637288bc32833c6",
64
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhoneNumber.php": "e8d578db0d72ff22b472c2ecbd58f6b90c06a581392dcb0281b8116dfda57d7fe43d33a212b79d6185276b69ec6c3dadc231603eedb62ded7bd695177baa7b50",
65
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhoneNumberCollection.php": "17e29c72a0a23bf39ab4aca4e77836f78a1a9b570cbece8837e479e2039f8bbf433fe9137c7f9f39e0de930f8eea3eccaf202e6e60cda6ca8fab25e5738af264",
66
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/PhoneNumbers.php": "0a196164d5abb4598c5f3e4eaf092e999aa2e6d097fa4d93c284757ce5c616d949f07e5a6e9a93f632f838551c5979d6517802243014131f2a6bd20bd64c0246",
67
+        "Phaxio\/vendor\/phaxio\/phaxio\/lib\/Phaxio\/StringUpload.php": "a8e15f97d3562d17375989d34ee31569ae2b7a684632bf64f209e61cac7198ec91cc6668e7be51e1d3cf6110a66e881b20e47d6eac0dd2dc6ba8404f04cd0423",
68
+        "README.md": "74f886b5e9f438413f0f891cea6b6b31d1c14386e87662b644cbabe274dea36beeb134bb52026d56a291e3ecf978611750c8d1824e875bb7e584c51347b58025",
69
+        "appinfo\/info.xml": "8087d1bd38b6514715954186e2e0f0429a0e8f0bae18ecf5ed65a7d64023678bbeb67ba5798e7a10a29db7bb27857098705d2d6126f5111905460268e40472ed",
70
+        "appinfo\/routes.php": "25da6fbed6768ddb07795fa3ee90f5c8490c19cdae4293f93011020cc52f09097ef3fb8253116b517a262781121257a10548c439f1865750d4a19d958fcfc6dc",
71
+        "css\/style.css": "f20c41e6590454d61b445b0745aae6f1bb196e2c79172ec0578c3f47cfcc62a2b1af83c48a3b26eef314e7cea67fad199783ec1a379e4202d9ddfc038a92763c",
72
+        "fonts\/Apache_License_v2.0_Open_Sans.txt": "fdae7ed259455ca9fa45939e7f25cbb4de29831cda16d9151de25a5f6e9d9be43b053f4fd3b896026239fca77abce04f543d591c501ecf4ce18c854bc0a51660",
73
+        "fonts\/Inter-Bold.woff": "f34ed611dc0ba6e7c0bf7242bad7c02e09f208bfbdd21d6649ebf9b41bc06696d8856707851944786c80c718df455e619caab170c70bfe97ba2043d651d4532e",
74
+        "fonts\/Inter-Bold.woff2": "736b4aaf8a2de0c17fbd5396a338577227326f078ee0646072d851d328b58a8058989af8735ac073f935b05f291d9310797d95c963e5e3ff0ea61a87f21c9da5",
75
+        "fonts\/Inter-BoldItalic.woff": "619e398d37249fae96ba0deb06fcf5dab215ba888740024287e2c8f1278b33273124cd5b9ea8f7525a17657566b72a1661b688ca670bc068ca6ddf466b7e7ffe",
76
+        "fonts\/Inter-BoldItalic.woff2": "a24bdb558a9b26fbe7631d6cf90b8db8f5f0164c3c814a2971fb7d45e807b0856454893bbd0d5bd0d9f060689f2be5f5bb1b69e4bdea0293d1122e13ad28e96f",
77
+        "fonts\/Inter-ExtraBold.woff": "d527e43747abed5a13d49a70c8db7ef39aab35ab0accfe1e3f6e037f685e08d2e5f7552b40c75d4faecc0e7e1227e97c563af093afefb57f2b6be9c783a85b0e",
78
+        "fonts\/Inter-ExtraBold.woff2": "20a22b0255b2bdc8f30ca7d59f20b3e2dfcbeaa39f035ccbeff40b57ad77d616dee1c41eebe30e1fab53fbb7ab4cc9f842cd13539ef34a680f6dd43441a3f2f6",
79
+        "fonts\/Inter-ExtraBoldItalic.woff": "6fc1da8183d8b131d670ff5a89593967e4666436b37fcf08c4d99d8532654558f281bb8c20c92be8c5e3d6b34e05c7aad182f4c9a413f8bb1c11ef600b3c524b",
80
+        "fonts\/Inter-ExtraBoldItalic.woff2": "3a8c4a113a4308ac9a57e7ad75060e0f08a1dd8638c29c1190f86929363b755ed2de66e4c11d3164a0a1fb1e6e35865bf786a295d3e0ad561c4a94cc8cbec6db",
81
+        "fonts\/Inter-Italic.woff": "72defeb5040f6375683dba41d4ce43654fdbae4f64aea88b01feb023b3e894c278c8a8c7e5583b6d83d980495ca0d5afa5ec7e1bfcc731be08d3dbe1b8b3f348",
82
+        "fonts\/Inter-Italic.woff2": "b128da83c81fe4a28026dc0a2a75c7920f37d4e04d6d6bde4e60b3a9527dbff04ff0ebc8b300874db9bd90036a41a52f4c9d82eb2f78fb8e99a35bb04defa1c2",
83
+        "fonts\/Inter-Medium.woff": "1f7c25aeb1ed534a106254fdba6bf59dfa03542f813489dca31fe067e2a22ab9549babb48af4cd465ab3ef0ef2f4b0f46532efcc8aae8942ad2cf98d0a5a4a3f",
84
+        "fonts\/Inter-Medium.woff2": "ce94d1a0cea81d42546ebc0247403b02c6fae24d3afba618cf658436734557a8b2b8ebed54319a9f66b233bd224da3685f848470866de63a144c8c28070491d4",
85
+        "fonts\/Inter-MediumItalic.woff": "7b7bef9c7a7717c6d52d619059e5ec258b537f538ada38325c2c7bfa4968ff53109bc9ee17a57819ef37d0a145a973f4a7c8e4d8d09e71d3faa4d0fe14cbf487",
86
+        "fonts\/Inter-MediumItalic.woff2": "4a2c5dc8c2ece82489e63b16cd8b1536b8f5502cf8f93307b0c71c6d54594a28ec2a80b8e58dfbbcc1d38a51aa8dd6d6fa025aed2cdc1429a462745a2bf2d414",
87
+        "fonts\/Inter-Regular.woff": "e37409956d19653617af32af2f99f4038c815a3664f2dcb2fef5e6a1a7345c78aaac3badc2ae499b1423514076ad676ab4bd5d936ef9d159899a6f668d991e4c",
88
+        "fonts\/Inter-Regular.woff2": "731924aedf31d6ef8fcd57a3b74182331ec7ba743d64033d8912d350ba98fd5b1942decaa4268f4dc925be2ed711c71a77200b2497bec10cae499b452fb27138",
89
+        "fonts\/Inter-SemiBold.woff": "684602b1f45bf7a9ca5ea6b1aca2cc2046e07ac79eb63b920099463f25866f50cca77ca253f16078d3a6e781ca23b964a69c87389621fa101d5cfffdb292d132",
90
+        "fonts\/Inter-SemiBold.woff2": "12b7680eccc54f56f800ac3ea4eff0490f515911d0fc83f99f62fa0f72d848155c8a7186918301a372d0fd0238d8093109c7b9b3c05168058e3cb47b1f7216ae",
91
+        "fonts\/Inter-SemiBoldItalic.woff": "9623d9c91148b651b7d4a642751e4f9eaeda68b6f4c33355d0173e303252039b3bcd301556a1d8451ffbd36d7996c1e8fc5ca1276884636cf57468e38c9e442a",
92
+        "fonts\/Inter-SemiBoldItalic.woff2": "97b7d8ab268ebcbc00876bd69ca9cc7cf2ae9ba5a6a30c13e3412e41a88f1f5ed758a6d9abbab3a14359943a003b14307cbc379bb11505c014b002322fd53c6e",
93
+        "fonts\/SIL_Open_Font_License_v1.1_Inter.txt": "073e141d4e45a3adfd2cb569db6a4fd217b1721dd6aeab8159e36940b984df5ebdc345deb0eb6be65367f943e516a12dff41eb1238a322d248ca3478c50ef9b6",
94
+        "fonts\/opensans-bold.woff": "d094832745611e047ffa87fdb21bac41befabdb07aecade483d4dc5a5b97bad00f1d4a5dca2a615789cd494791f0ab4209be537eb4b1bc7cbee7c42eb5e201dc",
95
+        "fonts\/opensans-bold.woff2": "096abb618c9ce1a534f0198aeea53c6d1138000f98b883131ab49ee48b80b483af635f0196ac40a1c1bde679f63b3c3b907b8f9b0102a752862d623dd22393a5",
96
+        "fonts\/opensans-bolditalic.woff": "c80f105a10d37c812f5d1b29445cd21cbc95594f71d9c5fc1b3aeeb9985c5465ba017654f1453baefdc56cc27aa325b586d77323012073eb713ab8f88f08dab4",
97
+        "fonts\/opensans-bolditalic.woff2": "38b99ebf320264d74a456fe590fc610580b003bc77a39d97ff42dec41353a8f908d6f680b4777cdb34ed544d9b4ed20dce8c418317de1d721e25ab670f49fc1d",
98
+        "fonts\/opensans-extrabold.woff": "6636a395ba345853ada2237b8e1f81c52e54bfb65559cbcb8de143cac00232f20cf34c764c9c4d4b80e82dae79cba3064ebdf22999cce8839df2d5709ee64092",
99
+        "fonts\/opensans-extrabold.woff2": "758c90eb07c6db7e78cb703ea285f82b443ca2cfab792328a3f8c14acc1f932ae79ec2987b8b94bf19b3cc16fae31c76f3164c9437a2591283fb1592e40ec33d",
100
+        "fonts\/opensans-extrabolditalic.woff": "ab1966f1ab3bb436e489c2d6ee562cf22d05b6b8c9bbca17e903518311aa45659efc329255e08ab597e2b8effe3bda602a7fb56b7d0c1d872b69337537d49dff",
101
+        "fonts\/opensans-extrabolditalic.woff2": "2132d6309969f868521f2d788b991bc9bcf3239f1768db9a2b90faf8838c35efea85225b24db256f54c86d0a7915ecd50a7f5348e6ab040e0f172ba7510598cd",
102
+        "fonts\/opensans-italic.woff": "a9751e7ac7a3c3d9f739d1fe00730a545b68e4a6473beafee8edf583f175b34fd5e0b60a14ec3707c8691fdbebea17e191c51707f50a21281e76be46f55a1140",
103
+        "fonts\/opensans-italic.woff2": "7a80c01d34562e2fe248a71078ffa9413c04c9c320d27acb0bce96cc295101eb9e80a25e97dab3e67c184c40937862be820581441aa4100bd512a26ef2d523cf",
104
+        "fonts\/opensans-light.woff": "cca2c5d207e0935c1848e22965972cb6feea39aa93b1b546051cfabe5ab16e909934d007a7ccd174eda1e7671d838f477890dedcb93d68ba722eda39a16d0bb8",
105
+        "fonts\/opensans-light.woff2": "cdc332de1b13eb0f05cc9dd1ebc905fa5ce948eab71e2fdb1bc538ad54a0de980bf83352090becd650af9c101ec9a6898d2e4798e4fb777e41c20fae85fd568b",
106
+        "fonts\/opensans-lightitalic.woff": "26e7759869088d8abba380f0bb22bbb9fdf0a985c0999519390cbd85099e3f48864d866f4639a8ff1992e7c81c755b0bbf66f525d4d38a929067886e9b54eb88",
107
+        "fonts\/opensans-lightitalic.woff2": "b7f80b69abeca9d0369f5d46da192e98a6329cf1f948c897fb7130e0d815f73e293c37f0e6d0047273fe3f13a19e648d1bd06cfa2fac2142ec38ac244e7f0940",
108
+        "fonts\/opensans-regular.woff": "3a526ba177f8f16ad95941c185411f350fab7e5202b9f56ea9c5f972c62912781d66da10e278e065cc6748a4bc9ab9182d68b27eaf380131c602195148e4b8b4",
109
+        "fonts\/opensans-regular.woff2": "66b3e915b891f7b37b441ee18e40f01274fe19f2515470760e503f428fc1c524ccfbe832191978c2c5f6bc4b7ef46937e4f77f5457b6efbf878c97c054cb45f2",
110
+        "fonts\/opensans-semibold.woff": "173f703ab767d0fcff014dac2fa3dcac787ffd0eb39f0c532b6679935c0105daacfa6a32bca97de13e420e10194b701ad2487bfd35d28807563ebf0b16d0ca35",
111
+        "fonts\/opensans-semibold.woff2": "75068ba76befc2356fe83b198bf6da70e177e53cc3128af09d0d9f69dfe538013f2828b2363c6f533fcaca4d4b2a5ec5159b5eb6f288504ac73d33ac5d1d2c4d",
112
+        "fonts\/opensans-semibolditalic.woff": "9e1e965095991d4a12a0658fa22a116b043ce20fd5f73bb9655d870ae49c46170cec52827510be323332b535002eb96445f79c3d1e4dd0550ff622fda0465f1d",
113
+        "fonts\/opensans-semibolditalic.woff2": "d7e43f05802e26f4cb80ab6a492b01c398c5b41168c7f61356ca3ffc5f4fccabae5ba332956f0aecad69ccabb6b7526efbc0395552cc5d68e47bec00bc660ad7",
114
+        "img\/app-dark.svg": "1cd5df59a2886ada493eedba1ec62dcef815210416cdc1a6bb35aaa3fcaee59f5cd5a756e082557ba95eddd5abcba37236b5fc815cfffd9dea2843614071a673",
115
+        "img\/app.svg": "db540b202b0b9e49e0ed2453d99eb23b8eb37c293fcf52de280844e3d3c224ed067cc7bd80db755d851a78fca13fd2721e7bf16727f755de17442fd894b75791",
116
+        "img\/nextcloud_logo.svg": "4e0d3f0c371d668d83d443e5b1f69f0eedcc759092601d8fe8710dd97b16fd53aa3f9667bba7f305dc3aacfbc14e29b09b78da8b7bf6f41dcb83f5b16473991e",
117
+        "img\/nextcloud_logo_bright.svg": "aeab941556e29f9537508171583bb3309372866122c150c887c21d6a567c5aa06d2653db67c7151b064d4e2fa25f1fc63df21c786ede02ca5f40f12e5c1bad26",
118
+        "img\/pax_fax.svg": "db540b202b0b9e49e0ed2453d99eb23b8eb37c293fcf52de280844e3d3c224ed067cc7bd80db755d851a78fca13fd2721e7bf16727f755de17442fd894b75791",
119
+        "img\/pax_fax_choose_file_from_nextcloud.png": "92d30d5c20d0f03acd9430f4e2c1a3694e346941dc9ec1400fb8a2697b750ddc611d226a55c31d5d3001c1bce2199edfcd823cc2634bb6d050ad0ce4fadaf993",
120
+        "img\/pax_fax_dark.svg": "1cd5df59a2886ada493eedba1ec62dcef815210416cdc1a6bb35aaa3fcaee59f5cd5a756e082557ba95eddd5abcba37236b5fc815cfffd9dea2843614071a673",
121
+        "img\/pax_fax_files_from_pc_and_nextcloud.png": "610c382b47f8ca41898098642538c1ede712a0462442a0eb937110b81befe71833de0a4e74c7f6e798888b51a9b7718108b910c145b7d4bc8096145f835ac556",
122
+        "img\/pax_fax_grey.svg": "fc36143f41b406b237a36e98b5834320bfff94c992a5633508834a8f2db79f679e5b83573d727774f7db6ac5c2eb01fb09b3d42ff1c16fb891f75e9d8a890c17",
123
+        "img\/pax_fax_logo.png": "3c901669e9f2e76f7bb3f2479209f0ff51c24c940d1d5ec163a375464b696c61872bc482dd523560919179cc0af3825d254dd89506220317c9930030896790df",
124
+        "img\/pax_fax_received_fax.png": "42c31af0849badf3d5451ada2d9db869031a48df473a7f4a0c07c1a31bc6c46ad7952612145d4d6037955b015eb90fe8a4115f506fee5d69f3ec46a956333080",
125
+        "img\/pax_fax_received_faxes.png": "ae747393bbbce84696c45aad0d30eb50903dd455f4cb7ba128fd8c5f22aa8d099b2fcc32a2ce58d34ca8bafa5ddd3824e94df68464b36c3d4b6ce56fa85915fe",
126
+        "img\/pax_fax_send_uploaded_file_as_fax.png": "536cd0913447bd152049e9cc7793b0674353f2e8b9bd8ae2b5eb7080d24484c4a4aae48f8a8b1ac0a271ed7ff6da2fa19547259a7d5090dbb32febb873ca136c",
127
+        "img\/pax_fax_sent_faxes.png": "d2630afa4992268e9891c66805fb44b21a3c7fbe431f7cc4582ae28b0355821696e8e50304b0165b5208b05a0b7c460f8d2d572d98ec53c3bd99ba08feb17a4e",
128
+        "img\/refresh_logo.svg": "a95a19645bbde5e2146a3ec669950bc6029bfc6104886552eaeb4746733657ecbe4f9199e676ee2e9852ef0c5adb612d93e300e3fa9713fc611e1f8e7c1d5183",
129
+        "js\/sendfax.js": "98114a7d9d46eba30109fac744e2e5bf69247180873990f82f64200d15c7acb9619d6e135d29e7641979556180bec1bd6f3503a27317b18c0ea27a27a8a0f98d",
130
+        "js\/settings.js": "929a9f23bf4612e11256be3857cce9b439f1060941a131905fa91ba6a5751fbc2c27fe73cd4c5e42f0b61d366ebaa2fb9d4dc16145ba0621f1625e6ae83be27c",
131
+        "js\/tiff.min.js": "c35f67b587aab62db7a3de662779a7b3264d70f5f856142cae88eadd1b477e474977f2b8c5ab31c16be002cb7ca9b52282e6de533b6fd79a02e6d33815919cb4",
132
+        "js\/webodf.min.js": "655acab6a9773314aa741a7477121885c593bf3ecf2bc67adf8f870c81d0604ebf5fc558dc2a6072da0a70397c0d995ce15c5969b2190bcd2b687693772a3281",
133
+        "l10n\/en_GB.js": "b4a5ef2a7c46a64fb7ca5a05ce2944e0c7bdb8318e5dfa0012ad931d3748b8a51ece6f1c5663d03b512065c7476a954ca9d489750ef35d987ab2f63706dd528e",
134
+        "l10n\/en_GB.json": "ad8ae9314dac075320a520fd1cc14ff2cf4bfd4d081d3e87469b7125169453073863e4f770d8b497ebb5fa3af53825413423c4a33d40965eb8dca42bcae2f208",
135
+        "l10n\/en_US.js": "b4a5ef2a7c46a64fb7ca5a05ce2944e0c7bdb8318e5dfa0012ad931d3748b8a51ece6f1c5663d03b512065c7476a954ca9d489750ef35d987ab2f63706dd528e",
136
+        "l10n\/en_US.json": "ad8ae9314dac075320a520fd1cc14ff2cf4bfd4d081d3e87469b7125169453073863e4f770d8b497ebb5fa3af53825413423c4a33d40965eb8dca42bcae2f208",
137
+        "lib\/AppConfig.php": "c8acb61a0d2a4411a468578e4d10dbf1491c259fdfc6f40bfb29b5fae9b2d9dfb3564c72b9c679b5427f37dd51932d17ce6924c4e49daf58c390b6d2076c15b3",
138
+        "lib\/AppInfo\/Application.php": "8cc6ca32c87308f27d2fe6e1cdc48200750c50df595f13a942b406c1ac70583b367a4f594bc404a6c0cb50a75fccc29648d60303ac2a5273494406cab20a4966",
139
+        "lib\/Controller\/AuthorApiController.php": "2052cb1ae1615bfa29410e020047f79ba08d69d8d74f339e3b81e31e76133578f5ab15db5a27983b993fd213af0ea8efbfec8f0d06ef86acf99ef12f750de15b",
140
+        "lib\/Controller\/PageController.php": "c2abb6d62f7118e4c4ff73252c3ac4290e46e252a65248dae12c5a721a1aadeda189835d8efb9c8da7b22b3d8221e928a640bd93e4c5408a2db453517b78cb0d",
141
+        "lib\/Controller\/PaxfaxController.php": "5bd57bb7650acae2c61da8766bbc8555ff1fcf6c5fff9417709959736cbcbdd7c0eedc96e5cd5ee3e5379c48a67a99e93d09e7e02de9feb0ebf5bd8e5b002d5e",
142
+        "lib\/Migration\/Version100Date20211106170854.php": "d1f5538dc19c89a6b8a1521af701f0682be89f773ac63b7615b3d7af8fa183f03f176f1ba38d5c55c3912e23b815b2cf3d85078b0c4445af64380906f67e2601",
143
+        "lib\/Migration\/Version116Date20240527235146.php": "16810cf56cbbc0acdc7826d2d69fd7a0c589cc9c50802003ee1d55e0fa4ec302b6b60ea8a2b39f2173ffd6aa14d7f8c529c216caf9019abf6e03c6202ff2249a",
144
+        "lib\/Notification\/Notifier.php": "1654df78822651bd3b9e57fa95857e4f37ba80011a259dd9b3f25ab7913c168f4fe90ce3536f8904e051335c983c2951f89bf4e01549b8da0ce6800f952a7822",
145
+        "lib\/Service\/PaxfaxService.php": "ef0a256754d4e8fcbc3a89ce72fac231b63f3d15b137d1da886a2498078107daca8b060855d6b2d09836ef658c61a177476ff97558abe1d063426395aabe0e79",
146
+        "lib\/Settings\/Personal.php": "8242e941926433f948a32c6bad02faeba1d64374f4a7efbac64d1600177507ecd66b85df98194312d7f0062a34536e5f21293ac43b6402899146359ff7bb3d65",
147
+        "lib\/Settings\/PersonalSection.php": "f928a8b1df3bd8b482cab7a61cd32cb039ec6b8744f1902bc741c0ca85d0c3473d939df0a1fc91c2bead6b94546a10fa59136e491b142680814bd99ffb05d12b",
148
+        "templates\/content\/index.php": "7f88b793a60d7e3baeb18a22e8f6f6980fe981952871fb4efc1f9d56b4b2fcfc4ac5ef32e03ff227b0c6229cfcfa3a42a12d48c6871d5400a8b4fd68e3d18615",
149
+        "templates\/index.php": "ea041904c7847c95b9e75d60e0328b51a5eb55bd2c45352127d5490f8ee04af5af9b740cd8b71009841c53c1a1ac8de44be01f4744d7273b688d11fa5dd56498",
150
+        "templates\/navigation\/index.php": "73839c729e41c049ce1ab263e367d725bee62421c42716ee20ffca77f54690833aa90ca2633bf039829651e0736100ad440a5511c9b6aeff864a097c66cea135",
151
+        "templates\/settings.php": "6a000390093c9c93b4ae27df86a533f1cfe58089c3700d3efeb64ba1ec4b28017ca445ea8b802ce7f9e1ce1e3bfb4c00e3093cf07e1828b4fc7c0d0af24fedce"
152
+    },
153
+    "signature": "PwX6mIScmZh6nKIAD2ym1wpLpvHFrQ+TUcxBFgAPQqaJP7r\/JBLjP4NQXCwY\/s1QzcvUi7SbzVpRLeHgwBGKXGsxUIB7e6EfXlb2quPtGBFXvG7YEQV+AzmvG2X9x1luHDjmz3GLJtStQZLe4h9DnBvePEFxbz7HAO+WWD8\/a9QUBJlyA01cBohU53YuwieZkJApf0kALpO25Kvyez+68X9nqHHafNTwg7oGFDoDGGohynisyeBnBIrkmxXq1xbyuyNioiTKWymSXq1X3n8KrwR4msUgePlbV6cinnvCnDl503i5Slh6LQzyfApc5pFrfho\/1r8zPSMpyrxmqw6TZQYYEcb02kVKNW\/LAaYDtI+yBjEG5tntVf5+w5C4R5uPBmcsDmFn1+UbR2zkkjDdEk+14EtX6wuvfluBq02s23UTylP2qKb1\/7h3UvR486GiN4Biw5xXmDzxcBjHHSGVvaWR9Iq\/zQngxaiqEfyWeYLLw3PBF0Wo58E2meEJnBO83Hpn3\/FME5OSmH6vBXSqvfxncciaLgkbi9UcbAKP9K5jftFXbVrWUISg88wlYufkUu\/yY7PX65AdD6NuFL41vtfc42zvuH7+wxfYyAu7Naywzz04A7xtUiNIxSO3vTLopGAr6K\/YOeIPFRPwH9N\/S8eQbZ\/02n81jTN13mz9Ai8=",
154
+    "certificate": "-----BEGIN CERTIFICATE-----\r\nMIIEAjCCAuoCAhG6MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMjIwMjI1MTU0NTUwWhcNMzIwNjAyMTU0NTUwWjASMRAwDgYD\r\nVQQDDAdwYXhfZmF4MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsa4b\r\nARkaBatWm4JNKsst3BNjt1X4Clo0Vynelj+VfcMK9G2dB02HGZiQhBfi5cvLMDD4\r\nJEw9jPPf+pxxBY87gwloEQxRW4WmI3LLCPNVSF7GfvONwdjsoJebCPnH6AYHbUlG\r\nQ8\/6wlgCiCklMiCWW0pGFQaDis+4KIkmoFS4elRxOzb+oLCsJRHmLIcV1ZipRanE\r\nP5Y1u953glpjMChZEW6\/p4AEB4xi6b+GaQ+8cBZ5+7WvT54l5iKHY6Tl6fwOuBjl\r\nCc+8FC+hIKk7bTSXfbuwpgzZ7RNgH0BYD\/aryxK\/MHAqeGQKM\/pwvH9SN8LMLZVg\r\nXG+25FiBPuiST\/3l42sY1HD+Gh1KIw83zWD\/kVsU8tKIf0t0uS3ntwx3xjH0ojo9\r\n85Pu4XexopIPi4YxNFtphd\/+cJegbSLKa1LL2CqhnPSXHD8GYjZ16qdy6AxEyEki\r\nOQssSlTOsQ2RmvRqDPwqrbIZrVeiN3Mt4qEontOzci4ggjhBWqhjkcRId4XlGveu\r\nAbWP9O8aXzrElLLeSuDzl6uAcrtwgFvYjoxbRH66hcwv\/+RBOK58CI\/0ShGJZyVh\r\n\/9oDKwyYfHT1OTbRKlvm+TfV6Vmbuol0xFinUv4GoykBO67JJcERTSTGGDqMP2OL\r\n97lkR1b7sy9WKrWw1iljbwyzEEASKKleJtp8HC0CAwEAATANBgkqhkiG9w0BAQsF\r\nAAOCAQEAK+uuoq2F0N4nYdHpRRi5pP8hu540jEpHsLB8o\/3GT++Tdj9jeMdfDWos\r\nskB2e+Vi3OgiCWq51gQ9pq0YSQLZJzXBtX9Zd7gvnmIWJZqjbEkMsky+zMM2mweA\r\nl4+coZvXuqxNN6aY+oAKuf66ZWviUld1WEOz0+2vLrhs9qDCYFKDl7vXol6hz4gf\r\nX5d5crNAu1QboE8FEMxqfDrAMeJzL6SAG4UUaF9duB\/6xUm9d7vBKDCPMzZAV\/ob\r\n+8wxt7K4VoOuCo1KEpp\/+ZRrEr5ZbGGsNw41jrtfBsrMtbbIoRtyIh9Xfme2KzYM\r\ncm9HZiMNDokH8MlzOPOGwkP31w4FHQ==\r\n-----END CERTIFICATE-----"
155
+}
0 156
\ No newline at end of file
1 157
new file mode 100644
... ...
@@ -0,0 +1,812 @@
1
+/**
2
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
3
+ *
4
+ * @author Double Bastion LLC
5
+ *
6
+ * @license GNU AGPL version 3 or any later version
7
+ *
8
+ * This program is free software; you can redistribute it and/or
9
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
10
+ * License as published by the Free Software Foundation; either
11
+ * version 3 of the License, or any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
17
+ *
18
+ * You should have received a copy of the GNU Affero General Public
19
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+$(document).ready(function() {
24
+
25
+  var readtxtfile = [];
26
+  var readhtmlfile = [];
27
+  var readjpg = [];
28
+  var readpng = [];
29
+
30
+  // Adjust the path, so that the uploaded pdf files can be previewed while Nextcloud is served on a subdomain or on a subdirectory, by Nginx or by Apache
31
+  var locHref = window.location.href;
32
+  var pathSplit = locHref.split('/');
33
+  var firstPathEl = '';
34
+  if (pathSplit.length == 7) { firstPathEl = '/' + pathSplit[3]; }
35
+
36
+  // Check the available balance
37
+  $("#checkbalance").on("click", function(event) {
38
+
39
+     $('#checkbalance').addClass('icon-loading');
40
+
41
+     var getbalanceUrl = OC.generateUrl("/apps/pax_fax/user/getbalance");
42
+
43
+     $.ajax({
44
+          url: getbalanceUrl,
45
+          type: "POST",
46
+          cache: false,
47
+          processData: false,
48
+          contentType: false,
49
+          success: function(phaxiobalance) {
50
+                 var balanceindlrs = phaxiobalance / 100;
51
+                 var balanceproc = "$ " + balanceindlrs.toFixed(2);
52
+                 $('#currentbalance').text(balanceproc);
53
+
54
+                 $('#checkbalance').removeClass('icon-loading');
55
+          }
56
+     });
57
+  });
58
+
59
+  // Select the Caller ID
60
+  $("#selectcalleridbttn").on("click", function(event) {
61
+
62
+     $('#selectcalleridbttn').addClass('icon-loading');
63
+
64
+     var getfaxnumbersUrl = OC.generateUrl("/apps/pax_fax/user/getfaxnumbers");
65
+     var selectednmbr = null;
66
+
67
+     $.ajax({
68
+          url: getfaxnumbersUrl,
69
+          type: "POST",
70
+          cache: false,
71
+          processData: false,
72
+          contentType: false,
73
+          success: function(phaxionmbrs) {
74
+
75
+                    $('#currentfaxnmbrs').empty();
76
+                    $('#currentfaxnmbrs').append("<option value='' selected='selected' disabled class='optselectfxnb'>Choose an ID</option>");
77
+                    $('#currentfaxnmbrs').append("<option value='' class='optselectfxnb'>Blank Caller ID</option>");
78
+
79
+                    $.each(phaxionmbrs, function(key, indfxnmb) {
80
+                           $('#currentfaxnmbrs').append("<option value='"+indfxnmb+"' class='optselectfxnb'>"+indfxnmb+"</option>");
81
+                    });
82
+
83
+                    $('#selectcalleridbttn').removeClass('icon-loading');
84
+
85
+          }
86
+     });
87
+  });
88
+
89
+  // Clean the Pax_Fax/temp_files directory
90
+  var cleanflUrl = OC.generateUrl("/apps/pax_fax/user/cleantempdir");
91
+
92
+  $.ajax({
93
+          url: cleanflUrl,
94
+          type: "POST",
95
+          cache: false,
96
+          processData: false,
97
+          contentType: false
98
+  });
99
+
100
+  var n = 1;
101
+  var uploadedtofax = [];
102
+
103
+  // Upload files to be faxed
104
+  $("#uploadfileforfax").change(function(e){
105
+
106
+     OC.msg.startAction("#pf_upload_msg", t("pax_fax", "Uploading ..."));
107
+     $('#faxdocpreview').addClass('icon-loading');
108
+     $('#filestotsize').show();
109
+
110
+     var baseUrl = OC.generateUrl("/apps/pax_fax/user/uploadfile");
111
+
112
+     var formData = new FormData();
113
+     formData.append('uploadfileforfax', $('#uploadfileforfax')[0].files[0]);
114
+
115
+     var currentflsize = $('#uploadfileforfax')[0].files[0].size;
116
+
117
+     var fileup = $('#uploadfileforfax').val();
118
+     var fileuptrim = fileup.split('\\').pop();
119
+
120
+     if ($.inArray(fileuptrim, uploadedtofax) != -1) {
121
+         var duplicatescheck = 1;
122
+     } else var duplicatescheck = 0;
123
+
124
+     var extension = fileup.replace(/^.*\./, '');
125
+
126
+     if (extension == fileup) {
127
+         extension = "";
128
+     } else {
129
+         extension = extension.toLowerCase();
130
+     }
131
+
132
+     var validExtensions = ["pdf", "doc", "docx", "tif", "tiff", "jpg", "jpeg", "odt", "txt", "html", "png"];
133
+
134
+     if ($.inArray(extension, validExtensions) != -1) {
135
+
136
+       if (duplicatescheck == 0) {
137
+
138
+         if (currentflsize < 20971520) {
139
+
140
+            if (n < 21) {
141
+
142
+               uploadedtofax.push(fileuptrim);
143
+
144
+               $.ajax({
145
+                 url: baseUrl,
146
+                 type: "POST",
147
+                 data: formData,
148
+                 cache: false,
149
+                 processData: false,
150
+                 contentType: false,
151
+                 success: function(totalflsize) {
152
+
153
+                   $('#filessizetext').text(totalflsize);
154
+
155
+                   // Check if the total file size is over 20 MB
156
+                   var rectotfilesz = parseFloat(totalflsize.replace(" MB", ""));
157
+
158
+                   if (rectotfilesz > 20.00) {
159
+                       $('#filestotsize').css('color', '#ba3555');
160
+                       alert("Error ! You can't send files having a total size of more than 20 MB in one fax call ! Please consider removing files so that the total files size would drop to or below 20 MB");
161
+                       $('#submitfax').attr("disabled", true);
162
+                   } else {
163
+                       $('#submitfax').attr("disabled", false);
164
+                       $('#filestotsize').css('color', '#1eb16a');
165
+                     }
166
+
167
+
168
+                   $('#fileuploadednm').append("<div class='indgenflcls'><div id='"+n+"indfilediv' class='indivflcls'>" + n + ") " + fileuptrim + "</div><div class='indupfldl'>X</div></div>");
169
+                   n++;
170
+
171
+                   // Preview the file when you click on its name
172
+                   $("div:visible[id*='indfilediv']").each(function() {
173
+                        $(this).on("click", function(eventclck) {
174
+                           var faxfilenameinit = $(this).text();
175
+                           var faxfilenamesec = faxfilenameinit.substring(faxfilenameinit.indexOf(" ") + 1);
176
+                           var faxfilename = faxfilenamesec.replace("X","");
177
+                           var baseUrl = firstPathEl+"/remote.php/webdav/Pax_Fax/temp_files/"+faxfilename;
178
+                           var extenlst = faxfilename.replace(/^.*\./, '');
179
+
180
+                           if (extenlst == faxfilename) {
181
+                               extenlst = "";
182
+                           } else {
183
+                               extenlst = extenlst.toLowerCase();
184
+                           }
185
+
186
+                           if (extenlst == 'pdf') {
187
+                                  var viewerclick = OC.generateUrl('/apps/files_pdfviewer/?file={file}', {file: baseUrl});
188
+                                  var $iframe = $('<iframe id="docclickview" style="width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:1041;" src="' + viewerclick + '" sandbox="allow-scripts allow-same-origin allow-popups allow-modals"></iframe>');
189
+                                  $("#faxdocpreview").empty();
190
+                                  $("#faxdocpreview").append($iframe);
191
+                           } else if (extenlst == 'txt') {
192
+                                  $("#faxdocpreview").empty();
193
+                                  $("#faxdocpreview").append(readtxtfile[faxfilename]);
194
+                           } else if (extenlst == 'html') {
195
+                                  $("#faxdocpreview").empty();
196
+                                  $("#faxdocpreview").append(readhtmlfile[faxfilename]);
197
+                           } else if (extenlst == 'jpg' || extenlst == 'jpeg') {
198
+                                  $("#faxdocpreview").empty();
199
+                                  $("#faxdocpreview").append('<img style="width:100%;height:100%" id="uploadedjpg" src="#" />');
200
+                                  $("#uploadedjpg").attr('src', readjpg[faxfilename]);
201
+                           } else if (extenlst == 'png') {
202
+                                  $("#faxdocpreview").empty();
203
+                                  $("#faxdocpreview").append('<img style="width:100%;height:100%" id="uploadedpng" src="#" />');
204
+                                  $("#uploadedpng").attr('src', readpng[faxfilename]);
205
+                           } else if (extenlst == 'odt') {
206
+                                  $("#faxdocpreview").empty();
207
+                                  function odfInit() {
208
+                                     var odfelement = document.getElementById("faxdocpreview");
209
+                                     odfcanvas = new odf.OdfCanvas(odfelement);
210
+                                     odfcanvas.load(baseUrl);
211
+                                  }
212
+                                  window.setTimeout(odfInit, 0);
213
+                           } else if (extenlst == 'tif' || extenlst == 'tiff') {
214
+                                  var tiffile = '/remote.php/webdav/Pax_Fax/temp_files/'+faxfilename;
215
+                                  var xhr = new XMLHttpRequest();
216
+                                  xhr.responseType = 'arraybuffer';
217
+                                  xhr.open('GET', tiffile);
218
+                                  xhr.onload = function (evnt) {
219
+                                      var tiff = new Tiff({buffer: xhr.response});
220
+                                      var tifcanvas = tiff.toCanvas();
221
+                                      $("#faxdocpreview").empty();
222
+                                      $("#faxdocpreview").append(tifcanvas);
223
+                                  };
224
+                                  xhr.send();
225
+                           }
226
+
227
+                           $("#faxdocpreview").show();
228
+                           $("#faxfoldersview").hide();
229
+                        });
230
+                   });
231
+
232
+                   // Remove uploaded files
233
+                   $('[class*="indupfldl"]').last().click(function() {
234
+
235
+                           var baseUrl = OC.generateUrl("/apps/pax_fax/user/removeupfile");
236
+
237
+                           var removedfilenameinit = $(this).closest('[class*="indgenflcls"]').find('[class*="indivflcls"]').text();
238
+
239
+                           var removedfilesplit = removedfilenameinit.split(") ");
240
+                           var removedflnb = parseInt(removedfilesplit[0]);
241
+
242
+                           $(this).closest('[class*="indgenflcls"]').find('[class*="indivflcls"]').hide();
243
+                           $(this).hide();
244
+
245
+                           var removedfilename = removedfilenameinit.substring(removedfilenameinit.indexOf(" ") + 1);
246
+
247
+                           uploadedtofax = $.grep(uploadedtofax, function(value) {
248
+                                           return value != removedfilename;
249
+                           });
250
+
251
+                           $.ajax({
252
+                                   url: baseUrl,
253
+                                   type: "POST",
254
+                                   data: { removedfilename: removedfilename },
255
+                                   success: function(totalflsize) {
256
+
257
+                                      $('#filessizetext').text(totalflsize);
258
+
259
+                                      // Check file size
260
+                                      var rectotfilesz = parseFloat(totalflsize.replace(" MB", ""));
261
+
262
+                                      if (rectotfilesz > 20.00) {
263
+                                          $('#filestotsize').css('color', '#ba3555');
264
+                                             alert("Error ! You can't send files having a total size of more than 20 MB in one fax call ! Please consider removing files so that the total files size would drop to or below 20 MB");
265
+                                          $('#submitfax').attr("disabled", true);
266
+                                      } else {
267
+                                          $('#submitfax').attr("disabled", false);
268
+                                          $('#filestotsize').css('color', '#1eb16a');
269
+                                        }
270
+
271
+                                      // Rewrite order numbers for files that follow
272
+                                      --n;
273
+                                      $("div:visible[id*='indfilediv']").each(function() {
274
+
275
+                                          var getdivtext =  $(this).text();
276
+                                          var splitdivtext = getdivtext.split(") ");
277
+                                          var currentnbvalue = parseInt(splitdivtext[0]);
278
+                                          var newnbvalue = currentnbvalue - 1;
279
+
280
+                                          if (currentnbvalue > removedflnb) {
281
+                                              var replacedstr = newnbvalue + ") " + splitdivtext[1];
282
+                                              $(this).text(replacedstr);
283
+                                          }
284
+                                      });
285
+
286
+                                      $("div:visible[id*='indflpicked']").each(function() {
287
+
288
+                                          var getdivtext =  $(this).text();
289
+                                          var splitdivtext = getdivtext.split(") ");
290
+                                          var currentnbvalue = parseInt(splitdivtext[0]);
291
+                                          var newnbvalue = currentnbvalue - 1;
292
+
293
+                                          if (currentnbvalue > removedflnb) {
294
+                                              var replacedstr = newnbvalue + ") " + splitdivtext[1];
295
+                                              $(this).text(replacedstr);
296
+                                          }
297
+                                      });
298
+
299
+                                   },
300
+                                   error: function() {
301
+                                          alert('Error !');
302
+                                   }
303
+                           });
304
+
305
+                           $('#faxdocpreview').removeClass('icon-loading');
306
+                           $("#faxdocpreview").empty();
307
+                   });
308
+
309
+                   // Preview the uploaded file
310
+                   var faxfilename = e.target.files[0].name;
311
+                   var baseUrl = firstPathEl+"/remote.php/webdav/Pax_Fax/temp_files/"+faxfilename;
312
+
313
+                   if (extension == 'pdf') {
314
+                              var viewer = OC.generateUrl('/apps/files_pdfviewer/?file={file}', {file: baseUrl});
315
+                              var $iframe = $('<iframe id="docviewer" style="width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:1041;" src="' + viewer + '" sandbox="allow-scripts allow-same-origin allow-popups allow-modals"></iframe>');
316
+                              $("#faxdocpreview").empty();
317
+                              $("#faxdocpreview").append($iframe);
318
+                   } else if (extension == 'txt') {
319
+                              var reader = new FileReader();
320
+                              reader.readAsText(e.target.files[0]);
321
+                              reader.onload = function(e) {
322
+                                  readtxtfile[faxfilename] = e.target.result.replace(/(?:\r\n|\r|\n)/g, '<br>');
323
+                                  $("#faxdocpreview").empty();
324
+                                  $("#faxdocpreview").append(readtxtfile[faxfilename]);
325
+                              };
326
+                   } else if (extension == 'html') {
327
+                              var reader = new FileReader();
328
+                              reader.readAsText(e.target.files[0]);
329
+                              reader.onload = function(e) {
330
+                                  readhtmlfile[faxfilename] = e.target.result.replace(/(?:\r\n|\r|\n)/g, '<br>');
331
+                                  $("#faxdocpreview").empty();
332
+                                  $("#faxdocpreview").append(readhtmlfile[faxfilename]);
333
+                              };
334
+                   } else if (extension == 'jpg' || extension == 'jpeg') {
335
+                              $("#faxdocpreview").empty();
336
+                              $("#faxdocpreview").append('<img style="width:100%;height:100%" id="uploadedjpg" src="#" />');
337
+
338
+                              var reader = new FileReader();
339
+                              reader.onload = function (e) {
340
+                                  readjpg[faxfilename] = e.target.result;
341
+                                  $("#uploadedjpg").attr('src', readjpg[faxfilename]);
342
+                              }
343
+                              reader.readAsDataURL(e.target.files[0]);
344
+                   } else if (extension == 'png') {
345
+                              $("#faxdocpreview").empty();
346
+                              $("#faxdocpreview").append('<img style="width:100%;height:100%" id="uploadedpng" src="#" />');
347
+
348
+                              var reader = new FileReader();
349
+                              reader.onload = function (e) {
350
+                                  readpng[faxfilename] = e.target.result;
351
+                                  $("#uploadedpng").attr('src', readpng[faxfilename]);
352
+                              }
353
+                              reader.readAsDataURL(e.target.files[0]);
354
+                   } else if (extension == 'odt') {
355
+                              $("#faxdocpreview").empty();
356
+                              function odfInit() {
357
+                                 var odfelement = document.getElementById("faxdocpreview");
358
+                                 odfcanvas = new odf.OdfCanvas(odfelement);
359
+                                 odfcanvas.load(baseUrl);
360
+                              }
361
+                              window.setTimeout(odfInit, 0);
362
+                   } else if (extension == 'tif' || extension == 'tiff') {
363
+                              var tiffile = '/remote.php/webdav/Pax_Fax/temp_files/'+faxfilename;
364
+                              var xhr = new XMLHttpRequest();
365
+                              xhr.responseType = 'arraybuffer';
366
+                              xhr.open('GET', tiffile);
367
+                              xhr.onload = function (e) {
368
+                                  var tiff = new Tiff({buffer: xhr.response});
369
+                                  var tifcanvas = tiff.toCanvas();
370
+                                  $("#faxdocpreview").empty();
371
+                                  $("#faxdocpreview").append(tifcanvas);
372
+                              };
373
+                              xhr.send();
374
+                   }
375
+
376
+                   $("#faxdocpreview").show();
377
+                   $('#pf_upload_msg').hide();
378
+                   $('#faxdocpreview').removeClass('icon-loading');
379
+                   $("#faxfoldersview").hide();
380
+                 },
381
+                 error: function(data){
382
+                     alert('Error!');
383
+                 }
384
+               });
385
+
386
+            } else {
387
+                  alert("Error ! You can't send as fax more than 20 files in one fax call !");
388
+                  $('#pf_upload_msg').hide();
389
+                  $('#faxdocpreview').removeClass('icon-loading');
390
+              }
391
+         } else {
392
+              alert("Error ! You can't send files having a total size of more than 20 MB in one fax call !");
393
+              $('#pf_upload_msg').hide();
394
+              $('#faxdocpreview').removeClass('icon-loading');
395
+           }
396
+       } else {
397
+            alert("Error ! There is already a file named '"+fileuptrim+"' in the 'Pax_Fax/temp_files' folder !");
398
+            $('#pf_upload_msg').hide();
399
+            $('#faxdocpreview').removeClass('icon-loading');
400
+         }
401
+
402
+     } else {
403
+          alert('The file type is not supported ! Supported formats are: pdf, doc, docx, tiff/tif, jpeg/jpg, odt, txt, html, png.');
404
+          $('#pf_upload_msg').hide();
405
+          $('#faxdocpreview').removeClass('icon-loading');
406
+       }
407
+  });
408
+
409
+
410
+  // Pick file to fax, from Nextcloud
411
+  var faxfilename = null;
412
+
413
+  $("#choosefilen").on("click", function(evn) {
414
+
415
+                OC.dialogs.filepicker(
416
+                        t('settings', "Select a file to send as fax."),
417
+                        function (path) {
418
+
419
+                              OC.msg.startAction("#pf_choose_msg", t("pax_fax", "Please wait ..."));
420
+                              $('#faxdocpreview').addClass('icon-loading');
421
+                              $('#filestotsize').show();
422
+
423
+                              var baseUrl = OC.generateUrl("/apps/pax_fax/user/pickfile");
424
+
425
+                              faxfilename = path.split('/').pop();
426
+
427
+                              if ($.inArray(faxfilename, uploadedtofax) != -1) {
428
+                                  var duplicatescheck = 1;
429
+                              } else var duplicatescheck = 0;
430
+
431
+                              var extension = faxfilename.replace(/^.*\./, '');
432
+
433
+                              if (extension == faxfilename) {
434
+                                  extension = "";
435
+                              } else {
436
+                                  extension = extension.toLowerCase();
437
+                              }
438
+
439
+                              var validExtensions = ["pdf", "doc", "docx", "tif", "tiff", "jpg", "jpeg", "odt", "txt", "html", "png"];
440
+
441
+                              if ($.inArray(extension, validExtensions) != -1) {
442
+
443
+                                 if (duplicatescheck == 0) {
444
+
445
+                                    if (n < 21) {
446
+
447
+                                       uploadedtofax.push(faxfilename);
448
+
449
+                                       $.ajax({
450
+                                          url: baseUrl,
451
+                                          type: "POST",
452
+                                          data: { path: path },
453
+                                          success: function(totalflsize) {
454
+
455
+                                                $('#filessizetext').text(totalflsize);
456
+
457
+                                                // Check if the total file size is over 20 MB
458
+                                                var rectotfilesz = parseFloat(totalflsize.replace(" MB", ""));
459
+
460
+                                                if (rectotfilesz > 20.00) {
461
+                                                    $('#filestotsize').css('color', '#ba3555');
462
+                                                    alert("Error ! You can't send files having a total size of more than 20 MB in one fax call ! Please consider removing files so that the total files size would drop to or below 20 MB");
463
+                                                    $('#submitfax').attr("disabled", true);
464
+                                                } else {
465
+                                                    $('#submitfax').attr("disabled", false);
466
+                                                    $('#filestotsize').css('color', '#1eb16a');
467
+                                                }
468
+
469
+                                                $('#filespickednc').append("<div class='indgenpckfls'><div id='"+n+"indflpicked' class='indivflpckd'>" + n + ") " + faxfilename + "</div><div class='indpckfldl'>X</div></div>");
470
+                                                n++;
471
+
472
+                                                // Preview each file when you click on its name
473
+                                                $("div:visible[id*='indflpicked']").each(function() {
474
+                                                   $(this).on("click", function(event) {
475
+                                                      var faxfilenameinit = $(this).text();
476
+                                                      var faxfilenamesec = faxfilenameinit.substring(faxfilenameinit.indexOf(" ") + 1);
477
+                                                      var faxfilenamesp = faxfilenamesec.replace("X","");
478
+                                                      var baseUrl = firstPathEl+"/remote.php/webdav/Pax_Fax/temp_files/"+faxfilenamesp;
479
+                                                      var extenlst = faxfilenamesp.replace(/^.*\./, '');
480
+
481
+                                                      if (extenlst == faxfilenamesp) {
482
+                                                           extenlst = "";
483
+                                                      } else {
484
+                                                           extenlst = extenlst.toLowerCase();
485
+                                                      }
486
+
487
+                                                      if (extenlst == 'pdf') {
488
+                                                           var viewerclick = OC.generateUrl('/apps/files_pdfviewer/?file={file}', {file: baseUrl});
489
+                                                           var $iframe = $('<iframe id="docclickview" style="width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:1041;" src="' + viewerclick + '" sandbox="allow-scripts allow-same-origin allow-popups allow-modals"></iframe>');
490
+                                                           $("#faxdocpreview").empty();
491
+                                                           $("#faxdocpreview").append($iframe);
492
+                                                      } else if (extenlst == 'txt') {
493
+                                                              $("#faxdocpreview").empty();
494
+                                                              $("#faxdocpreview").append(readtxtfile[faxfilenamesp]);
495
+                                                      } else if (extenlst == 'html') {
496
+                                                              $("#faxdocpreview").empty();
497
+                                                              $("#faxdocpreview").append(readhtmlfile[faxfilenamesp]);
498
+                                                      } else if (extenlst == 'jpg' || extenlst == 'jpeg') {
499
+                                                              $("#faxdocpreview").empty();
500
+                                                              $("#faxdocpreview").append('<img style="width:auto;height:auto" id="uploadedjpg" src="'+ baseUrl +'" />');
501
+                                                      } else if (extenlst == 'png') {
502
+                                                              $("#faxdocpreview").empty();
503
+                                                              $("#faxdocpreview").append('<img style="width:auto;height:auto" id="uploadedpng" src="'+ baseUrl +'" />');
504
+                                                      } else if (extenlst == 'odt') {
505
+                                                              $("#faxdocpreview").empty();
506
+                                                              function odfInit() {
507
+                                                                 var odfelement = document.getElementById("faxdocpreview");
508
+                                                                 odfcanvas = new odf.OdfCanvas(odfelement);
509
+                                                                 odfcanvas.load(baseUrl);
510
+                                                              }
511
+                                                              window.setTimeout(odfInit, 0);
512
+                                                      } else if (extenlst == 'tif' || extenlst == 'tiff') {
513
+                                                              var tiffile = '/remote.php/webdav/Pax_Fax/temp_files/'+faxfilenamesp;
514
+                                                              var xhr = new XMLHttpRequest();
515
+                                                              xhr.responseType = 'arraybuffer';
516
+                                                              xhr.open('GET', tiffile);
517
+                                                              xhr.onload = function (evnt) {
518
+                                                                  var tiff = new Tiff({buffer: xhr.response});
519
+                                                                  var tifcanvas = tiff.toCanvas();
520
+                                                                  $("#faxdocpreview").empty();
521
+                                                                  $("#faxdocpreview").append(tifcanvas);
522
+                                                              };
523
+                                                              xhr.send();
524
+                                                      }
525
+
526
+                                                      $("#faxdocpreview").show();
527
+                                                      $("#faxfoldersview").hide();
528
+                                                   });
529
+                                                });
530
+
531
+                                                // Remove picked files
532
+                                                $('[class*="indpckfldl"]').last().click(function() {
533
+
534
+                                                    var baseUrl = OC.generateUrl("/apps/pax_fax/user/removeupfile");
535
+
536
+                                                    var removedfilenameinit = $(this).closest('[class*="indgenpckfls"]').find('[class*="indivflpckd"]').text();
537
+
538
+                                                    var removedfilesplit = removedfilenameinit.split(") ");
539
+                                                    var removedflnb = parseInt(removedfilesplit[0]);
540
+
541
+                                                    $(this).closest('[class*="indgenpckfls"]').find('[class*="indivflpckd"]').hide();
542
+                                                    $(this).hide();
543
+                                                    var removedfilename = removedfilenameinit.substring(removedfilenameinit.indexOf(" ") + 1);
544
+
545
+                                                    uploadedtofax = $.grep(uploadedtofax, function(value) {
546
+                                                             return value != removedfilename;
547
+                                                    });
548
+
549
+                                                    $.ajax({
550
+                                                        url: baseUrl,
551
+                                                        type: "POST",
552
+                                                        data: { removedfilename: removedfilename },
553
+                                                        success: function(totalflsize) {
554
+
555
+                                                             $('#filessizetext').text(totalflsize);
556
+
557
+                                                             // Check file size
558
+                                                             var rectotfilesz = parseFloat(totalflsize.replace(" MB", ""));
559
+
560
+                                                             if (rectotfilesz > 20.00) {
561
+                                                                 $('#filestotsize').css('color', '#ba3555');
562
+                                                                 alert("Error ! You can't send files having a total size of more than 20 MB in one fax call ! Please consider removing files so that the total files size would drop at or below 20 MB");
563
+                                                                 $('#submitfax').attr("disabled", true);
564
+                                                             } else {
565
+                                                                 $('#submitfax').attr("disabled", false);
566
+                                                                 $('#filestotsize').css('color', '#1eb16a');
567
+                                                               }
568
+
569
+                                                             // Rewrite order numbers for files that follow
570
+                                                             --n;
571
+                                                             $("div:visible[id*='indflpicked']").each(function() {
572
+
573
+                                                                  var getdivtext =  $(this).text();
574
+                                                                  var splitdivtext = getdivtext.split(") ");
575
+                                                                  var currentnbvalue = parseInt(splitdivtext[0]);
576
+                                                                  var newnbvalue = currentnbvalue - 1;
577
+
578
+                                                                  if (currentnbvalue > removedflnb) {
579
+                                                                      var replacedstr = newnbvalue + ") " + splitdivtext[1];
580
+                                                                      $(this).text(replacedstr);
581
+                                                                  }
582
+                                                             });
583
+                                                        },
584
+                                                        error: function() {
585
+                                                             alert('Error !');
586
+                                                        }
587
+                                                    });
588
+
589
+                                                    $('#faxdocpreview').removeClass('icon-loading');
590
+                                                    $("#faxdocpreview").empty();
591
+                                                });
592
+
593
+
594
+		                                // Preview the picked file
595
+		                                var flUrl = firstPathEl+"/remote.php/webdav/Pax_Fax/temp_files/"+faxfilename;
596
+		                                var pickUrl = OC.generateUrl("/apps/pax_fax/user/getpickedfile");
597
+
598
+		                                if (extension == 'pdf') {
599
+		                                    var viewer = OC.generateUrl('/apps/files_pdfviewer/?file={file}', {file: flUrl});
600
+		                                    var $iframe = $('<iframe id="docviewer" style="width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:1041;" src="' + viewer + '" sandbox="allow-scripts allow-same-origin allow-popups allow-modals"></iframe>');
601
+		                                    $("#faxdocpreview").empty();
602
+		                                    $("#faxdocpreview").append($iframe);
603
+		                                } else if (extension == 'txt') {
604
+						           $.get(flUrl, function(textdata) {
605
+		                                             readtxtfile[faxfilename] = textdata.replace(/(?:\r\n|\r|\n)/g, '<br>');
606
+		                                             $("#faxdocpreview").empty();
607
+		                                             $("#faxdocpreview").append(readtxtfile[faxfilename]);
608
+							   });
609
+		                                } else if (extension == 'html') {
610
+							   $.get(flUrl, function(htmldata) {
611
+		                                             readhtmlfile[faxfilename] = htmldata.replace(/(?:\r\n|\r|\n)/g, '<br>');
612
+		                                             $("#faxdocpreview").empty();
613
+		                                             $("#faxdocpreview").append(readhtmlfile[faxfilename]);
614
+							   });
615
+		                                } else if (extension == 'jpg' || extension == 'jpeg') {
616
+		                                           $("#faxdocpreview").empty();
617
+		                                           $("#faxdocpreview").append('<img style="width:auto;height:auto" id="uploadedjpg" src="'+ flUrl +'" />');
618
+		                                } else if (extension == 'png') {
619
+		                                           $("#faxdocpreview").empty();
620
+		                                           $("#faxdocpreview").append('<img style="width:auto;height:auto" id="uploadedpng" src="'+ flUrl +'" />');
621
+                                                           $("#uploadedpng").attr('src', readpng[faxfilename]);
622
+		                                } else if (extension == 'odt') {
623
+		                                       $("#faxdocpreview").empty();
624
+		                                       function odfInit() {
625
+		                                           var odfelement = document.getElementById("faxdocpreview");
626
+		                                           odfcanvas = new odf.OdfCanvas(odfelement);
627
+		                                           odfcanvas.load(flUrl);
628
+		                                       }
629
+		                                       window.setTimeout(odfInit, 0);
630
+
631
+		                                } else if (extension == 'tif' || extension == 'tiff') {
632
+		                                       var tiffile = '/remote.php/webdav/Pax_Fax/temp_files/'+faxfilename;
633
+		                                       var xhr = new XMLHttpRequest();
634
+		                                       xhr.responseType = 'arraybuffer';
635
+		                                       xhr.open('GET', tiffile);
636
+		                                       xhr.onload = function (event) {
637
+		                                           var tiff = new Tiff({buffer: xhr.response});
638
+		                                           var tifcanvas = tiff.toCanvas();
639
+		                                           $("#faxdocpreview").empty();
640
+		                                           $("#faxdocpreview").append(tifcanvas);
641
+		                                       };
642
+		                                       xhr.send();
643
+		                                }
644
+
645
+		                                $("#faxdocpreview").show();
646
+
647
+		                                $('#pf_choose_msg').hide();
648
+		                                $('#faxdocpreview').removeClass('icon-loading');
649
+		                                $("#faxfoldersview").hide();
650
+
651
+                                          },
652
+
653
+                                          error: function(data){
654
+                                             alert('Error!');
655
+                                          }
656
+
657
+                                       });
658
+
659
+                                    } else {
660
+                                        alert("Error ! You can't fax more than 20 files in one fax call !");
661
+                                        $('#pf_choose_msg').hide();
662
+                                        $('#faxdocpreview').removeClass('icon-loading');
663
+                                      }
664
+                                 } else {
665
+                                      alert("Error ! There is already a file named '"+faxfilename+"' in the 'Pax_Fax/temp_files' folder !");
666
+                                      $('#pf_choose_msg').hide();
667
+                                      $('#faxdocpreview').removeClass('icon-loading');
668
+                                   }
669
+
670
+                              } else {
671
+                                   alert('The file type is not supported ! Supported formats are: pdf, doc, docx, tiff/tif, jpeg/jpg, odt, txt, html, png.');
672
+                                   $('#pf_choose_msg').hide();
673
+                                   $('#faxdocpreview').removeClass('icon-loading');
674
+                                }
675
+
676
+                        }
677
+                );
678
+  });
679
+
680
+
681
+  // Submit the fax
682
+  $("#submitfax").on("click", function(event){
683
+
684
+     var selectedcid = $('#currentfaxnmbrs :selected').text();
685
+
686
+     var toNumberinit = $('#faxto').val();
687
+     var toNumbersec = toNumberinit.replace(/[^0-9,]/g, "");
688
+     var toNumber = toNumbersec.split(",");
689
+
690
+     for(var v = 0; v < toNumber.length; v++) {
691
+         toNumber[v] = "+" + toNumber[v];
692
+     }
693
+
694
+     OC.msg.startAction("#pf_submit_msg", t("pax_fax", "Sending fax ... Please wait !"));
695
+     $('#faxdocpreview').addClass('icon-loading');
696
+
697
+     $('#submitfax').attr("disabled", true);
698
+
699
+     var baseUrl = OC.generateUrl("/apps/pax_fax/user/sendfax");
700
+
701
+     var toNumberwc = toNumberinit.replace(/[^0-9]/g, "");
702
+
703
+     if (uploadedtofax.length != 0) {
704
+
705
+         if (toNumberwc != '') {
706
+
707
+             $.ajax({
708
+                url: baseUrl,
709
+                type: "POST",
710
+                data: {
711
+                       uploadedtofax: uploadedtofax,
712
+                       selectedcid: selectedcid,
713
+                       toNumber: toNumber
714
+                      },
715
+                success: function(phaxioresult) {
716
+
717
+                   if (phaxioresult.success == true) {
718
+                       alert("The fax has been sent successfully ! You can see the sent fax by clicking on the 'Sent Faxes' button.");
719
+                   } else {
720
+                       alert("Error ! The fax couldn't be sent because of the following error: "+ phaxioresult.errortype +" You can see the failed fax by clicking on the 'Failed Sent Faxes' button.");
721
+                   }
722
+
723
+                   $("div:visible[id*='indfilediv']").hide();
724
+                   $("div:visible[id*='indflpicked']").hide();
725
+                   $('[class*="indupfldl"]').hide();
726
+                   $('[class*="indpckfldl"]').hide();
727
+                   $('#faxdocpreview').hide();
728
+                   $('#filestotsize').hide();
729
+                   $('#pf_submit_msg').hide();
730
+                },
731
+                error: function(phaxioresult) {
732
+
733
+                   alert('Error ! Please check your settings !');
734
+
735
+                   $("div:visible[id*='indfilediv']").hide();
736
+                   $("div:visible[id*='indflpicked']").hide();
737
+                   $('[class*="indupfldl"]').hide();
738
+                   $('[class*="indpckfldl"]').hide();
739
+                   $('#pf_submit_msg').hide();
740
+                   $('#filestotsize').hide();
741
+                   $('#faxdocpreview').hide();
742
+
743
+                   location.reload(true);
744
+                }
745
+             });
746
+
747
+         } else {
748
+              $('#pf_submit_msg').hide();
749
+              $('#faxdocpreview').removeClass('icon-loading');
750
+              alert("Please enter the fax number of the recipient !");
751
+         }
752
+
753
+     } else {
754
+              $('#pf_submit_msg').hide();
755
+              $('#faxdocpreview').removeClass('icon-loading');
756
+              alert("Please upload a file or pick a file from Nextcloud to send as fax !");
757
+     }
758
+  });
759
+
760
+  $("#receivedfaxdir").on("click", function(event){
761
+     $("#faxdocpreview").hide();
762
+     $("#faxfoldersview").show();
763
+     $("#faxfoldersview").addClass("icon-loading");
764
+     $("#faxfoldersview :last-child").remove();
765
+     var fxreceived = OC.generateUrl("/apps/files/?dir=/Pax_Fax/faxes_received");
766
+     $("#faxfoldersview").append("<iframe id='embeddedView' src='" + fxreceived + "' width='100%' height='100%'></iframe>");
767
+     $("#app-content").scrollTop(50);
768
+     setTimeout(function() { $("#faxfoldersview").removeClass("icon-loading"); }, 1000);
769
+  });
770
+
771
+  $("#sentfaxdir").on("click", function(event){
772
+     $("#faxdocpreview").hide();
773
+     $("#faxfoldersview").show();
774
+     $("#faxfoldersview").addClass("icon-loading");
775
+     $("#faxfoldersview :last-child").remove();
776
+     var fxsent = OC.generateUrl("/apps/files/?dir=/Pax_Fax/faxes_sent");
777
+     $("#faxfoldersview").append("<iframe id='embeddedView' src='" + fxsent + "' width='100%' height='100%'></iframe>");
778
+     $("#app-content").scrollTop(50);
779
+     setTimeout(function() { $("#faxfoldersview").removeClass("icon-loading"); }, 1000);
780
+  });
781
+
782
+  $("#receivedfaileddir").on("click", function(event){
783
+     $("#faxdocpreview").hide();
784
+     $("#faxfoldersview").show();
785
+     $("#faxfoldersview").addClass("icon-loading");
786
+     $("#faxfoldersview :last-child").remove();
787
+     var fxrecfailed = OC.generateUrl("/apps/files/?dir=/Pax_Fax/faxes_received_failed");
788
+     $("#faxfoldersview").append("<iframe id='embeddedView' src='" + fxrecfailed + "' width='100%' height='100%'></iframe>");
789
+     $("#app-content").scrollTop(50);
790
+     setTimeout(function() { $("#faxfoldersview").removeClass("icon-loading"); }, 1000);
791
+  });
792
+
793
+  $("#sentfaileddir").on("click", function(event){
794
+     $("#faxdocpreview").hide();
795
+     $("#faxfoldersview").show();
796
+     $("#faxfoldersview").addClass("icon-loading");
797
+     $("#faxfoldersview :last-child").remove();
798
+     var fxsentfailed = OC.generateUrl("/apps/files/?dir=/Pax_Fax/faxes_received_failed");
799
+     $("#faxfoldersview").append("<iframe id='embeddedView' src='" + fxsentfailed + "' width='100%' height='100%'></iframe>");
800
+     $("#app-content").scrollTop(50);
801
+     setTimeout(function() { $("#faxfoldersview").removeClass("icon-loading"); }, 1000);
802
+  });
803
+
804
+  $(".indivflpckd").on("click", function(event){
805
+     $("#faxfoldersview").hide();
806
+  });
807
+
808
+  $(".indivflcls").on("click", function(event){
809
+     $("#faxfoldersview").hide();
810
+  });
811
+
812
+});
0 813
new file mode 100644
... ...
@@ -0,0 +1,93 @@
1
+/**
2
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
3
+ *
4
+ * @author Double Bastion LLC
5
+ *
6
+ * @license GNU AGPL version 3 or any later version
7
+ *
8
+ * This program is free software; you can redistribute it and/or
9
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
10
+ * License as published by the Free Software Foundation; either
11
+ * version 3 of the License, or any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
17
+ *
18
+ * You should have received a copy of the GNU Affero General Public
19
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+$(document).ready(function() {
24
+
25
+  $("#save_fax_settings").on("click", function(event) {
26
+
27
+    event.preventDefault();
28
+    OC.msg.startAction("#paxfax_save_msg", t("pax_fax", "Saved"));
29
+
30
+    var baseUrl = OC.generateUrl("/apps/pax_fax/user/updatesettings");
31
+    var getnotify = 0;
32
+
33
+    if ($("#get_notification").is(':checked')) {
34
+        getnotify = 1;
35
+    }
36
+
37
+    var emailaddressinit = $("#notification_email").val();
38
+
39
+    function validate_email($email) {
40
+        var email_reg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
41
+        return email_reg.test($email);
42
+    }
43
+
44
+    if (validate_email(emailaddressinit)) {
45
+         var notifyemail = emailaddressinit;
46
+    } else {
47
+         var notifyemail = '';
48
+    }
49
+
50
+    var datatosave = {
51
+                      apiKey: $("#api_key").val(),
52
+                      apiSecret: $("#api_secret").val(),
53
+                      webhookToken: $("#webhook_token").val(),
54
+                      receiveUrl: $("#receive_url").val(),
55
+                      getNotification: getnotify,
56
+                      notificationEmail: notifyemail
57
+    };
58
+
59
+    $.ajax({
60
+       method: 'PUT',
61
+       url: baseUrl,
62
+       contentType: 'application/json',
63
+       data: JSON.stringify(datatosave),
64
+       error: function(resp){
65
+                  alert('Error ! Please check your settings !');
66
+       }
67
+    });
68
+
69
+  });
70
+
71
+  var baseUrlget = OC.generateUrl("/apps/pax_fax/user/getsettings");
72
+
73
+  $.ajax({
74
+       method: 'GET',
75
+       url: baseUrlget,
76
+       contentType: 'application/json',
77
+       success: function(settingsfromdb) {
78
+          $("#api_key").val(settingsfromdb.api_key);
79
+          $("#api_secret").val(settingsfromdb.api_secret);
80
+          $("#webhook_token").val(settingsfromdb.webhook_token);
81
+          $("#receive_url").val(settingsfromdb.receive_url);
82
+          $("#notification_email").val(settingsfromdb.notification_email);
83
+
84
+          if (settingsfromdb.get_notification == 1) {
85
+              $("#get_notification").attr('checked', true);
86
+          } else {
87
+              $("#get_notification").attr('checked', false);
88
+          }
89
+       }
90
+  });
91
+
92
+});
93
+
0 94
new file mode 100644
... ...
@@ -0,0 +1,609 @@
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
+namespace OCA\PaxFax\Controller;
27
+
28
+use OCP\IRequest;
29
+use OCP\AppFramework\Controller;
30
+use OCA\PaxFax\Service\PaxfaxService;
31
+use OCP\AppFramework\App;
32
+use OCP\Files\NotPermittedException;
33
+use OCP\Files\Folder;
34
+use OCP\IConfig;
35
+use OC\Files\Filesystem;
36
+use OC\Files\View;
37
+use OCP\IUserSession;
38
+use OC\URLGenerator;
39
+use \ReflectionClass;
40
+use \FilesystemIterator;
41
+
42
+use Phaxio;
43
+use Phaxio\OperationResult;
44
+use Phaxio\Error\AuthenticationException;
45
+use Phaxio\Error\NotFoundException;
46
+use Phaxio\Error\InvalidRequestException;
47
+use Phaxio\Error\RateLimitException;
48
+use Phaxio\Error\APIConnectionException;
49
+use Phaxio\Error\GeneralException;
50
+
51
+
52
+class PaxfaxController extends Controller {
53
+
54
+    private $service;
55
+    private $config;
56
+    private $userId;
57
+    private $folder;
58
+    private $filesystem;
59
+    private $view;
60
+    private $userSession;
61
+    private $urlGenerator;
62
+
63
+    public function __construct($appName, IRequest $request, PaxfaxService $service, IConfig $config, $userId, Folder $folder, Filesystem $filesystem, View $view, IUserSession $userSession, URLGenerator $urlGenerator) {
64
+
65
+           parent::__construct($appName, $request);
66
+
67
+           $this->service = $service;
68
+           $this->config = $config;
69
+           $this->userId = $userId;
70
+           $this->folder = $folder;
71
+           $this->filesystem = $filesystem;
72
+           $this->view = $view;
73
+           $this->userSession = $userSession;
74
+           $this->urlGenerator = $urlGenerator;
75
+    }
76
+
77
+
78
+    /**
79
+     * @NoAdminRequired
80
+     */
81
+    public function cleantempdir() {
82
+
83
+           // If the 'temp_files' folder doesn't exist create it
84
+           if ($this->folder->nodeExists('Pax_Fax/temp_files') == false) {
85
+               $this->folder->newFolder('Pax_Fax/temp_files');
86
+           }
87
+
88
+           $datadir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/';
89
+           $targetdir = $datadir . $this->userSession->getUser()->getUID() . "/files/Pax_Fax/temp_files";
90
+           $fileSystemIterator = new FilesystemIterator($targetdir);
91
+
92
+           $dirfiles = [];
93
+           foreach ($fileSystemIterator as $fileInfo){
94
+                    $dirfiles[] = $fileInfo->getFilename();
95
+           }
96
+
97
+           foreach ($dirfiles as $key => $indfile) {
98
+                    $thisuserroot = $this->view->getRoot();
99
+                    $tempfile = $thisuserroot . "/Pax_Fax/temp_files/" . $indfile;
100
+                    $removetmpfile = $this->filesystem->unlink($tempfile);
101
+           }
102
+    }
103
+
104
+
105
+    /**
106
+     * @NoAdminRequired
107
+     */
108
+    public function object_to_array($obj) {
109
+
110
+           if(is_object($obj)) $obj = (array)$this->dismount($obj);
111
+           if(is_array($obj)) {
112
+              $new = array();
113
+              foreach($obj as $key => $val) {
114
+                      $new[$key] = $this->object_to_array($val);
115
+              }
116
+           }
117
+           else $new = $obj;
118
+           return $new;
119
+    }
120
+
121
+
122
+    /**
123
+     * @NoAdminRequired
124
+     */
125
+    public function dismount($object) {
126
+           $reflectionClass = new ReflectionClass(get_class($object));
127
+           $array = array();
128
+           foreach ($reflectionClass->getProperties() as $property) {
129
+                    $property->setAccessible(true);
130
+                    $array[$property->getName()] = $property->getValue($object);
131
+                    $property->setAccessible(false);
132
+           }
133
+           return $array;
134
+    }
135
+
136
+
137
+    /**
138
+     * @NoAdminRequired
139
+     */
140
+    public function getbalance() {
141
+
142
+           $apiMode = 'live';
143
+           $thisapicred = $this->service->getapicredentials($this->userSession->getUser()->getUID());
144
+
145
+           $apiKeys[$apiMode] = $thisapicred[0];
146
+           $apiSecrets[$apiMode] = $thisapicred[1];
147
+
148
+           $apiHost = 'https://api.phaxio.com/v2.1/';
149
+
150
+           $phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
151
+
152
+           try {
153
+                    // Get Phaxio account balance
154
+                    $phaxioresulttert = $phaxio->doRequest("GET", 'account/status');
155
+
156
+                    $balancetoarr = $this->object_to_array($phaxioresulttert);
157
+
158
+                    $phaxiobalance = $balancetoarr['data']['balance'];
159
+
160
+           } catch (InvalidRequestException $e) {
161
+                    $phaxiobalance = 'unknown';
162
+                    $phaxiosuccess = 'false';
163
+                    $errortype = 'invalid request error';
164
+           } catch (AuthenticationException $e) {
165
+                    $phaxiobalance = 'unknown';
166
+                    $phaxiosuccess = 'false';
167
+                    $errortype = 'authentication error';
168
+           } catch (APIConnectionException $e) {
169
+                    $phaxiobalance = 'unknown';
170
+                    $phaxiosuccess = 'false';
171
+                    $errortype = 'API connection error';
172
+           } catch (RateLimitException $e) {
173
+                    $phaxiobalance = 'unknown';
174
+                    $phaxiosuccess = 'false';
175
+                    $errortype = 'rate limit error';
176
+           } catch (NotFoundException $e) {
177
+                    $phaxiobalance = 'unknown';
178
+                    $phaxiosuccess = 'false';
179
+                    $errortype = 'not found error';
180
+           } catch (GeneralException $e) {
181
+                    $phaxiobalance = 'unknown';
182
+                    $phaxiosuccess = 'false';
183
+                    $errortype = 'undefined error';
184
+           }
185
+
186
+           return $phaxiobalance;
187
+    }
188
+
189
+
190
+    /**
191
+     * @NoAdminRequired
192
+     */
193
+    public function getfaxnumbers() {
194
+
195
+           $apiMode = 'live';
196
+           $thisapicred = $this->service->getapicredentials($this->userSession->getUser()->getUID());
197
+
198
+           $apiKeys[$apiMode] = $thisapicred[0];
199
+           $apiSecrets[$apiMode] = $thisapicred[1];
200
+
201
+           $apiHost = 'https://api.phaxio.com/v2.1/';
202
+
203
+           $phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
204
+
205
+           try {
206
+                    // Get all Phaxio fax numbers
207
+                    $phaxioresultfour = $phaxio->doRequest("GET", 'phone_numbers');
208
+
209
+                    $phaxionbstoarr = $this->object_to_array($phaxioresultfour);
210
+
211
+                    $phaxioarr = [];
212
+
213
+                    foreach ($phaxionbstoarr['data'] as $phkey => $phvalue) {
214
+                           if (is_array($phvalue)) {
215
+                                 foreach ($phvalue as $phkey2 => $phvalue2) {
216
+                                       if ($phkey2 == 'phone_number') {
217
+                                           $phaxioarr[] = $phvalue2;
218
+                                       }
219
+                                 }
220
+                           }
221
+                    }
222
+
223
+                    $phaxionmbrs = $phaxioarr;
224
+
225
+           } catch (InvalidRequestException $e) {
226
+                    $phaxiobalance = 'unknown';
227
+                    $phaxiosuccess = 'false';
228
+                    $errortype = 'invalid request error';
229
+           } catch (AuthenticationException $e) {
230
+                    $phaxiobalance = 'unknown';
231
+                    $phaxiosuccess = 'false';
232
+                    $errortype = 'authentication error';
233
+           } catch (APIConnectionException $e) {
234
+                    $phaxiobalance = 'unknown';
235
+                    $phaxiosuccess = 'false';
236
+                    $errortype = 'API connection error';
237
+           } catch (RateLimitException $e) {
238
+                    $phaxiobalance = 'unknown';
239
+                    $phaxiosuccess = 'false';
240
+                    $errortype = 'rate limit error';
241
+           } catch (NotFoundException $e) {
242
+                    $phaxiobalance = 'unknown';
243
+                    $phaxiosuccess = 'false';
244
+                    $errortype = 'not found error';
245
+           } catch (GeneralException $e) {
246
+                    $phaxiobalance = 'unknown';
247
+                    $phaxiosuccess = 'false';
248
+                    $errortype = 'undefined error';
249
+           }
250
+
251
+           return $phaxionmbrs;
252
+    }
253
+
254
+    /**
255
+     * @NoAdminRequired
256
+     */
257
+    protected function getFileID() {
258
+		if ($this->createdFile) {
259
+			return $this->createdFile;
260
+		}
261
+
262
+		$qb = $this->connection->getQueryBuilder();
263
+
264
+		// We create a new file entry and delete it after the test again
265
+		$fileName = $this->getUniqueID('TestRepairCleanTags', 12);
266
+		$qb->insert('filecache')
267
+			->values([
268
+				'path' => $qb->createNamedParameter($fileName),
269
+				'path_hash' => $qb->createNamedParameter(md5($fileName)),
270
+			])
271
+			->execute();
272
+		$fileName = $this->getUniqueID('TestRepairCleanTags', 12);
273
+		$qb->insert('filecache')
274
+			->values([
275
+				'path' => $qb->createNamedParameter($fileName),
276
+				'path_hash' => $qb->createNamedParameter(md5($fileName)),
277
+			])
278
+			->execute();
279
+
280
+		$this->createdFile = (int) $this->getLastInsertID('filecache', 'fileid');
281
+		return $this->createdFile;
282
+    }
283
+
284
+    /**
285
+     * @NoAdminRequired
286
+     */
287
+    public function uploadfile($uploadfileforfax) {
288
+
289
+           $fileContent = file_get_contents($_FILES['uploadfileforfax']['tmp_name']);
290
+           $fileName = $_FILES['uploadfileforfax']['name'];
291
+           $fileSizeinit = $_FILES['uploadfileforfax']['size'];
292
+           $fileSize = $fileSizeinit / 1048576;
293
+
294
+           if ($this->folder->nodeExists('Pax_Fax/faxes_sent') == false) {
295
+               $this->folder->newFolder('Pax_Fax/faxes_sent');
296
+           }
297
+           if ($this->folder->nodeExists('Pax_Fax/faxes_received') == false) {
298
+               $this->folder->newFolder('Pax_Fax/faxes_received');
299
+           }
300
+           if ($this->folder->nodeExists('Pax_Fax/faxes_sent_failed') == false) {
301
+               $this->folder->newFolder('Pax_Fax/faxes_sent_failed');
302
+           }
303
+           if ($this->folder->nodeExists('Pax_Fax/faxes_received_failed') == false) {
304
+               $this->folder->newFolder('Pax_Fax/faxes_received_failed');
305
+           }
306
+           if ($this->folder->nodeExists('Pax_Fax/temp_files') == false) {
307
+               $this->folder->newFolder('Pax_Fax/temp_files');
308
+           }
309
+
310
+           $userroot = $this->view->getRoot();
311
+           $targetfile = $userroot . "/Pax_Fax/temp_files/" . $fileName;
312
+
313
+           $target = $this->folder->newFile($targetfile);
314
+           $target->putContent($fileContent);
315
+
316
+           // Get the cumulative files size of the uploaded files
317
+           $datadir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/';
318
+           $targetdir = $datadir . $this->userSession->getUser()->getUID() . "/files/Pax_Fax/temp_files";
319
+
320
+           $fileSystemIterator = new FilesystemIterator($targetdir);
321
+
322
+           $dirfiles = [];
323
+           foreach ($fileSystemIterator as $fileInfo){
324
+                    $dirfiles[] = $fileInfo->getFilename();
325
+           }
326
+
327
+           $totalflsizeinit = 0;
328
+           foreach ($dirfiles as $key => $indfile) {
329
+                    $fileSizeinit = $this->filesystem->filesize($userroot . "/Pax_Fax/temp_files/" . $indfile);
330
+                    $mbSize = $fileSizeinit / 1048576;
331
+                    $totalflsizeinit += $mbSize;
332
+           }
333
+
334
+           $totalflsize = number_format($totalflsizeinit, 2) . ' MB';
335
+
336
+           return $totalflsize;
337
+    }
338
+
339
+    /**
340
+     * @NoAdminRequired
341
+     */
342
+    public function pickfile($path) {
343
+
344
+           if ($this->folder->nodeExists('Pax_Fax/faxes_sent') == false) {
345
+               $this->folder->newFolder('Pax_Fax/faxes_sent');
346
+           }
347
+           if ($this->folder->nodeExists('Pax_Fax/faxes_received') == false) {
348
+               $this->folder->newFolder('Pax_Fax/faxes_received');
349
+           }
350
+           if ($this->folder->nodeExists('Pax_Fax/faxes_sent_failed') == false) {
351
+               $this->folder->newFolder('Pax_Fax/faxes_sent_failed');
352
+           }
353
+           if ($this->folder->nodeExists('Pax_Fax/faxes_received_failed') == false) {
354
+               $this->folder->newFolder('Pax_Fax/faxes_received_failed');
355
+           }
356
+           if ($this->folder->nodeExists('Pax_Fax/temp_files') == false) {
357
+               $this->folder->newFolder('Pax_Fax/temp_files');
358
+           }
359
+
360
+           $datadir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/';
361
+
362
+           $fltgt = $datadir . $this->userSession->getUser()->getUID() . "/files" . $path;
363
+
364
+           $fileContentpk = file_get_contents($fltgt);
365
+
366
+           $patharr = explode("/", $path);
367
+
368
+           $revarr = array_reverse($patharr);
369
+
370
+           $relflpath = "/Pax_Fax/temp_files/" . $revarr[0]; 
371
+
372
+           $target = $this->folder->newFile($relflpath);
373
+
374
+           $target->putContent($fileContentpk);
375
+
376
+           $targetdir = $datadir . $this->userSession->getUser()->getUID() . "/files/Pax_Fax/temp_files";
377
+
378
+           $fileSystemIterator = new FilesystemIterator($targetdir);
379
+
380
+           $dirfiles = [];
381
+           foreach ($fileSystemIterator as $fileInfo) {
382
+                    $dirfiles[] = $fileInfo->getFilename();
383
+           }
384
+
385
+           $totalflsizeinit = 0;
386
+
387
+           foreach ($dirfiles as $key => $indfile) {
388
+
389
+                    $fileSizeinit = $this->filesystem->filesize("/Pax_Fax/temp_files/" . $indfile);
390
+                    $mbSize = $fileSizeinit / 1048576;
391
+                    $totalflsizeinit += $mbSize;
392
+           }
393
+
394
+           $totalflsize = number_format($totalflsizeinit, 2) . ' MB';
395
+
396
+           return $totalflsize;
397
+    }
398
+
399
+    /**
400
+     * @NoAdminRequired
401
+     */
402
+    public function removeupfile($removedfilename) {
403
+
404
+           $tmpfl = "/" . $this->userSession->getUser()->getUID() . "/files/Pax_Fax/temp_files/" . $removedfilename;
405
+
406
+           $removefile = $this->view->unlink($tmpfl);
407
+
408
+           // Get the cumulative files size of the uploaded files
409
+           $datadir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/';
410
+           $targetdir = $datadir . $this->userSession->getUser()->getUID() . "/files/Pax_Fax/temp_files";
411
+           $fileSystemIterator = new FilesystemIterator($targetdir);
412
+
413
+           $dirfiles = [];
414
+           foreach ($fileSystemIterator as $fileInfo) {
415
+                    $dirfiles[] = $fileInfo->getFilename();
416
+           }
417
+
418
+           $totalflsizeinit = 0;
419
+
420
+           foreach ($dirfiles as $key => $indfile) {
421
+                    $fileSizeinit = $this->filesystem->filesize("/Pax_Fax/temp_files/" . $indfile);
422
+                    $mbSize = $fileSizeinit / 1048576;
423
+                    $totalflsizeinit += $mbSize;
424
+           }
425
+
426
+           $totalflsize = number_format($totalflsizeinit, 2) . ' MB';
427
+
428
+           return $totalflsize;
429
+    }
430
+
431
+    /**
432
+     * @NoAdminRequired
433
+     */
434
+    public function getpickedfile($pickedfilename) {
435
+
436
+           $thisuserroot = $this->view->getRoot();
437
+
438
+           $temppickedfile = $thisuserroot . "/Pax_Fax/temp_files/" . $pickedfilename;
439
+           $getfilecontent = $this->filesystem->file_get_contents($temppickedfile);
440
+
441
+           $namesplit = explode(".", $pickedfilename);
442
+           $extension = end($namesplit);
443
+
444
+           if ($extension == "txt" || $extension == "html") {
445
+               $getpickedfile = $getfilecontent;
446
+           } elseif ($extension == "jpg") {
447
+               $getpickedfile = 'data:image/jpeg;base64,' . base64_encode($getfilecontent);
448
+           } elseif ($extension == "png") {
449
+               $getpickedfile = 'data:image/png;base64,' . base64_encode($getfilecontent);
450
+           } else { $getpickedfile = ""; }
451
+
452
+           return $getpickedfile;
453
+    }
454
+
455
+    /**
456
+     * @NoAdminRequired
457
+     */
458
+    public function sendfax($uploadedtofax, $selectedcid, $toNumber) {
459
+
460
+           $tonumbertr = str_replace("+", "", $toNumber[0]);
461
+           $fldate = date("Y-m-d_H-i-s_").gettimeofday()["usec"];
462
+
463
+           $fromnumberdigits = str_replace("+", "", $selectedcid);
464
+           if ($selectedcid != '' && $selectedcid != 'click refresh button') { $fromnumber = $fromnumberdigits; } else { $fromnumber = 'nocallerid'; }
465
+
466
+           $countfaxfiles = count($uploadedtofax);
467
+
468
+           $openedfiles = [];
469
+           $crtuser = $this->userSession->getUser()->getUID();
470
+
471
+           foreach ($uploadedtofax as $key => $flname) {
472
+
473
+                    if ($key == 0) { $firstflname = $flname; }
474
+
475
+                    $fileNamesec = array_reverse(explode(".", $flname));
476
+                    $filenameext = $fileNamesec[0];
477
+                    array_shift($fileNamesec);
478
+
479
+                    $fileName = implode("", $fileNamesec);
480
+
481
+                    if ($countfaxfiles == 1) {
482
+                        $targetfile = "/Pax_Fax/faxes_sent/" . $fileName . "_" . $fromnumber . "_"  . $tonumbertr . "_" . $fldate . "." . $filenameext;
483
+                    } else {
484
+                         if ($this->folder->nodeExists("Pax_Fax/faxes_sent/" . $firstflname . "_et_al_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate) == false) {
485
+                             $this->folder->newFolder("Pax_Fax/faxes_sent/" . $firstflname . "_et_al_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate);
486
+                         }
487
+
488
+                         $targetfile = "/Pax_Fax/faxes_sent/" . $firstflname . "_et_al_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "/" . $fileName . "_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "." . $filenameext;
489
+                    }
490
+
491
+                    $datadir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/';
492
+
493
+                    $fltgtsnd = $datadir . $crtuser . "/files/Pax_Fax/temp_files/" . $flname;
494
+                    $fltgtsndtmp = "/Pax_Fax/temp_files/" . $flname;
495
+
496
+                    $fileContentsnd = file_get_contents($fltgtsnd);
497
+
498
+                    $target = $this->folder->newFile($targetfile);
499
+                    $target->putContent($fileContentsnd);
500
+
501
+                    $removetmpfile = $this->filesystem->unlink($fltgtsndtmp);
502
+
503
+                    if ($countfaxfiles == 1) {
504
+                        $openedfiles[] = fopen($datadir . $crtuser . "/files/Pax_Fax/faxes_sent/" . $fileName . "_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "." . $filenameext, "r");
505
+                    } else {
506
+                        $openedfiles[] = fopen($datadir . $crtuser . "/files/Pax_Fax/faxes_sent/" . $firstflname . "_et_al_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "/" . $fileName . "_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "." . $filenameext, "r");
507
+                    }
508
+           }
509
+
510
+           $params = array(
511
+                           'to' => $toNumber,
512
+                           'file' => $openedfiles,
513
+                           'caller_id' => $selectedcid
514
+                     );
515
+
516
+           $apiMode = 'live';
517
+
518
+           $thisapicred = $this->service->getapicredentials($crtuser);
519
+
520
+           $apiKeys[$apiMode] = $thisapicred[0];
521
+           $apiSecrets[$apiMode] = $thisapicred[1];
522
+
523
+           $apiHost = 'https://api.phaxio.com/v2.1/';
524
+
525
+           $phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
526
+
527
+           try {
528
+                    $phaxioresultinit = $phaxio->sendFax($params);
529
+
530
+                    $phaxioresultsec = $phaxio->doRequest("GET", 'faxes/' . urlencode((string)$phaxioresultinit['id']));
531
+
532
+                    $statustoarr = $this->object_to_array($phaxioresultsec);
533
+
534
+                    $phaxiosuccess = $statustoarr['success'];
535
+
536
+                    $errortype = 'there are no errors';
537
+
538
+           } catch (InvalidRequestException $e) {
539
+                    $phaxiosuccess = 'false';
540
+                    $errortype = 'invalid request error';
541
+           } catch (AuthenticationException $e) {
542
+                    $phaxiosuccess = 'false';
543
+                    $errortype = 'authentication error';
544
+           } catch (APIConnectionException $e) {
545
+                    $phaxiosuccess = 'false';
546
+                    $errortype = 'API connection error';
547
+           } catch (RateLimitException $e) {
548
+                    $phaxiosuccess = 'false';
549
+                    $errortype = 'rate limit error';
550
+           } catch (NotFoundException $e) {
551
+                    $phaxiosuccess = 'false';
552
+                    $errortype = 'not found error';
553
+           } catch (GeneralException $e) {
554
+                    $phaxiosuccess = 'false';
555
+                    $errortype = 'undefined error';
556
+           }
557
+
558
+           $phaxioresult = ['success' => $phaxiosuccess, 'errortype' => $errortype];
559
+
560
+           if ($phaxiosuccess != 'true') {
561
+
562
+                    foreach ($uploadedtofax as $key => $flname) {
563
+
564
+                        $fileNamesec = array_reverse(explode(".", $flname));
565
+                        $filenameext = $fileNamesec[0];
566
+                        array_shift($fileNamesec);
567
+
568
+                        $fileName = implode("", $fileNamesec);
569
+
570
+                        if ($countfaxfiles == 1) {
571
+                            $failedfl = "/Pax_Fax/faxes_sent/" . $fileName . "_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "." . $filenameext;
572
+                            $newtargetfl =  "/Pax_Fax/faxes_sent_failed/" . $fileName . "_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "." . $filenameext;
573
+                        } else {
574
+
575
+                            $failedfl = "/Pax_Fax/faxes_sent/" . $firstflname . "_et_al_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "/" . $fileName . "_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "." . $filenameext;
576
+                            $this->folder->newFolder("Pax_Fax/faxes_sent_failed/" . $firstflname . "_et_al_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate);
577
+                            $newtargetfl = "/Pax_Fax/faxes_sent_failed/" . $firstflname . "_et_al_" . $fromnumber . "_" . $tonumbertr . "_" . $fldate . "/" . $fileName . "_" . $tonumbertr . "_" . $fldate . "." . $filenameext;
578
+                        }
579
+
580
+                        $fileContentfld = $this->filesystem->file_get_contents($failedfl);
581
+
582
+                        $targetact = $this->folder->newFile($newtargetfl);
583
+                        $targetact->putContent($fileContentfld);
584
+
585
+                        $removefailed = $this->filesystem->unlink($failedfl);
586
+                    }
587
+
588
+           }
589
+
590
+           return $phaxioresult;
591
+    }
592
+
593
+
594
+    /**
595
+     * @NoAdminRequired
596
+     */
597
+    public function getsettings() {
598
+           return $this->service->getsettings($this->userSession->getUser()->getUID());
599
+    }
600
+
601
+
602
+    /**
603
+     * @NoAdminRequired
604
+     */
605
+    public function updatesettings($apiKey, $apiSecret, $webhookToken, $receiveUrl, $getNotification, $notificationEmail) {
606
+           return $this->service->updatesettings($this->userSession->getUser()->getUID(), $apiKey, $apiSecret, $webhookToken, $receiveUrl, $getNotification, $notificationEmail);
607
+    }
608
+
609
+}