RooTrait.php
[Pman.Core] / RooTrait.php
1 <?php
2
3 trait Pman_Core_RooTrait {
4     
5     function init() 
6     {
7         if (isset($this->_hasInit)) {
8             return;
9         }
10         
11         $this->_hasInit = true;
12         
13         $boot = HTML_FlexyFramework::get();
14         
15         $this->appName= $boot->appName;
16         $this->appNameShort= $boot->appNameShort;
17         $this->appModules= $boot->enable;
18         $this->isDev = empty($boot->Pman['isDev']) ? false : $boot->Pman['isDev'];
19         $this->appDisable = $boot->disable;
20         $this->appDisabled = explode(',', $boot->disable);
21         $this->version = $boot->version; 
22         $this->uiConfig = empty($boot->Pman['uiConfig']) ? false : $boot->Pman['uiConfig']; 
23         
24         if (!empty($ff->Pman['local_autoauth']) && 
25             ($_SERVER['SERVER_ADDR'] == '127.0.0.1') &&
26             ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') 
27         ) {
28             $this->isDev = true;
29         }
30         
31     }
32     
33     function checkDebugPost()
34     {
35         return (!empty($_GET['_post']) || !empty($_GET['_debug_post'])) && 
36                     $this->authUser && 
37                     method_exists($this->authUser,'groups') &&
38                     in_array('Administrators', $this->authUser->groups('name')); 
39     }
40     
41     function checkDebug($req = false)
42     {
43         /*
44          * Not allow to doing this
45          */
46         return false;
47     }
48 }