From 2a71bacfc5536279bbc5e238fb6a07c03e85d12d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Oct 2011 00:18:51 -0400 Subject: Edit individual.html to allow showing multiple users at once. Add a hack to the Users.class controller to show all users for the "all" username. Mark "all" as forbiddent in the Auth.class model. --- src/views/pages/users/individual.html.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/views') diff --git a/src/views/pages/users/individual.html.php b/src/views/pages/users/individual.html.php index c630515..39360b7 100644 --- a/src/views/pages/users/individual.html.php +++ b/src/views/pages/users/individual.html.php @@ -1,6 +1,7 @@ 1) { + $t->header("Users: $username"); +} else { + $t->header("User: $username"); +} + +foreach($users as $user) { $username = $user->getName(); -$t->header("User: $username"); $t->tag('h1', array(), ($user->canEdit()?'Edit':'View')." User $username (UID: ".$user->getUID().")"); @@ -136,4 +143,5 @@ if ($user->canEdit()) { $t->tag('input', array('type'=>'submit', 'value'=>'Save')); } $t->closeTag('form'); +} $t->footer(); -- cgit v1.2.3-2-g168b From f21d82c9eff383d2c1c45c94af5f6c355e3258b2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Oct 2011 01:05:11 -0400 Subject: Properly use thead and tbody. --- src/views/pages/users/index.html.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/views') diff --git a/src/views/pages/users/index.html.php b/src/views/pages/users/index.html.php index 7f51592..caedf5c 100644 --- a/src/views/pages/users/index.html.php +++ b/src/views/pages/users/index.html.php @@ -13,14 +13,27 @@ $t->openTag('form', array('action'=>$t->url('users/index'), $t->tag('input', array('type'=>'submit', 'value'=>'Save/Update')); -$t->openTag('table'); +$t->openTag('table', array('class'=>'sortable', 'id'=>'bar')); +$t->openTag('thead'); $t->openTag('tr'); foreach ($attribs as $attrib) { $t->tag('th', array(), $attrib['name']); } -$t->tag('th'); +$t->tag('th', array(), '-'); $t->closeTag('tr'); +$t->closeTag('thead'); + +$t->openTag('tfoot'); +$t->openTag('tr'); +foreach ($attribs as $attrib) { + $t->tag('th', array(), $attrib['name']); +} +$t->tag('th', array(), '-'); +$t->closeTag('tr'); +$t->closeTag('tfoot'); + +$t->openTag('tbody'); foreach ($users as $user) { $t->openTag('tr'); @@ -48,6 +61,7 @@ foreach ($users as $user) { $arr['value'] = 'true'; $arr['type'] = 'checkbox'; } else { + $t->tag('span', array('class'=>'cell_width'), $value); $arr['value'] = $value; $arr['type'] = 'text'; } @@ -66,13 +80,7 @@ foreach ($users as $user) { $t->closeTag('tr'); } -$t->openTag('tr'); -foreach ($attribs as $attrib) { - $t->tag('th', array(), $attrib['name']); -} -$t->tag('th'); -$t->closeTag('tr'); - +$t->closeTag('tbody'); $t->closeTag('table'); $t->tag('input', array('type'=>'submit', -- cgit v1.2.3-2-g168b From 710942016b2a363f1301259dac01410188707d85 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Oct 2011 14:58:30 -0400 Subject: Change users/index.html a bit depending on if logged in or not. --- src/views/pages/users/index.html.php | 58 +++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'src/views') diff --git a/src/views/pages/users/index.html.php b/src/views/pages/users/index.html.php index daed9f7..d004c54 100644 --- a/src/views/pages/users/index.html.php +++ b/src/views/pages/users/index.html.php @@ -2,6 +2,7 @@ $t = $VARS['template']; $attribs = $VARS['attribs']; $users = $VARS['users']; +require_once('Login.class.php'); $t->header('Users'); @@ -10,35 +11,34 @@ $t->paragraph($t->link($t->url('users.csv'), "Download this as a spreadsheet.")) $t->openTag('form', array('action'=>$t->url('users/index'), 'method'=>'post')); -$t->tag('input', array('type'=>'submit', - 'value'=>'Save/Update')); +if (Login::isLoggedIn()) { + $t->tag('input', array('type'=>'submit', + 'value'=>'Save/Update')); +} $t->openTag('table', array('class'=>'sortable', 'id'=>'bar')); -$t->openTag('thead'); -$t->openTag('tr'); -foreach ($attribs as $attrib) { - switch ($attrib['type']) { - case 'bool': $class = 'small'; break; - default: $class = ''; break; +function table_head($attribs, $t) { + $t->openTag('tr'); + foreach ($attribs as $attrib) { + switch ($attrib['type']) { + case 'bool': $class = 'small'; break; + default: $class = ''; break; + } + $t->tag('th', array('class'=>$class), $attrib['name']); + } + if (Login::isLoggedIn()) { + $t->tag('th', array(), '-'); } - $t->tag('th', array('class'=>$class), $attrib['name']); + $t->closeTag('tr'); } -$t->tag('th', array(), '-'); -$t->closeTag('tr'); + +$t->openTag('thead'); +table_head($attribs, $t); $t->closeTag('thead'); $t->openTag('tfoot'); -$t->openTag('tr'); -foreach ($attribs as $attrib) { - switch ($attrib['type']) { - case 'bool': $class = 'small'; break; - default: $class = ''; break; - } - $t->tag('th', array('class'=>$class), $attrib['name']); -} -$t->tag('th', array(), '-'); -$t->closeTag('tr'); +table_head($attribs, $t); $t->closeTag('tfoot'); $t->openTag('tbody'); @@ -85,18 +85,20 @@ foreach ($users as $user) { $t->closeTag('td'); } - $t->openTag('td'); - $t->link($t->url('users/'.$user['auth_name']['value']), 'More'); - $t->closeTag('td'); - + if (Login::isLoggedIn()) { + $t->openTag('td'); + $t->link($t->url('users/'.$user['auth_name']['value']), 'More'); + $t->closeTag('td'); + } $t->closeTag('tr'); } $t->closeTag('tbody'); $t->closeTag('table'); -$t->tag('input', array('type'=>'submit', - 'value'=>'Save/Update')); -$t->closeTag('form'); +if (Login::isLoggedIn()) { + $t->tag('input', array('type'=>'submit', + 'value'=>'Save/Update')); +} $t->footer(); -- cgit v1.2.3-2-g168b From 2e769649abf4f9b3712287e24eb42c5a93a8035e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Oct 2011 15:41:59 -0400 Subject: Link to the userlist from the user registration page, if anon_userlist is enabled. --- src/views/pages/users/new.html.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/views') diff --git a/src/views/pages/users/new.html.php b/src/views/pages/users/new.html.php index 8b6bdf8..9df376f 100644 --- a/src/views/pages/users/new.html.php +++ b/src/views/pages/users/new.html.php @@ -7,6 +7,16 @@ $t->openTag('form', array('method'=>'post', 'action'=>$t->url('users'))); $t->openFieldset("New User: Step 1"); + +if ($VARS['userlist']) { + $t->inputP("If you may have already created a username, please, ". + "please check the ". + $t->link($t->url('users/'), 'user-list', true). + " to find your old username, instead of creating a new ". + "user. If you don't like the name, you can log in and ". + "change it."); +} + if (in_array('illegal name', $VARS['errors'])) { $t->inputP("That is a forbidden username.", true); } -- cgit v1.2.3-2-g168b From 93b1163cba7edf1a0a7e7ae787e06434de119dad Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Oct 2011 15:46:25 -0400 Subject: Fix the markup with the spreadsheet link in the user index. --- src/views/pages/users/index.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/views') diff --git a/src/views/pages/users/index.html.php b/src/views/pages/users/index.html.php index caedf5c..2650c5a 100644 --- a/src/views/pages/users/index.html.php +++ b/src/views/pages/users/index.html.php @@ -5,7 +5,7 @@ $users = $VARS['users']; $t->header('Users'); -$t->paragraph($t->link($t->url('users.csv'), "Download this as a spreadsheet.")); +$t->paragraph($t->link($t->url('users.csv'), "Download this as a spreadsheet.", true)); $t->openTag('form', array('action'=>$t->url('users/index'), 'method'=>'post')); -- cgit v1.2.3-2-g168b