diff --git a/indefero/src/IDF/Views/Admin.php b/indefero/src/IDF/Views/Admin.php index f6770d8..0041cc3 100644 --- a/indefero/src/IDF/Views/Admin.php +++ b/indefero/src/IDF/Views/Admin.php @@ -344,17 +344,21 @@ class IDF_Views_Admin * */ public $users_precond = array('Pluf_Precondition::staffRequired'); - public function users($request, $match, $not_validated=false) + public function users($request, $match, $pageType=null) { $pag = new Pluf_Paginator(new Pluf_User()); $db =& Pluf::db(); $true = Pluf_DB_BooleanToDb(true, $db); - if ($not_validated) { + if ($pageType === 0) { $pag->forced_where = new Pluf_SQL('first_name = \'---\' AND active!='.$true); $title = __('Not Validated User List'); $pag->action = 'IDF_Views_Admin::usersNotValidated'; + } elseif ($pageType == 1) { + $pag->forced_where = new Pluf_SQL('first_name != \'---\' AND active!='.$true); + $title = __('Not Active User List'); + $pag->action = 'IDF_Views_Admin::usersNotValidated'; } else { - $pag->forced_where = new Pluf_SQL('first_name != \'---\''); + $pag->forced_where = new Pluf_SQL('first_name != \'---\' AND active='.$true); $title = __('User List'); $pag->action = 'IDF_Views_Admin::users'; } @@ -381,7 +385,6 @@ class IDF_Views_Admin array( 'page_title' => $title, 'users' => $pag, - 'not_validated' => $not_validated, ), $request); } @@ -392,7 +395,16 @@ class IDF_Views_Admin public $usersNotValidated_precond = array('Pluf_Precondition::staffRequired'); public function usersNotValidated($request, $match) { - return $this->users($request, $match, true); + return $this->users($request, $match, 0); + } + + /** + * Not validated users. + */ + public $usersInActive_precond = array('Pluf_Precondition::staffRequired'); + public function usersInActive($request, $match) + { + return $this->users($request, $match, 1); } /** diff --git a/indefero/src/IDF/conf/urls.php b/indefero/src/IDF/conf/urls.php index 09935ba..a3f464f 100644 --- a/indefero/src/IDF/conf/urls.php +++ b/indefero/src/IDF/conf/urls.php @@ -556,6 +556,11 @@ $ctl[] = array('regex' => '#^/admin/users/notvalid/$#', 'model' => 'IDF_Views_Admin', 'method' => 'usersNotValidated'); +$ctl[] = array('regex' => '#^/admin/users/inactive/$#', + 'base' => $base, + 'model' => 'IDF_Views_Admin', + 'method' => 'usersInActive'); + $ctl[] = array('regex' => '#^/admin/users/(\d+)/$#', 'base' => $base, 'model' => 'IDF_Views_Admin', diff --git a/indefero/src/IDF/templates/idf/gadmin/users/index.html b/indefero/src/IDF/templates/idf/gadmin/users/index.html index 6ff8912..710e12f 100644 --- a/indefero/src/IDF/templates/idf/gadmin/users/index.html +++ b/indefero/src/IDF/templates/idf/gadmin/users/index.html @@ -7,9 +7,12 @@ {/block} {block context}

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

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

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

-{/if} +{aurl 'url', 'IDF_Views_Admin::usersInActive'} +

See inactive users.


+{aurl 'url', 'IDF_Views_Admin::users'} +

See active users.

{blocktrans}

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

{/blocktrans}