From e07fc159cf58e47c6350794cefad68b862354d89 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 26 Aug 2016 15:02:40 +1000 Subject: [PATCH] Minor fixes for rendering --- classes/lnApp/Auth/ORM.php | 6 +++++- views/theme/baseadmin/page.php | 4 ++-- views/theme/bootstrap/page.php | 4 ++-- views/theme/focusbusiness/page.php | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/classes/lnApp/Auth/ORM.php b/classes/lnApp/Auth/ORM.php index 468186e..329c898 100644 --- a/classes/lnApp/Auth/ORM.php +++ b/classes/lnApp/Auth/ORM.php @@ -32,7 +32,11 @@ abstract class lnApp_Auth_ORM extends Kohana_Auth_ORM { * @return Model_Account|NULL The user that the token is valid for. */ protected function _get_token_user($token) { - list($id,$key) = explode(':',$token,2); + try { + list($id,$key) = explode(':',$token,2); + } catch (Exception $e) { + return ORM::factory('Account'); + } $uo = ORM::factory('Account',$id); diff --git a/views/theme/baseadmin/page.php b/views/theme/baseadmin/page.php index a9af071..c8b72ac 100644 --- a/views/theme/baseadmin/page.php +++ b/views/theme/baseadmin/page.php @@ -14,7 +14,7 @@ = Kohana::TESTING OR (Request::current() AND Request::current()->secure())) { + if (Kohana::$environment >= Kohana::TESTING OR (is_object(Request::current()) AND Request::current()->secure())) { echo HTML::style('media/theme/bootstrap/css/bootstrap.min.css'); echo HTML::style('media/vendor/font-awesome/css/font-awesome.min.css'); } else { @@ -127,7 +127,7 @@ = Kohana::TESTING OR (Request::current() AND Request::current()->secure())) { + if (Kohana::$environment >= Kohana::TESTING OR (is_object(Request::current()) AND Request::current()->secure())) { echo HTML::script('media/js/jquery/jquery-1.9.1.min.js'); echo HTML::script('media/theme/bootstrap/js/bootstrap.min.js'); echo HTML::script('media/js/lodash/lodash-1.2.1.min.js'); diff --git a/views/theme/bootstrap/page.php b/views/theme/bootstrap/page.php index c1c5181..5ce76aa 100644 --- a/views/theme/bootstrap/page.php +++ b/views/theme/bootstrap/page.php @@ -14,7 +14,7 @@ = Kohana::TESTING OR (Request::current() AND Request::current()->secure())) { + if (Kohana::$environment >= Kohana::TESTING OR (is_object(Request::current()) AND Request::current()->secure())) { echo HTML::style('media/theme/bootstrap/css/bootstrap.min.css'); echo HTML::style('media/theme/bootstrap/css/bootstrap-theme.min.css'); echo HTML::style('media/vendor/font-awesome/css/font-awesome.min.css'); @@ -103,7 +103,7 @@ = Kohana::TESTING OR (Request::current() AND Request::current()->secure())) { + if (Kohana::$environment >= Kohana::TESTING OR (is_object(Request::current()) AND Request::current()->secure())) { echo HTML::script('media/js/jquery/jquery-1.9.1.min.js'); echo HTML::script('media/theme/bootstrap/js/bootstrap.min.js'); echo HTML::script('media/js/lodash/lodash-1.2.1.min.js'); diff --git a/views/theme/focusbusiness/page.php b/views/theme/focusbusiness/page.php index 8325e86..5557d3d 100644 --- a/views/theme/focusbusiness/page.php +++ b/views/theme/focusbusiness/page.php @@ -14,7 +14,7 @@ = Kohana::TESTING OR (Request::current() AND Request::current()->secure())) { + if (Kohana::$environment >= Kohana::TESTING OR (is_object(Request::current()) AND Request::current()->secure())) { echo HTML::style('media/theme/bootstrap/css/bootstrap.min.css'); echo HTML::style('media/vendor/font-awesome/css/font-awesome.min.css'); } else { @@ -102,7 +102,7 @@ = Kohana::TESTING OR (Request::current() AND Request::current()->secure())) { + if (Kohana::$environment >= Kohana::TESTING OR (is_object(Request::current()) AND Request::current()->secure())) { echo HTML::script('media/js/jquery/jquery-1.9.1.min.js'); echo HTML::script('media/theme/bootstrap/js/bootstrap.min.js'); } else {