Update report.php
[clinton/MarylandElectronicPetitionSignature.git] / slack.php
index a096c8f..f4b7e8a 100644 (file)
--- a/slack.php
+++ b/slack.php
@@ -1,6 +1,7 @@
 <?PHP
 include_once('/var/www/secure.php');
-slack_general_admin
+
+include_once('bots.php');
 
 function slack_general_admin($msg,$room){
        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
@@ -10,15 +11,17 @@ function slack_general_admin($msg,$room){
        } else {
                $ip = $_SERVER['REMOTE_ADDR'];
        }
-       if ($ip == '69.250.28.138'){
-               return 'developer';
-               die();
-       }
+       //if ($ip == '69.250.28.138'){
+       //      return 'developer';
+       //      die();
+       //}
        global $slack_api;
+       global $time_on_site;
        $room = str_replace("'",'-',strtolower(str_replace(' ','-',$room)));
        $thisroom = $room;
-       $add = "[".$ip."][".$_SERVER['HTTP_USER_AGENT']."][".$_SERVER['PHP_SELF']."] ";
-       //$msg = $add.$msg;
+       $add = "[".$time_on_site." seconds]"; 
+       //$add = "[".$ip."][".$_SERVER['HTTP_USER_AGENT']."][".$_SERVER['PHP_SELF']."] ";
+       $msg = $add.$msg;
        //$msg = str_replace('http://','_______',$msg);
        //$msg = str_replace('https://','________',$msg);
        //$msg = str_replace('.net','____',$msg);
@@ -51,9 +54,9 @@ function slack_general_admin($msg,$room){
        $html = curl_exec ($curl);
        curl_close ($curl);
        if (empty($html)){
-           return $url;
+           //return $url;
        }
-       return $html;
+       //return $html;
 }
 
 function slack_general($msg,$room){
@@ -64,14 +67,15 @@ function slack_general($msg,$room){
        } else {
                $ip = $_SERVER['REMOTE_ADDR'];
        }
-       if ($ip == '69.250.28.138'){
-               return 'developer';
-               die();
-       }
+       //if ($ip == '69.250.28.138'){
+       //      return 'developer';
+       //      die();
+       //}
+       global $time_on_site;
        global $slack_api;
        $room = str_replace("'",'-',strtolower(str_replace(' ','-',$room)));
        $thisroom = $room;
-       $add = "[".$ip."][".$_SERVER['HTTP_USER_AGENT']."][".$_SERVER['PHP_SELF']."] ";
+       $add = "[".$time_on_site." seconds][".$ip."][".$_SERVER['HTTP_USER_AGENT']."][".$_SERVER['PHP_SELF']."] ";
        $msg = $add.$msg;
        //$msg = str_replace('http://','_______',$msg);
        //$msg = str_replace('https://','________',$msg);
@@ -105,7 +109,7 @@ function slack_general($msg,$room){
        $html = curl_exec ($curl);
        curl_close ($curl);
        if (empty($html)){
-           return $url;
+           //return $url;
        }
-       return $html;
+       //return $html;
 }