From d6496c22d80987b565b69b5f119b32936db46e06 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 7 Jan 2016 15:24:49 -0500 Subject: [PATCH 1/7] Create hash.php --- controllers/hash.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 controllers/hash.php diff --git a/controllers/hash.php b/controllers/hash.php new file mode 100644 index 00000000..dca1e80e --- /dev/null +++ b/controllers/hash.php @@ -0,0 +1,7 @@ + trim(`git rev-parse HEAD`) + ) + ); +?> From 4d73bfcf72292d69867affe98680c267f39304a6 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 7 Jan 2016 15:26:07 -0500 Subject: [PATCH 2/7] Create calendar.php --- controllers/calendar.php | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 controllers/calendar.php diff --git a/controllers/calendar.php b/controllers/calendar.php new file mode 100644 index 00000000..65f6fa8a --- /dev/null +++ b/controllers/calendar.php @@ -0,0 +1,5 @@ + From 0387618e40799a96024cfc5e963f9dbfea779b18 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 7 Jan 2016 15:33:18 -0500 Subject: [PATCH 3/7] Create gzip.php --- controllers/functions/gzip.php | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 controllers/functions/gzip.php diff --git a/controllers/functions/gzip.php b/controllers/functions/gzip.php new file mode 100644 index 00000000..77d0d39d --- /dev/null +++ b/controllers/functions/gzip.php @@ -0,0 +1,42 @@ + array( + "method" => "GET", + "header" => "Accept-Language: en-US,en;q=0.8rn" . "Accept-Encoding: gzip,deflate,sdchrn" . "Accept-Charset:UTF-8,*;q=0.5rn" . "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 FirePHP/0.4rn", + "ignore_errors" => true + ), + /* + * @array + * Put a Band-Aid over some SSL issues. + */ + "ssl" => array( + "verify_peer" => false, + "verify_peer_name" => false + ) + ); + $context = stream_context_create($opts); + $content = file_get_contents($url, false, $context); + /* + * @note If http response header mentions that content is gzipped, then uncompress it. + */ + foreach($http_response_header as $c => $h) { + if(stristr($h, "content-encoding") and stristr($h, "gzip") { + /* + * @note Now, let's begin the actual purpose of this function: + */ + $content = gzinflate(substr($content, 10, -8)); + } + } + return $content; + } +?> From edde3320f00876d946982ac7883c512257f1d03c Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 7 Jan 2016 15:34:24 -0500 Subject: [PATCH 4/7] Update calendar.js --- js/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/calendar/calendar.js b/js/calendar/calendar.js index 0bd10624..546a8d25 100644 --- a/js/calendar/calendar.js +++ b/js/calendar/calendar.js @@ -11,7 +11,7 @@ var calendar = { calendar.updateData = function (callback) { - new ical_parser("calendar.php" + "?url="+encodeURIComponent(config.calendar.url), function(cal) { + new ical_parser("controllers/calendar.php" + "?url="+encodeURIComponent(config.calendar.url), function(cal) { var events = cal.getEvents(); this.eventList = []; From 1a8c3387fec9bdd30aae60cdc9a3636c0f4b29ba Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 7 Jan 2016 15:34:45 -0500 Subject: [PATCH 5/7] Update version.js --- js/version/version.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/version/version.js b/js/version/version.js index 73dee25a..9a9a682c 100644 --- a/js/version/version.js +++ b/js/version/version.js @@ -10,7 +10,7 @@ version.checkVersion = function () { $.ajax({ type: 'GET', - url: 'githash.php', + url: 'controllers/hash.php', success: function (data) { // The githash variable is located in index.php if (data && data.gitHash !== gitHash) { @@ -31,4 +31,4 @@ version.init = function () { this.checkVersion(); }.bind(this), this.updateInterval); -} \ No newline at end of file +} From 2005a04469c4de28244a5708e1018637fce06960 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 7 Jan 2016 15:36:31 -0500 Subject: [PATCH 6/7] Delete githash.php --- githash.php | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 githash.php diff --git a/githash.php b/githash.php deleted file mode 100644 index 9a839edf..00000000 --- a/githash.php +++ /dev/null @@ -1,2 +0,0 @@ -trim(`git rev-parse HEAD`))); \ No newline at end of file From a68be5e096db5311d0cc685a1329294fc0d684a9 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 7 Jan 2016 15:36:38 -0500 Subject: [PATCH 7/7] Delete calendar.php --- calendar.php | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 calendar.php diff --git a/calendar.php b/calendar.php deleted file mode 100644 index 22f62694..00000000 --- a/calendar.php +++ /dev/null @@ -1,45 +0,0 @@ -array( - 'method'=>"GET", - 'header'=>"Accept-Language: en-US,en;q=0.8rn" . - "Accept-Encoding: gzip,deflate,sdchrn" . - "Accept-Charset:UTF-8,*;q=0.5rn" . - "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 FirePHP/0.4rn", - "ignore_errors" => true //Fix problems getting data - ), - //Fixes problems in ssl - "ssl" => array( - "verify_peer"=>false, - "verify_peer_name"=>false - ) - ); - - $context = stream_context_create($opts); - $content = file_get_contents($url ,false,$context); - - //If http response header mentions that content is gzipped, then uncompress it - foreach($http_response_header as $c => $h) - { - if(stristr($h, 'content-encoding') and stristr($h, 'gzip')) - { - //Now lets uncompress the compressed data - $content = gzinflate( substr($content,10,-8) ); - } - } - - return $content; - }