function check_for_profanity_neutrinoapi($message)
{
    global $DEBUG, $pluginSettings, $API_USER_ID, $API_KEY;
    if ($DEBUG) {
        logEntry("inside profanity checker");
    }
    logEntry("checking for profanity inside message: " . $message);
    //	$API_USER_ID = urldecode($pluginSettings['API_USER_ID']);
    //	$API_KEY = urldecode($pluginSettings['API_KEY']);
    logEntry("API USER: "******"API KEY: " . $API_KEY);
    $postData = array("user-id" => $API_USER_ID, "api-key" => $API_KEY, "content" => $message);
    $json = curl_post_request("https://neutrinoapi.com/bad-word-filter", $postData);
    //$json = curl_post_request("https://neutrinoapi.com/ip-info", $postData);
    $result = json_decode($json, true);
    //logEntry("profanty result: is bad: ".$result['is-bad']);
    //logEntry("profanity result: total bad words: ".$result['bad-words-total']);
    logEntry("is bad: " . $result['is-bad']);
    logEntry("is bad total: " . $result['bad-words-total']);
    //echo print_r($result['bad-words-list'])."\n";
    logEntry("censored content: " . $result['censored-content']);
    if ($result['is-bad'] > 0 || $result['bad-words-total'] > 0) {
        return true;
    } else {
        return false;
    }
}
 public static function unlock()
 {
     global $argv;
     $lock_file = LOCK_DIR . $argv[0] . LOCK_SUFFIX;
     if (file_exists($lock_file)) {
         unlink($lock_file);
     }
     logEntry("==" . self::$pid . "== Releasing lock...");
     //error_log("==".self::$pid."== Releasing lock...");
     return TRUE;
 }
function disableMatrixToolOutput($matrix = "")
{
    global $pluginDirectory, $fpp_matrixtools_Plugin, $fpp_matrixtools_Plugin_Script, $Matrix;
    if ($matrix == "") {
        $matrix = $Matrix;
    }
    $cmdEnable = $pluginDirectory . "/" . $fpp_matrixtools_Plugin . "/" . $fpp_matrixtools_Plugin_Script . " --blockname \"" . $matrix . "\" --enable 0";
    logEntry("Matrix disable cmd: " . $cmdEnable);
    //echo "p10 enable: ".$cmdEnable."\n";
    exec($cmdEnable, $enableOutput);
    //echo "Enabled \n";
    //print_r($enableOutput);
}
Exemplo n.º 4
0
function createSMSEventFile()
{
    global $SMSEventFile, $pluginName, $MAJOR, $MINOR, $SMSGETScriptFilename;
    logEntry("Creating  event file: " . $SMSEventFile);
    $data = "";
    $data .= "majorID=" . $MAJOR . "\n";
    $data .= "minorID=" . $MINOR . "\n";
    $data .= "name='" . $pluginName . "_GET" . "'\n";
    $data .= "effect=''\n";
    $data .= "startChannel=\n";
    $data .= "script='" . pathinfo($SMSGETScriptFilename, PATHINFO_BASENAME) . "'\n";
    $fs = fopen($SMSEventFile, "w");
    fputs($fs, $data);
    fclose($fs);
}
function createScriptFile($scriptFilename, $scriptCMD)
{
    global $scriptDirectory, $pluginName;
    $scriptFilename = $scriptDirectory . "/" . $scriptFilename;
    logEntry("Creating  script: " . $scriptFilename);
    $ext = pathinfo($scriptFilename, PATHINFO_EXTENSION);
    $data = "";
    $data .= "#!/bin/sh\n";
    $data .= "\n";
    $data .= "#Script to run randomizer\n";
    $data .= "#Created by " . $pluginName . "\n";
    $data .= "#\n";
    $data .= "/usr/bin/php " . $scriptCMD . "\n";
    logEntry($data);
    $fs = fopen($scriptFilename, "w");
    fputs($fs, $data);
    fclose($fs);
}
$myPid = getmypid();
$DEBUG = false;
$skipJSsettings = 1;
include_once "/opt/fpp/www/config.php";
include_once "/opt/fpp/www/common.php";
include_once "functions.inc.php";
require "lock.helper.php";
define('LOCK_DIR', '/tmp/');
define('LOCK_SUFFIX', '.lock');
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
$fpp_matrixtools_Plugin = "fpp-matrixtools";
$fpp_matrixtools_Plugin_Script = "scripts/matrixtools";
$P10Matrix = urldecode(ReadSettingFromFile("P10Matrix", $pluginName));
logEntry("unlocking matrix.php");
//unlock the pid
//lockHelper::unlock();
//clearMatrix();
if (file_exists("/tmp/matrix.php.lock")) {
    $matrix_pid = file_get_contents("/tmp/matrix.php.lock");
    $cmdKill = "sudo kill -9 " . $matrix_pid;
    exec($cmdKill);
}
//$cmdKillPHPMatrix = "sudo killall -9 matrix.php";
//logEntry("Killing php matrix: ".$cmdKillPHPMatrix);
//exec($cmdKillPHPMatrix);
//sleep(1);
$cmdKill = "sudo killall -9 matrixtools";
logEntry("Killing Matrix pid:");
exec($cmdKill, $result);
clearMatrix();
//print_r($result);
<?php

//$DEBUG=true;
include_once "/opt/fpp/www/common.php";
include_once "functions.inc.php";
include_once "commonFunctions.inc.php";
//include the array of sports
include_once "SPORTS.inc.php";
$pluginName = "SportsTicker";
$pluginUpdateFile = $settings['pluginDirectory'] . "/" . $pluginName . "/" . "pluginUpdate.inc";
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
logEntry("plugin update file: " . $pluginUpdateFile);
if (isset($_POST['updatePlugin'])) {
    logEntry("updating plugin...");
    $updateResult = updatePluginFromGitHub($gitURL, $branch = "master", $pluginName);
    echo $updateResult . "<br/> \n";
}
if (isset($_POST['submit'])) {
    $SPORTS = implode(',', $_POST["SPORTS"]);
    //	echo "Writring config fie <br/> \n";
    WriteSettingToFile("SPORTS", $SPORTS, $pluginName);
    WriteSettingToFile("ENABLED", urlencode($_POST["ENABLED"]), $pluginName);
    WriteSettingToFile("SEPARATOR", urlencode($_POST["SEPARATOR"]), $pluginName);
    WriteSettingToFile("LAST_READ", urlencode($_POST["LAST_READ"]), $pluginName);
}
//print_r($pluginSettings);
//$SPORTS = urldecode(ReadSettingFromFile("SPORTS",$pluginName));
$SPORTS = urldecode($pluginSettings['SPORTS']);
//$ENABLED = urldecode(ReadSettingFromFile("ENABLED",$pluginName));
$ENABLED = urldecode($pluginSettings['ENABLED']);
//$SEPARATOR = urldecode(ReadSettingFromFile("SEPARATOR",$pluginName));
//	logEntry("MessageQueue plugin is not enabled/installed");
//}
//	print_r($pluginSettings);
//	echo "\n";
//$SPORTS = urldecode(ReadSettingFromFile("SPORTS",$pluginName));
$SPORTS = urldecode($pluginSettings['SPORTS']);
//$ENABLED = urldecode(ReadSettingFromFile("ENABLED",$pluginName));
$ENABLED = urldecode($pluginSettings['ENABLED']);
//$SEPARATOR = urldecode(ReadSettingFromFile("SEPARATOR",$pluginName));
$SEPARATOR = urldecode($pluginSettings['SEPARATOR']);
//$LAST_READ = urldecode(ReadSettingFromFile("LAST_READ",$pluginName));
$LAST_READ = $pluginSettings['LAST_READ'];
//echo "enabled: ".$ENABLED."\n";
//echo "ENABLED: ".$ENABLED."\n";
if ($ENABLED != "1") {
    logEntry("Plugin Status: DISABLED Please enable in Plugin Setup to use & Restart FPPD Daemon");
    lockHelper::unlock();
    exit(0);
}
//$SEPARATOR = urldecode(ReadSettingFromFile("SEPARATOR",$pluginName));
$SPORTS_READ = explode(",", $SPORTS);
//echo "Incoming sports reading: \n";
//print_r($SPORTS_READ);
//print_r($SPORTS_DATA_ARRAY);
$messageText = "";
for ($i = 0; $i <= count($SPORTS_READ) - 1; $i++) {
    //echo "Retrieving data for: ".$SPORTS_READ[$i]."\n";
    if (search_in_array($SPORTS_READ[$i], $SPORTS_DATA_ARRAY) > 0) {
        //echo $SPORTS_READ[$i]. " is in Sports data array\n";
        //fetch the information
        $sportsScores = file_get_contents($SPORTS_DATA_ARRAY[$i][1]);
    //echo "\nPrice: ".$stockValue;
    //echo "\nChange: ".$stockChange;
    if (count($quotesToGet) > 1 && $quoteIndex > 0) {
        $messageText .= " | ";
    }
    $messageText .= " " . $q . " " . $stockValue . " [" . $stockChange . "]";
    $quoteIndex++;
    //if there is more than one stock ticker, then put a PIPE symbol on the string
}
if ($MESSAGE_QUEUE_PLUGIN_ENABLED) {
    addNewMessage($messageText, $pluginName, $QUOTES);
} else {
    logEntry("MessageQueue plugin is not enabled/installed: Cannot add message: " . $messageText);
}
if ($IMMEDIATE_OUTPUT != "on" && $IMMEDIATE_OUTPUT != "1") {
    logEntry("NOT immediately outputting to matrix");
} else {
    logEntry("IMMEDIATE OUTPUT ENABLED");
    logEntry("Matrix location: " . $MATRIX_LOCATION);
    logEntry("Matrix Exec page: " . $MATRIX_EXEC_PAGE_NAME);
    if ($MATRIX_LOCATION != "127.0.0.1") {
        $remoteCMD = "/usr/bin/curl -s --basic 'http://" . $MATRIX_LOCATION . "/plugin.php?plugin=" . $MATRIX_MESSAGE_PLUGIN_NAME . "&page=" . $MATRIX_EXEC_PAGE_NAME . "&nopage=1' > /dev/null";
        logEntry("REMOTE MATRIX TRIGGER: " . $remoteCMD);
        exec($remoteCMD);
    } else {
        $IMMEDIATE_CMD = $settings['pluginDirectory'] . "/" . $MATRIX_MESSAGE_PLUGIN_NAME . "/matrix.php";
        logEntry("LOCAL command: " . $IMMEDIATE_CMD);
        exec($IMMEDIATE_CMD);
    }
}
lockHelper::unlock();
Exemplo n.º 10
0
//$DEBUG=true;
include_once "/opt/fpp/www/common.php";
include_once 'functions.inc.php';
include_once 'commonFunctions.inc.php';
$pluginName = "SMS";
$messageQueue_Plugin = "MessageQueue";
$MESSAGE_QUEUE_PLUGIN_ENABLED = false;
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
$messageQueuePluginPath = $settings['pluginDirectory'] . "/" . $messageQueue_Plugin . "/";
$messageQueueFile = urldecode(ReadSettingFromFile("MESSAGE_FILE", $messageQueue_Plugin));
if (file_exists($messageQueuePluginPath . "functions.inc.php")) {
    include $messageQueuePluginPath . "functions.inc.php";
    $MESSAGE_QUEUE_PLUGIN_ENABLED = true;
} else {
    logEntry("Message Queue Plugin not installed, some features will be disabled");
}
$gitURL = "https://github.com/LightsOnHudson/FPP-Plugin-SMS.git";
$pluginMessages = getPluginMessages($pluginName, 0);
//print_r($pluginMessages);
$messageCount = count($pluginMessages);
echo "<center><h1><b>" . $pluginName . " Message Management</b></h1></center> <br/> \n";
//echo "<textarea class=\"FormElement\" name=\"messages\" id=\"messages\" cols=\"40\" rows=\"".$messageCount."\">\n";
echo "<table cellspacing=\"3\" cellpadding=\"3\" border=\"1\"> \n";
for ($i = 0; $i <= $messageCount - 1; $i++) {
    echo "<tr> \n";
    $messageQueueParts = explode("|", $pluginMessages[$i]);
    //unix timestamp
    echo "<td> \n";
    echo date('d M Y H:i:s', $messageQueueParts[0]);
    echo "</td> \n";
$DEBUG = true;
$skipJSsettings = 1;
//include_once '/opt/fpp/www/config.php';
include_once '/opt/fpp/www/common.php';
$pluginName = "Switcher";
$pluginUpdateFile = $settings['pluginDirectory'] . "/" . $pluginName . "/" . "pluginUpdate.inc";
include_once 'functions.inc.php';
include_once 'commonFunctions.inc.php';
include 'switcherCommands.inc';
$myPid = getmypid();
$gitURL = "https://github.com/LightsOnHudson/FPP-Plugin-Switcher.git";
//arg0 is  the program
//arg1 is the first argument in the registration this will be --list
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
$sequenceExtension = ".fseq";
logEntry("plugin update file: " . $pluginUpdateFile);
//logEntry("open log file: ".$logFile);
if (isset($_POST['updatePlugin'])) {
    $updateResult = updatePluginFromGitHub($gitURL, $branch = "master", $pluginName);
    echo $updateResult . "<br/> \n";
}
if (isset($_POST['submit'])) {
    $IP = trim($_POST["IP"]);
    $PORT = trim($_POST["PORT"]);
    $BAUD_RATE = trim($_POST["BAUD_RATE"]);
    $CHAR_BITS = trim($_POST["CHAR_BITS"]);
    $STOP_BITS = trim($_POST["STOP_BITS"]);
    $PARITY = trim($_POST["PARITY"]);
    $DEVICE = trim($_POST["DEVICE"]);
    $DEVICE_CONNECTION_TYPE = trim($_POST["DEVICE_CONNECTION_TYPE"]);
    $ENABLED = $_POST["ENABLED"];
Exemplo n.º 12
0
if ($MATRIX_MESSAGE_TIMEOUT == "" || $MATRIX_MESSAGE_TIMEOUT == null) {
    $MESSAGE_TIMEOUT = 10;
} else {
    $MESSAGE_TIMEOUT = (int) trim($MATRIX_MESSAGE_TIMEOUT);
}
//echo "message timeout: ".$MESSAGE_TIMEOUT."\n";
//echo "message plugins to export: ".$MATRIX_PLUGIN_OPTIONS."\n";
//echo $messageQueueFile."\n";
if (file_exists($messageQueuePluginPath . "functions.inc.php")) {
    include $messageQueuePluginPath . "functions.inc.php";
    $MESSAGE_QUEUE_PLUGIN_ENABLED = true;
} else {
    logEntry("Message Queue not installed, cannot use this plugin with out it");
    lockHelper::unlock();
    exit(0);
}
if ($MESSAGE_QUEUE_PLUGIN_ENABLED) {
    $queueMessages = getNewPluginMessages($MATRIX_PLUGIN_OPTIONS);
    if ($queueMessages != null || $queueMessages != "") {
        //print_r($queueMessages);
        outputMessages($queueMessages);
    } else {
        logEntry("No messages file exists??");
    }
} else {
    logEntry("MessageQueue plugin is not enabled/installed");
    lockHelper::unlock();
    exit(0);
}
disableMatrixToolOutput();
lockHelper::unlock();
Exemplo n.º 13
0
if (!$NEW_MESSAGE) {
    logEntry("No New messages to process exiting", 0);
    lockHelper::unlock();
    exit(0);
}
if ($IMMEDIATE_OUTPUT != "on" && $IMMEDIATE_OUTPUT != "1") {
    logEntry("NOT immediately outputting to matrix");
} else {
    logEntry("IMMEDIATE OUTPUT ENABLED");
    logEntry("Forking Matrix command");
    logEntry("Matrix location: " . $MATRIX_LOCATION);
    logEntry("Matrix Exec page: " . $MATRIX_EXEC_PAGE_NAME);
    if ($MATRIX_LOCATION != "127.0.0.1") {
        $remoteCMD = "/usr/bin/curl -s --basic 'http://" . $MATRIX_LOCATION . "/plugin.php?plugin=" . $MATRIX_MESSAGE_PLUGIN_NAME . "&page=" . $MATRIX_EXEC_PAGE_NAME . "&nopage=1' > /dev/null";
        logEntry("REMOTE MATRIX TRIGGER: " . $remoteCMD);
        $forkResult = forkExec($remoteCMD);
        if ($DEBUG) {
            logEntry("DEBUG: Fork Result: " . $forkResult);
        }
        //exec($remoteCMD);
    } else {
        $IMMEDIATE_CMD = $settings['pluginDirectory'] . "/" . $MATRIX_MESSAGE_PLUGIN_NAME . "/matrix.php";
        logEntry("LOCAL command: " . $IMMEDIATE_CMD);
        $forkResult = forkExec($IMMEDIATE_CMD);
        if ($DEBUG) {
            logEntry("DEBUG: Fork Result: " . $forkResult);
        }
        //exec($IMMEDIATE_CMD);
    }
}
lockHelper::unlock();
function processCallback($argv)
{
    global $DEBUG, $pluginName;
    if ($DEBUG) {
        print_r($argv);
    }
    //argv0 = program
    //argv2 should equal our registration // need to process all the rgistrations we may have, array??
    //argv3 should be --data
    //argv4 should be json data
    $registrationType = $argv[2];
    $data = $argv[4];
    logEntry("PROCESSING CALLBACK: " . $registrationType);
    $clearMessage = FALSE;
    switch ($registrationType) {
        case "media":
            if ($argv[3] == "--data") {
                $data = trim($data);
                logEntry("DATA: " . $data);
                $obj = json_decode($data);
                $type = $obj->{'type'};
                logEntry("Type: " . $type);
                switch ($type) {
                    case "sequence":
                        logEntry("media sequence name received: ");
                        processSequenceName($obj->{'Sequence'}, "STATUS");
                        break;
                    case "media":
                        logEntry("We do not support type media at this time");
                        //$songTitle = $obj->{'title'};
                        //$songArtist = $obj->{'artist'};
                        //sendMessage($songTitle, $songArtist);
                        //exit(0);
                        break;
                    case "both":
                        logEntry("We do not support type media/both at this time");
                        //	logEntry("MEDIA ENTRY: EXTRACTING TITLE AND ARTIST");
                        //	$songTitle = $obj->{'title'};
                        //	$songArtist = $obj->{'artist'};
                        //	if($songArtist != "") {
                        //	sendMessage($songTitle, $songArtist);
                        //exit(0);
                        break;
                    default:
                        logEntry("We do not understand: type: " . $obj->{'type'} . " at this time");
                        exit(0);
                        break;
                }
            }
            break;
            exit(0);
        case "playlist":
            logEntry("playlist type received");
            if ($argv[3] == "--data") {
                $data = trim($data);
                logEntry("DATA: " . $data);
                $obj = json_decode($data);
                $sequenceName = $obj->{'sequence0'}->{'Sequence'};
                $sequenceAction = $obj->{'Action'};
                processSequenceName($sequenceName, $sequenceAction);
                //logEntry("We do not understand: type: ".$obj->{'type'}. " at this time");
                //      logEntry("We do not understand: type: ".$obj->{'type'}. " at this time");
            }
            break;
            exit(0);
        default:
            exit(0);
    }
}
function processCallback($argv)
{
    global $DEBUG, $pluginName;
    if ($DEBUG) {
        print_r($argv);
    }
    //argv0 = program
    //argv2 should equal our registration // need to process all the rgistrations we may have, array??
    //argv3 should be --data
    //argv4 should be json data
    $registrationType = $argv[2];
    $data = $argv[4];
    logEntry("PROCESSING CALLBACK");
    $clearMessage = FALSE;
    switch ($registrationType) {
        case "media":
            if ($argv[3] == "--data") {
                $data = trim($data);
                logEntry("DATA: " . $data);
                $obj = json_decode($data);
                $type = $obj->{'type'};
                switch ($type) {
                    case "sequence":
                        //$sequenceName = ;
                        processSequenceName($obj->{'Sequence'});
                        break;
                    case "media":
                        logEntry("We do not understand type media at this time");
                        exit(0);
                        break;
                    default:
                        logEntry("We do not understand: type: " . $obj->{'type'} . " at this time");
                        exit(0);
                        break;
                }
            }
            break;
            exit(0);
        default:
            exit(0);
    }
}
Exemplo n.º 16
0
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
$result = curl_exec($ch);
if (curl_errno($ch) !== 0) {
    unlink($lockFile);
    logEntry($logFile, "Error: " . curl_error($ch));
    exit(0);
} else {
    logEntry($logFile, "JSON Response: " . $result);
    var_dump($result);
    curl_close($ch);
}
//update send field (0 -> 1) in database if cdr is sent
try {
    $stm = $db->prepare("CALL update_cdr(?,?)");
    $stm->bindValue(1, $IdFirst - 1);
    $stm->bindValue(2, $selectedCDR + 1);
    $stm->execute();
    $stm->closeCursor();
    logEntry($logFile, "Updated IDs from ID_cdr:" . $IdFirst . " and next " . $selectedCDR . " IDs");
} catch (Exception $e) {
    logEntry($logFile, $e->getMessage() . ' - Stored procedure update_cdr() has failed.');
    throw new Exception($e->getMessage() . ' - Stored procedure update_cdr() has failed.');
    exit(0);
}
//remove lock file ----------------------------------------------
unlink($lockFile);
logEntry($logFile, " Lock File Closed" . PHP_EOL . PHP_EOL);
    WriteSettingToFile("MARKET_TYPE", urlencode($_POST["MARKET_TYPE"]), $pluginName);
    WriteSettingToFile("QUOTES", urlencode($_POST["QUOTES"]), $pluginName);
}
if (file_exists($pluginConfigFile)) {
    $pluginSettings = parse_ini_file($pluginConfigFile);
    if (urldecode($pluginSettings['DEBUG'] != "" || urldecode($pluginSettings['DEBUG'] != 0))) {
        $DEBUG = urldecode($pluginSettings['DEBUG']);
    }
    foreach ($pluginSettings as $key => $value) {
        if ($DEBUG) {
            echo "Key: " . $key . " " . $value . "\n";
        }
        ${$key} = urldecode($value);
    }
} else {
    logEntry("No plugin config file plugin." . $pluginName . " exists");
}
if ((int) $LAST_READ == 0 || $LAST_READ == "") {
    $LAST_READ = 0;
}
?>

<html>
<head>
</head>

<div id="StockTicker" class="settings">
<fieldset>
<legend>Stock Ticker Support Instructions</legend>

<p>Known Issues:
Exemplo n.º 18
0
    }
}
if (!$SWITCHER_FOUND) {
    logEntry("switcher command not found: exiting");
    exit(0);
}
$cmd = explode(",", $SWITCHER_CMD);
//print_r($cmd);
$i = 0;
for ($i = 0; $i <= count($cmd); $i++) {
    $switcher_cmd .= chr($cmd[$i]);
}
$SWITCHER_CMD = $switcher_cmd;
logEntry("-------");
logEntry("Sending command");
logEntry("Switcher cmd: " . $SWITCHER_CMD);
logEntry("Sending SERIAL COMMAND");
logEntry("SERIAL DEVICE: " . $SERIAL_DEVICE);
$serial = new phpSerial();
$serial->deviceSet($SERIAL_DEVICE);
$serial->confBaudRate($SWITCHER_BAUD);
$serial->confParity($SWITCHER_PARITY);
//        $serial->confFlowControl("none");
$serial->confCharacterLength($SWITCHER_CHAR_BITS);
$serial->confStopBits($SWITCHER_STOP_BITS);
$serial->deviceOpen();
$serial->sendMessage($SWITCHER_CMD);
sleep(1);
logEntry("RETURN DATA: " . hex_dump($serial->readPort()));
logEntry("RETURN DATA: " . $serial->readPort());
$serial->deviceClose();
#!/usr/bin/php
<?php 
error_reporting(0);
$pluginName = "SMS";
$DEBUG = false;
$myPid = getmypid();
$skipJSsettings = 1;
include_once "/opt/fpp/www/config.php";
include_once "/opt/fpp/www/common.php";
include_once "functions.inc.php";
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
$FPPDStatus = isFPPDRunning();
do {
    $cmd = "sudo /opt/fpp/bin/fpp -s > /tmp/FPP.playlist";
    exec($cmd, $tmp);
    sleep(1);
    $playlistName = file_get_contents("/tmp/FPP.playlist");
    logEntry("Playlist name = " . $playlistName);
    if ($playlistName == "false" && $FPPDStatus == "RUNNING") {
        logEntry("looping... playlist name should not be false..is FPPD running?");
    }
    if ($playlistName == "false" && $FPPDStatus != "RUNNING") {
        logEntry("FPPD Daemon is not running..exiting");
        exit(0);
    }
} while ($playlistName == "false");
$playlistName = getRunningPlaylist();
logEntry("We got a valid playlist status from fpp -s ");
$FONT_SIZE = $pluginSettings['FONT_SIZE'];
$PIXELS_PER_SECOND = $pluginSettings['PIXELS_PER_SECOND'];
$COLOR = urldecode($pluginSettings['COLOR']);
$INCLUDE_TIME = urldecode($pluginSettings['INCLUDE_TIME']);
$TIME_FORMAT = urldecode($pluginSettings['TIME_FORMAT']);
$HOUR_FORMAT = urldecode($pluginSettings['HOUR_FORMAT']);
//	echo "Matrix : ".$Matrix."<br/>\n";
//echo $messageQueueFile."\n";
if (file_exists($pluginDirectory . "/" . $fpp_matrixtools_Plugin . "/" . $fpp_matrixtools_Plugin_Script)) {
    logEntry($pluginDirectory . "/" . $fpp_matrixtools_Plugin . "/" . $fpp_matrixtools_Plugin_Script . " EXISTS: Enabling");
    $FPP_MATRIX_PLUGIN_ENABLED = true;
    //$cmdGetMatrixList = $pluginDirectory."/".$fpp_matrixtools_Plugin."/".$fpp_matrixtools_Plugin_Script. " --getblocklist";
    //exec($cmdGetMatrixList,$blockOutput);
    createMatrixEventFile();
} else {
    logEntry("FPP Matrix tools plugin is not installed, cannot use this plugin with out it");
    echo "FPP Matrix Tools plugin is not installed. Install the plugin and revisit this page to continue";
    exit(0);
    //exit(0);
}
//echo "sports read: ".$SPORTS."<br/> \n";
//	echo "Loading Matrix panels:<br/> \n";
//ob_flush();
?>

<html>
<head>
</head>

<div id="<?php 
echo $pluginName;
Exemplo n.º 21
0
            case "NEUTRINO":
                $profanityCheck = check_for_profanity_neutrinoapi($messageText);
                break;
            case "WEBPURIFY":
                $profanityCheck = check_for_profanity_WebPurify($messageText);
                break;
            default:
                //default turn off profanity check
                $profanityCheck == false;
                break;
        }
        if (!$profanityCheck) {
            logEntry("Message: " . $messageText . " PASSED");
            // $gv->sendSMS($from,$REPLY_TEXT);
            $subject = "";
            processMessage($from, $messageText);
            sendResponse($from, $REPLY_TEXT, $from, $subject);
            sleep(1);
        } else {
            $subject = "";
            logEntry("message: " . $messageText . " FAILED");
            $PROFANITY_REPLY_TEXT = "Your message contains profanity, sorry. More messages like these will ban your phone number";
            $subject = "";
            sendResponse($from, $PROFANITY_REPLY_TEXT, $from, $subject);
            sleep(1);
        }
    }
}
/* close the connection */
imap_close($mbox);
lockHelper::unlock();
Exemplo n.º 22
0
function runQuery($query)
{
    $result = mysql_query($query);
    if ($result === FALSE) {
        logEntry('error', mysql_error() . "\n" . $query);
    }
}
Exemplo n.º 23
0
    exit(0);
}
$EMAIL = urldecode(ReadSettingFromFile("EMAIL", $pluginName));
$PASSWORD = urldecode(ReadSettingFromFile("PASSWORD", $pluginName));
$PLAYLIST_NAME = urldecode(ReadSettingFromFile("PLAYLIST_NAME", $pluginName));
$WHITELIST_NUMBERS = urldecode(ReadSettingFromFile("WHITELIST_NUMBERS", $pluginName));
$CONTROL_NUMBERS = urldecode(ReadSettingFromFile("CONTROL_NUMBERS", $pluginName));
$REPLY_TEXT = urldecode(ReadSettingFromFile("REPLY_TEXT", $pluginName));
$VALID_COMMANDS = urldecode(ReadSettingFromFile("VALID_COMMANDS", $pluginName));
$COMMAND_ARRAY = explode(",", trim(strtoupper($VALID_COMMANDS)));
$CONTROL_NUMBER_ARRAY = explode(",", $CONTROL_NUMBERS);
$PLAYLIST_NAME = getRunningPlaylist();
//none at this time
$callbackRegisters = "media";
//$callbackRegisters = "playlist,media";
//var_dump($argv);
$FPPD_COMMAND = $argv[1];
//echo "FPPD Command: ".$FPPD_COMMAND."<br/> \n";
if ($FPPD_COMMAND == "--list") {
    echo $callbackRegisters;
    logEntry("FPPD List Registration request: responded:" . $callbackRegisters);
    exit(0);
}
if ($FPPD_COMMAND == "--type") {
    logEntry("type callback requested");
    //we got a register request message from the daemon
    processCallback($argv);
    exit(0);
}
logEntry($argv[0] . " called with no parameteres");
exit(0);