diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index c9e9dbb0d..217859574 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -96,6 +96,28 @@ class UserController extends Controller ); } + /** + * Show a user + */ + public function showAction() + { + $userName = $this->params->getRequired('user'); + $backend = $this->getUserBackend($this->params->getRequired('backend')); + + $user = $backend->select(array( + 'user_name', + 'is_active', + 'created_at', + 'last_modified' + ))->where('user_name', $userName)->fetchRow(); + if ($user === false) { + $this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName)); + } + + $this->view->user = $user; + $this->view->backend = $backend; + } + /** * Add a user */ @@ -125,6 +147,7 @@ class UserController extends Controller } $form = new UserForm(); + $form->setRedirectUrl(Url::fromPath('user/show', array('backend' => $backend->getName(), 'user' => $userName))); $form->setRepository($backend); $form->edit($userName, get_object_vars($row))->handleRequest(); diff --git a/application/views/scripts/user/list.phtml b/application/views/scripts/user/list.phtml index b550d4533..093270d4b 100644 --- a/application/views/scripts/user/list.phtml +++ b/application/views/scripts/user/list.phtml @@ -44,7 +44,12 @@ if (count($users) > 0): ?>
= $this->escape($user->user_name); ?>
= $editLink; ?> += $this->translate('State'); ?>: = $user->is_active ? $this->translate('Active') : $this->translate('Inactive'); ?>
+= $this->translate('Created at'); ?>: = $user->created_at === null ? '-' : $this->formatDateTime($user->created_at); ?>
+= $this->translate('Last modified'); ?>: = $user->last_modified === null ? '-' : $this->formatDateTime($user->last_modified); ?>
+