Commit Graph

270 Commits

Author SHA1 Message Date
Thomas Nilsen
b90fab434c Changes to SQL schema
In order to handle multiple subscription types using the same tables
some changes from the schema as implemented by PR #1 are needed.
A typeID field will be the indicator for which type of notification
to use. Additional notification types must be assinged unique
typeIDs. Assigned typeID for now are:

- 1 = Telegram
- 2 = email
2018-11-25 20:04:59 +01:00
Thomas Nilsen
fe812d5b78 Reverts changes done by a rebase merge gone wrong 2018-11-25 19:20:43 +01:00
Thomas Nilsen
c57171add5 Reverts changes done by a rebase merge gone wrong 2018-11-25 18:58:42 +01:00
Thomas Nilsen
4903c3bb89 HTML template for status updates to subscribers
- Initial HTML template used to generate HTML emails when status
  notifications is sent to subscribers.
  TODO: Should probably be located in a different directory
  structure
2018-11-25 18:56:23 +01:00
Thomas Nilsen
28eaede6a2 Implementes email subscription handler to front
- Adds handler for email subscription. #65
2018-11-25 18:54:10 +01:00
Thomas Nilsen
39e53ab1f4 Adds dropdown for subscription options to menu
- Modifies menu to include email subscription in addition to Telegram
  subscription
2018-11-25 18:50:31 +01:00
Thomas Nilsen
a74ce9ad33 Remove commented code 2018-11-25 18:48:38 +01:00
Thomas Nilsen
e98b4da649 Use new notification class 2018-11-25 18:45:54 +01:00
Thomas Nilsen
7ca811d997 Adds new class dependencies
- Mailer class for mail handler
- Notification class for all notifications
- Parsedown class for implenting support for Markdown when adding new
  incidents #8.
2018-11-25 18:39:57 +01:00
Thomas Nilsen
3eccbf529e Add handling of email subscriptions
- Translation issue fixes #64

- Adds handler for email subscription requests
2018-11-25 18:33:25 +01:00
Thomas Nilsen
528cb77952 Reverses partial changes commited in PR #63
- Removes not needed re-translation of statuses. These fails to be
  translated due to index.php calling config.php after performing
  the translation. See #64 for details

- Amend SQL query to use named fields to prevent potential failure
  in future upgrades if table should change.
2018-11-25 18:26:30 +01:00
Thomas Nilsen
b5c5a2c8cf Moved, renamed and modified Telegram related files.
- Made functions from ./telegram.php into a class and moved to
  classes/telegram.php

- Renamed check.php to telegram_check.php to make it easier to
  understand what the file belongs to.

- SESSIONS used to control if user is logged on or not

- Telegram users will be identified as typeID = 2 in the
  subscribers table.
2018-11-25 17:25:44 +01:00
Thomas Nilsen
cf1f00e9b5 Frontend for handling subscription changes. 2018-11-25 17:23:07 +01:00
Thomas Nilsen
82e3dcb11e Add new classes
This implements the following new classes

- mailer.php Class to handle smtp/mail related tasks. This implements
  support for PHPMailer()

- notification.php Class to handle notification to subscribers.

- subscriber.php Class to handle the self-managment of subscribers.

- subscriptions.php Class to handle subscription to services for
  subscribers.
2018-11-25 17:18:09 +01:00
Thomas Nilsen
d504b0a4cc Add php_idn lib to support IDN/punycode emails
This external library adds functions to encode and decode email
addresses using extended utf-8 character sets. Example
examlpe@bånnibøtta.no

The library is written as simple functions rather than a class.
Original code at https://github.com/IgorVBelousov/php_idn
2018-11-25 17:06:03 +01:00
Thomas Nilsen
cd6ce3c8d8 Added additional config definitions
In preparation for adding subscription notification a number of
new  configuration options has been added. These are as follows:

- SUBSCRIBE_EMAIL : True/False to allow email subscription

- SUBSCRIBE_TELEGRAM : True/False to allow Telegram
   subscription

- GOOGLE_RECAPTCHA : True/False to enable reCapthca for
   e-mail signup form

- GOOGLE_RECAPTCHA_SITEKEY : Google reCaptcha sitekey

- GOOGLE_RECAPTCHA_SECRET : Google reCaptcha secret

- PHP_MAILER : True/False to allow the use of PHPMailer()
  library for emails.

- PHP_MAILER_PATH: Path to where PHPMailer() class is
  located on the system

- PHP_MAILER_SMTP : True/False if SMTP is to be used with
  PHPmailer(). Default will be mail().

- PHP_MAILER_HOST : SMTP Host to use if PHP_MAILER_SMTP
  is enabled.

- PHP_MAILER_PORT : SMTP Port

- PHP_MAILER_SECURE : tls/ssl option for PHPMailer()

- PHP_MAILER_USER : Username for SMTP

- PHP_MAILER_PASS : Password for SMTP
2018-11-24 22:19:06 +01:00
Thomas Nilsen
3fec45442e Added warning/success alert render function 2018-11-24 21:13:57 +01:00
Thomas Nilsen
3ff19c0be5 Added parsedown support libraries based on paresedown.org 2018-11-23 23:23:19 +01:00
thnilsen
18af07ac77 Fix formating/repeat issue for install form 2018-11-23 22:13:08 +01:00
thnilsen
23cf02f608 Replace hardcoded urls with constants from config. 2018-11-23 22:12:31 +01:00
jhuesser
1431964afc added telegram to privacy policy 2018-11-23 22:12:31 +01:00
jhuesser
ba6e3f4144 <br> handler for POLICY_PHONE 2018-11-23 22:12:31 +01:00
jhuesser
cbc5fd2854 some fixes (still dont work) 2018-11-23 22:12:31 +01:00
jhuesser
a57f6e2f86 after work commit [not working]
not working, but i need to push it to have it on my other locations
2018-11-23 22:11:41 +01:00
jhuesser
66c13a32cc created default policy 2018-11-23 22:11:41 +01:00
jhuesser
8ffd5f9906 added policy form 2018-11-23 22:11:41 +01:00
jhuesser
df4c08d8c8 added titles + third party 2018-11-23 22:11:41 +01:00
jhuesser
51926b37b7 spelling 2018-11-23 22:11:41 +01:00
jhuesser
b8daf45ac9 removed swiss law, added EU law 2018-11-23 22:11:41 +01:00
jhuesser
ecaf5aa58b add some conflicts 2018-11-23 22:11:41 +01:00
jhuesser
1172eeaf1b fix text 2018-11-23 22:11:41 +01:00
jhuesser
a56e6ae8ef added really simple privacy policy and install proccedure 2018-11-23 22:11:41 +01:00
jhuesser
d2c28e6ae7 add contact fields 2018-11-23 22:10:49 +01:00
jhuesser
db6f705b6a show telegram menu in mobile 2018-11-23 22:10:49 +01:00
jhuesser
b005e77664 use unused value 2018-11-23 22:10:49 +01:00
jhuesser
d0d0572b82 removed unused lastname 2018-11-23 22:10:49 +01:00
jhuesser
efe4c3d42f mange subscriptions 2018-11-23 22:10:49 +01:00
jhuesser
cea55bd2b8 show my subscriptions 2018-11-23 22:10:49 +01:00
jhuesser
c96cc6e1c5 login and logout with telegram 2018-11-23 22:10:49 +01:00
jhuesser
65f6de7289 add telegram User Data reader 2018-11-23 22:10:49 +01:00
jhuesser
8e1ae46564 add login with telegram button 2018-11-23 22:10:49 +01:00
jhuesser
8c305d8a93 bug fixes and debuging stuff removed 2018-11-23 22:10:49 +01:00
jhuesser
d02ebc25ab send new incident to subscriber 2018-11-23 22:10:49 +01:00
jhuesser
781c938118 added telegram to install.php 2018-11-23 22:10:49 +01:00
jhuesser
bc92eea651 added tg values to config file 2018-11-23 22:07:37 +01:00
jhuesser
eabca6bb0c database modifications 2018-11-23 22:06:48 +01:00
Vojtěch Sajdl
554edc403a
Merge pull request #70 from thnilsen/add_services_to_panel
Add services to panel
2018-11-21 13:42:30 +01:00
Thomas Nilsen
d0824170ac Fix admin url (#68)
* Add prerequisite checks to install script. - Pryx/server-status#31

* Add option to use existing URL for privacy policy. Pryx/server-status#41

- Also moved the gitbug icon to the left of the footer as it looked like it was part of the imprint/policy link.
- Fixed Imprint & Privacy policy text so that it will be translated.

* Admin page is redirected to wrong URL on save. Fix Pryx/server-status#67
2018-11-21 11:42:04 +01:00
Vojtěch Sajdl
e36f37f350
Merge pull request #66 from thnilsen/add_prerequisite
Add prerequisite and policy url configuration
2018-11-21 11:41:50 +01:00
Thomas Nilsen
361c961d14 Added comment to mysqlnd checks for future reference 2018-11-21 11:38:57 +01:00