Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
f0554a0f
Commit
f0554a0f
authored
May 04, 2021
by
Francesc Guasch
Browse files
Merge branch 'robertperez-upc-feat/1500_listusers/develop' into develop
parents
331bdb67
df61f9d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
script/rvd_front
View file @
f0554a0f
...
...
@@ -129,6 +129,9 @@ my $WS = Ravada::WebSocket->new(ravada => $RAVADA);
my %ALLOWED_ANONYMOUS_WS = map { $_ => 1 } qw(list_bases_anonymous list_alerts);
my %LDAP_ATTRIBUTES;
# TOODO: config this variable
my $LIMIT_SHOW_USERS = 25;
init();
############################################################################3
...
...
@@ -2238,8 +2241,16 @@ sub admin {
return access_denied($c) if !$USER->is_admin
&&
!$USER->can_manage_users
&&
!$USER->can_grant;
$c->stash(list_users => []);
$c->stash(name => $c->param('name' or ''));
$c->stash(message => '');
if ( $c->param('name') ) {
$c->stash(list_users => $RAVADA->list_users($c->param('name') ))
} else {
my $users = $RAVADA->list_users();
if (($users)
&&
(scalar(@$users)
<
$
LIMIT_SHOW_USERS
))
{
$
c-
>
stash(list_users => $users);
} else {
$c->stash(message => "There are ".scalar(@$users)." users. Type a search pattern to list them");
}
}
}
if ($page eq 'machines') {
...
...
templates/main/admin_users.html.ep
View file @
f0554a0f
...
...
@@ -11,10 +11,14 @@
<h2
class=
"display-5"
><
%=
l
'
Users
'
%
></h2>
<div
class=
"card-title"
>
<form
method=
"post"
action=
"/admin/users"
>
<input
type=
"text"
name=
"name"
placeholder=
"<%=l 'Users' %>"
>
<input
type=
"text"
name=
"name"
placeholder=
"<%=l 'Users' %>"
value=
"<%= $name %>"
>
<input
type=
"submit"
value=
"<%=l 'Search' %>"
>
<button
type=
"button"
style=
"float: right; margin: 0 10px;"
class=
"btn btn-success"
onclick =
"location='/users/register'"
><
%=
l
'
New
user
'
%
></button>
</form>
% if ($message) {
<
%=
l
$
message
%
>
% }
</div>
</div>
<div
class=
"card-body"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment