diff --git a/classes/notificationsmanager.class.php b/classes/notificationsmanager.class.php
index 618a4926..ab880b6e 100644
--- a/classes/notificationsmanager.class.php
+++ b/classes/notificationsmanager.class.php
@@ -751,6 +751,9 @@ public static function send_push($UserIDs, $Title, $Body, $URL = '', $Type = sel
case '6':
$Service = "PushBullet";
break;
+ case '7':
+ $Service = "Pushjet";
+ break;
default:
break;
}
diff --git a/classes/notificationsmanagerview.class.php b/classes/notificationsmanagerview.class.php
index 527258fe..86fb52fd 100644
--- a/classes/notificationsmanagerview.class.php
+++ b/classes/notificationsmanagerview.class.php
@@ -35,6 +35,7 @@ private static function render_push_settings() {
+
diff --git a/classes/pushserver.class.php b/classes/pushserver.class.php
index 6cc5a57a..e9b2f07d 100644
--- a/classes/pushserver.class.php
+++ b/classes/pushserver.class.php
@@ -60,11 +60,40 @@ private function parse_data($Data) {
$JSON['message']['body'],
$JSON['message']['url']
);
+ case 'pushjet':
+ $this->push_pushjet($JSON['user']['key'], $JSON['message']['title'], $JSON['message']['body'], $JSON['message']['url']);
+ break
default:
break;
}
}
+ private function push_pushjet($Key, $Title, $Message, $URL) {
+ $API = "https://api.pushjet.io/message";
+ $Fields = array(
+ 'secret' => urlencode($Key),
+ 'title' => urlencode($Title),
+ 'description' => urlencode($Message)
+ );
+ if (!empty($URL)) {
+ $Fields['link'] = $URL;
+ }
+
+ $FieldsString = "";
+ foreach ($Fields as $key => $value) {
+ $FieldsString .= $key . '=' . $value . '&';
+ }
+ rtrim($FieldsString, '&');
+
+ $Curl = curl_init();
+ curl_setopt($Curl, CURLOPT_URL, $API);
+ curl_setopt($Curl, CURLOPT_POST, count($Fields));
+ curl_setopt($Curl, CURLOPT_POSTFIELDS, $FieldsString);
+ curl_exec($Curl);
+ curl_close($Curl);
+ echo "Push sent to Pushjet";
+ }
+
private function push_prowl($Key, $Title, $Message, $URL) {
$API = "https://api.prowlapp.com/publicapi/add";
$Fields = array(
diff --git a/static/functions/user_settings.js b/static/functions/user_settings.js
index b8acfc39..a43e0c71 100644
--- a/static/functions/user_settings.js
+++ b/static/functions/user_settings.js
@@ -1,6 +1,7 @@
var PUSHOVER = 5;
var TOASTY = 4;
var PUSHBULLET = 6;
+var PUSHJET = 7;
$(document).ready(function() {
var top = $('#settings_sections').offset().top - parseFloat($('#settings_sections').css('marginTop').replace(/auto/, 0));
@@ -76,6 +77,8 @@ $(document).ready(function() {
$('#pushservice_title').text("Device ID");
} else if ($(this).val() == PUSHOVER) {
$('#pushservice_title').text("User Key");
+ } else if ($(this).val() == PUSHJET) {
+ $('#pushservice_title').text("Secret");
} else {
$('#pushservice_title').text("API Key");
}