diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-03-13 00:42:19 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-03-13 00:42:19 +0000 |
commit | e7eebe74d672416ccbe0dd837d5ef3d5bda145cb (patch) | |
tree | 8537aedac5ada02578e37c429b788adcaefc5c35 /h-source/Application/Controllers | |
parent | c6e6d09dba4bb4807e5c6b4f8d23954019c6b38d (diff) |
modified UsersController.php
Diffstat (limited to 'h-source/Application/Controllers')
-rw-r--r-- | h-source/Application/Controllers/BaseController.php | 8 | ||||
-rw-r--r-- | h-source/Application/Controllers/UsersController.php | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php index 5340954..697b79b 100644 --- a/h-source/Application/Controllers/BaseController.php +++ b/h-source/Application/Controllers/BaseController.php @@ -24,6 +24,7 @@ class BaseController extends Controller { protected $lang; + protected $islogged = 'no'; protected $ismoderator = false; protected $isadmin = false; protected $querySanitized = true; @@ -57,6 +58,7 @@ class BaseController extends Controller $this->s['registered']->checkStatus(); $data['username'] = null; + $data['user_groups'] = null; $data['islogged'] = 'no'; $data['token'] = 'token'; $data['ismoderator'] = false; @@ -65,7 +67,13 @@ class BaseController extends Controller if ($this->s['registered']->status['status'] === 'logged') { $data['username'] = $this->s['registered']->status['user']; + $groups = $this->s['registered']->status['groups']; + $groups[] = 'registered'; + $data['user_groups'] = implode(',',$groups); + $data['islogged'] = 'yes'; + $this->islogged = $data['islogged']; + $data['token'] = $this->s['registered']->status['token']; $this->token = $data['token']; diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php index c46da88..b55a461 100644 --- a/h-source/Application/Controllers/UsersController.php +++ b/h-source/Application/Controllers/UsersController.php @@ -117,6 +117,17 @@ class UsersController extends BaseController $this->append($data); $this->load('logout'); } + + public function info($lang = 'en') + { + $this->s['registered']->checkStatus(); + + $data['user_status'] = strcmp($this->islogged,'yes') === 0 ? 'logged' : 'not-logged'; + + $this->append($data); + $this->clean(); + $this->load('info'); + } public function add($lang = 'en') { |