diff --git a/src/IDF/Views/Admin.php b/src/IDF/Views/Admin.php index 8f16f14..28b4a4b 100644 --- a/src/IDF/Views/Admin.php +++ b/src/IDF/Views/Admin.php @@ -147,10 +147,18 @@ class IDF_Views_Admin * */ public $users_precond = array('Pluf_Precondition::staffRequired'); - public function users($request, $match) + public function users($request, $match, $not_validated=false) { - $title = __('User List'); $pag = new Pluf_Paginator(new Pluf_User()); + $db =& Pluf::db(); + $true = Pluf_DB_BooleanToDb(true, $db); + if ($not_validated) { + $pag->forced_where = new Pluf_SQL('first_name = \'---\' AND active!='.$true); + $title = __('Not Validated User List'); + } else { + $pag->forced_where = new Pluf_SQL('first_name != \'---\' AND active='.$true); + $title = __('User List'); + } $pag->class = 'recent-issues'; $pag->summary = __('This table shows the users in the forge.'); $pag->action = 'IDF_Views_Admin::users'; @@ -164,7 +172,7 @@ class IDF_Views_Admin array('active', 'IDF_Views_Admin_bool', __('Active')), array('last_login', 'Pluf_Paginator_DateYMDHM', __('Last Login')), ); - $pag->extra_classes = array('', 'a-c', 'a-c', 'a-c', 'a-c', 'a-c'); + $pag->extra_classes = array('', '', 'a-c', 'a-c', 'a-c', 'a-c'); $pag->configure($list_display, array(), array('login')); $pag->items_per_page = 50; $pag->no_results_text = __('No users were found.'); @@ -173,9 +181,19 @@ class IDF_Views_Admin array( 'page_title' => $title, 'users' => $pag, + 'not_validated' => $not_validated, ), $request); } + + /** + * Not validated users. + */ + public $usersNotValidated_precond = array('Pluf_Precondition::staffRequired'); + public function usersNotValidated($request, $match) + { + return $this->users($request, $match, true); + } /** * Edition of a user. diff --git a/src/IDF/conf/urls.php b/src/IDF/conf/urls.php index dd9c4e2..d9cfcc2 100644 --- a/src/IDF/conf/urls.php +++ b/src/IDF/conf/urls.php @@ -423,6 +423,12 @@ $ctl[] = array('regex' => '#^/admin/users/$#', 'model' => 'IDF_Views_Admin', 'method' => 'users'); +$ctl[] = array('regex' => '#^/admin/users/notvalid/$#', + 'base' => $base, + 'priority' => 4, + 'model' => 'IDF_Views_Admin', + 'method' => 'usersNotValidated'); + $ctl[] = array('regex' => '#^/admin/users/(\d+)/$#', 'base' => $base, 'priority' => 4, diff --git a/src/IDF/templates/idf/gadmin/users/index.html b/src/IDF/templates/idf/gadmin/users/index.html index c3255bf..6ff8912 100644 --- a/src/IDF/templates/idf/gadmin/users/index.html +++ b/src/IDF/templates/idf/gadmin/users/index.html @@ -6,6 +6,10 @@ {$users.render} {/block} {block context} +

{trans 'Number of users:'} {$users.nb_items}

+{if !$not_validated}{aurl 'url', 'IDF_Views_Admin::usersNotValidated'} +

{blocktrans}See not validated users.{/blocktrans}

+{/if}
{blocktrans}

You have here an overview of the users registered in the forge.

{/blocktrans}