summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/controllers/Users.class.php29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/controllers/Users.class.php b/src/controllers/Users.class.php
index df00663..24bb8aa 100644
--- a/src/controllers/Users.class.php
+++ b/src/controllers/Users.class.php
@@ -308,11 +308,13 @@ class Users extends Controller {
private function show_index($routed, $remainder) {
global $mm; $db = $mm->database();
+ /*
$logged_in_user = Auth::getObj(Login::isLoggedIn());
if (!$logged_in_user->isUser()) {
$this->http401($routed, $remainder);
exit();
}
+ */
$vars = array();
$vars['attribs'] = $this->getIndexAttribs();
@@ -333,18 +335,25 @@ class Users extends Controller {
return array('key'=>$key, 'name'=>$name, 'type'=>$type);
}
private function getIndexAttribs() {
+ $user = Auth::getObj(Login::isLoggedIn());
+
$attribs = array();
- $attribs[] = $this->attrib('auth_user', 'Active', 'bool');
- if (Auth::getObj(Login::isLoggedIn())->isAdmin()) {
- $attribs[] = $this->attrib('auth_admin', 'Admin', 'bool');
- $attribs[] = $this->attrib('auth_delete', 'Delete', 'bool');
+ if ($user->isUser()) {
+ $attribs[] = $this->attrib('auth_uid', 'UID');
+ $attribs[] = $this->attrib('auth_user', 'Active', 'bool');
+ if ($user->isAdmin()) {
+ $attribs[] = $this->attrib('auth_admin', 'Admin', 'bool');
+ $attribs[] = $this->attrib('auth_delete', 'Delete', 'bool');
+ }
+ $attribs[] = $this->attrib('lastname','Last');
+ $attribs[] = $this->attrib('firstname','First');
+ $attribs[] = $this->attrib('hsclass','Class of');
+ $attribs[] = $this->attrib('phone','Phone number');
+ $attribs[] = $this->attrib('email','Email');
+ } else {
+ $attribs[] = $this->attrib('auth_uid', 'UID');
+ $attribs[] = $this->attrib('auth_name', 'Username');
}
- $attribs[] = $this->attrib('lastname','Last');
- $attribs[] = $this->attrib('firstname','First');
- $attribs[] = $this->attrib('hsclass','Class of');
- $attribs[] = $this->attrib('phone','Phone number');
- $attribs[] = $this->attrib('email','Email');
- $attribs[] = $this->attrib('auth_name', 'Username');
return $attribs;
}