From 05540fbde1dc06171411dc19f450e63da57fbe71 Mon Sep 17 00:00:00 2001 From: stsdc Date: Fri, 24 Mar 2017 21:18:13 +0100 Subject: [PATCH] refactoring --- lib/ultron/ultron.php | 6 ++++++ page-templates/lab.php | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ultron/ultron.php b/lib/ultron/ultron.php index 39dccb5..e0df5b6 100755 --- a/lib/ultron/ultron.php +++ b/lib/ultron/ultron.php @@ -51,5 +51,11 @@ function write_all_the_shit ($esp_data) { echo 'OK'; } +function isESP ($esp_data) { + if(check_header('HTTP_USER_AGENT', 'ESP8266-IoT') OR isset($esp_data) OR check_header('HTTP_ESP8266_AUTH_KEY', 'e9b4dbb90c565d901b086169e77c8eaf')) { + return true; + } +} + ?> diff --git a/page-templates/lab.php b/page-templates/lab.php index 18f852e..a5ccc02 100755 --- a/page-templates/lab.php +++ b/page-templates/lab.php @@ -4,15 +4,13 @@ */ ?>