forked from FalconChristmas/FPP-Plugin-TwilioControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pluginEnable.php
executable file
·74 lines (48 loc) · 1.98 KB
/
pluginEnable.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/php
<?
//error_reporting(0);
//
//Version 1 for release
$pluginName ="TwilioControl";
$myPid = getmypid();
$skipJSsettings = 1;
include_once("/opt/fpp/www/config.php");
include_once("/opt/fpp/www/common.php");
include_once("functions.inc.php");
include_once("commonFunctions.inc.php");
include_once("profanity.inc.php");
// this line loads the library
//require('Twilio/Services/Twilio.php');
require ('Twilio/autoload.php');
$messageQueue_Plugin = findPlugin("MessageQueue");
$MESSAGE_QUEUE_PLUGIN_ENABLED=false;
$logFile = $settings['logDirectory']."/".$pluginName.".log";
$pluginConfigFile = $settings['configDirectory'] . "/plugin." .$pluginName;
if (file_exists($pluginConfigFile))
$pluginSettings = parse_ini_file($pluginConfigFile);
$logFile = $settings['logDirectory']."/".$pluginName.".log";
$DEBUG=urldecode($pluginSettings['DEBUG']);
$WHITELIST_NUMBERS = urldecode($pluginSettings['WHITELIST_NUMBERS']);
$CONTROL_NUMBERS = urldecode($pluginSettings['CONTROL_NUMBERS']);
$TSMS_account_sid = urldecode($pluginSettings['TSMS_ACCOUNT_SID']);
$TSMS_auth_token = urldecode($pluginSettings['TSMS_AUTH_TOKEN']);
$TSMS_phoneNumber = urldecode($pluginSettings['TSMS_PHONE_NUMBER']);
$playCommands = urldecode($pluginSettings['PLAY_COMMANDS']);
$stopCommands = urldecode($pluginSettings['STOP_COMMANDS']);
$repeatCommands = urldecode($pluginSettings['REPEAT_COMMANDS']);
$statusCommands = urldecode($pluginSettings['STATUS_COMMANDS']);
$REMOTE_FPP_ENABLED = urldecode($pluginSettings['REMOTE_FPP_ENABLED']);
$REMOTE_FPP_IP = urldecode($pluginSettings['REMOTE_FPP_IP']);
$ENABLED = urldecode($pluginSettings['ENABLED']);
if($DEBUG) {
//echo "this plugin enabled status is: ".$ENABLED;
logEntry("This plugin enabled status is: ".$ENABLED);
}
$TSMS_from = "";
$TSMS_body = "";
foreach($CONTROL_NUMBERS as $NOTIFY_NUMBER) {
$TSMS_from = $NOTIFY_NUMBER;
sendTSMSMessage($messageText);
}
WriteSettingToFile("ENABLED",urlencode("ON"),$pluginName);
?>