manage_user.html.ep 3.62 KB
Newer Older
1
<html>
Francesc Guasch's avatar
Francesc Guasch committed
2
%= include 'bootstrap/header'
Roberto P. Rubio's avatar
Roberto P. Rubio committed
3
<body id="page-top" data-spy="scroll" data-target=".fixed-top" role="document" ng-app="ravada.app">
Francesc Guasch's avatar
Francesc Guasch committed
4
5
<div id="wrapper">
    %= include 'bootstrap/navigation'
6
<div id="page-wrapper" ng-controller="usersPage" ng-init="list_user_groups(<%= $user->id %>)">
Francesc Guasch's avatar
Francesc Guasch committed
7
8

    <div class="page-header">
Fernando Verdugo's avatar
Fernando Verdugo committed
9
10
        <div class="card">
             <div class="card-header">
11
                 <h2><%=l 'User' %>&nbsp;<%= $user->name %>
12
13
%               if ( $user->external_auth || $origin ) {
                    (<%= ($user->external_auth or $origin) %>)
14
15
%               }
                </h2>
16
17
18
%               if ($user->external_auth && $user->ldap_entry ) {
                    <%= $user->ldap_entry->dn %>
%               }
Francesc Guasch's avatar
Francesc Guasch committed
19
20
             </div> <!-- del panel heading-->
        </div>
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% if (!$user->id) {
    <div>
        <%=l 'This user has never logged in the Ravada server.' %>
        <br/>

    <a class="btn btn-outline-secondary" href="/admin/groups">Cancel</a>
    <a class="btn btn-primary" href="/admin/user/<%= $user->name %>.html?origin=<%= $origin %>&import=1">Import</a>
    </div>
% }

% if ($warning) {
    <div class="alert alert-warning"><%= $warning %></div>
% }

% if ($user->id) {
Fernando Verdugo's avatar
Fernando Verdugo committed
36
        <ul class="nav nav-tabs" id="myTab" role="tablist">
37
% if ( $_user->is_admin ) {
Fernando Verdugo's avatar
Fernando Verdugo committed
38
39
40
            <li class="nav-item">
                <a class="nav-link active" href="#admin" role="tab" data-toggle="tab" aria-controls="admin" aria-selected="true">Admin</a>
            </li>
41
42
% }
% if ( $_user->can_grant) {
Fernando Verdugo's avatar
Fernando Verdugo committed
43
44
45
            <li class="nav-item">
                <a class="nav-link" href="#grants" role="tab" data-toggle="tab" aria-controls="grants" aria-selected="true">Grants</a>
            </li>
46
% }
Roberto P. Rubio's avatar
Roberto P. Rubio committed
47
% if (( $_user->is_admin ) && (! $user->is_external)) {
48
49
50
            <li class="nav-item">
                <a class="nav-link" href="#password" role="tab" data-toggle="tab" aria-controls="password" aria-selected="true">Password</a>
            </li>
51
% }
52
% if ( $_user->is_admin && $user->is_external && $user->external_auth eq 'ldap' && $user->ldap_entry ) {
53
54
55
56
57
            <li class="nav-item">
                <a class="nav-link" href="#groups" role="tab" data-toggle="tab" aria-controls="groups" aria-selected="true">Groups</a>
            </li>
% }

58
        </ul>
59
60
% }
% if ($user->id && $_user->is_admin && $user->is_external && $user->external_auth eq 'ldap' && !$user->ldap_entry ) {
61
62
63
64
    <div class="alert alert-danger">
    <%=l 'Error: the LDAP entry for this user has been removed.' %>
    </div>
% }
Fernando Verdugo's avatar
Fernando Verdugo committed
65
        <div class="tab-content" id="myTabContent">
66
% if ($user->id && $_user->is_admin ) {
Fernando Verdugo's avatar
Fernando Verdugo committed
67
            <div class="tab-pane fade show active" id="admin" role="tabpanel" aria-labelledby="admin-tab">
68
69
                %= include '/main/manage_user_admin'
            </div>
70
% }
71
% if ($user->id && $_user->can_grant) {
Fernando Verdugo's avatar
Fernando Verdugo committed
72
            <div class="tab-pane fade" id="grants" role="tabpanel" aria-labelledby="grants-tab">
73
74
                %= include '/main/manage_user_grants'
            </div>
75
% }
76
% if ($user->id && ( $_user->is_admin ) && (! $user->is_external)) {
77
78
79
            <div class="tab-pane fade" id="password" role="tabpanel" aria-labelledby="password-tab">
                %= include '/main/manage_user_password'
            </div>
80
% }
81
% if ( $_user->is_admin && $user->id && $user->is_external && $user->external_auth eq 'ldap' && $user->ldap_entry ) {
82
83
84
            <div class="tab-pane fade" id="groups" role="tabpanel" aria-labelledby="group-tab">
                %= include '/main/manage_user_groups'
            </div>
85
86
% }
        </div>
87
88
    </div><! --page-header -->
</div>
Francesc Guasch's avatar
Francesc Guasch committed
89
90
91
92
93
94
95

</div>

    %= include 'bootstrap/scripts'
    %= include 'bootstrap/messages'
</body>
</html>