From 55b437e93b41f613a0691af4c0103bd1b608f791 Mon Sep 17 00:00:00 2001 From: edward Date: Wed, 30 Mar 2016 18:20:21 +0800 Subject: [PATCH] RooTrait.php --- RooTrait.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/RooTrait.php b/RooTrait.php index d5feecf5..752a9c4d 100644 --- a/RooTrait.php +++ b/RooTrait.php @@ -2,4 +2,47 @@ trait Pman_Core_RooTrait { + function init() + { + if (isset($this->_hasInit)) { + return; + } + + $this->_hasInit = true; + + $boot = HTML_FlexyFramework::get(); + + $this->appName= $boot->appName; + $this->appNameShort= $boot->appNameShort; + $this->appModules= $boot->enable; + $this->isDev = empty($boot->Pman['isDev']) ? false : $boot->Pman['isDev']; + $this->appDisable = $boot->disable; + $this->appDisabled = explode(',', $boot->disable); + $this->version = $boot->version; + $this->uiConfig = empty($boot->Pman['uiConfig']) ? false : $boot->Pman['uiConfig']; + + if (!empty($ff->Pman['local_autoauth']) && + ($_SERVER['SERVER_ADDR'] == '127.0.0.1') && + ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') + ) { + $this->isDev = true; + } + + } + + function checkDebugPost() + { + return (!empty($_GET['_post']) || !empty($_GET['_debug_post'])) && + $this->authUser && + method_exists($this->authUser,'groups') && + in_array('Administrators', $this->authUser->groups('name')); + } + + function checkDebug($req = false) + { + /* + * Not allow to doing this + */ + return false; + } } -- 2.39.2