aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Controllers')
-rw-r--r--h-source/Application/Controllers/BaseController.php8
-rw-r--r--h-source/Application/Controllers/UsersController.php11
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')
{