Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.twig « templates « UsersManager « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e0ba163e63dfe68c0d70b56effb93bb3bdc2d4ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
{% extends 'admin.twig' %}

{% block content %}

<h2>{{ 'UsersManager_ManageAccess'|translate }}</h2>
<div id="sites" class="usersManager">
    <section class="sites_selector_container">
        <p>{{ 'UsersManager_MainDescription'|translate }}</p>

        <div class="sites_selector_title">{{ 'SitesManager_Sites'|translate }}:</div>

        {% set applyAllSitesText %}
            <strong>{{ 'UsersManager_ApplyToAllWebsites'|translate }}</strong>
        {% endset %}

        <div piwik-site-selector
             siteid="{{ idSiteSelected }}"
             sitename="{{ defaultReportSiteName }}"
             all-sites-text="{{ applyAllSitesText|raw }}"
             all-sites-location="top"
             id="usersManagerSiteSelect"
             switch-site-on-select="false"></div>
    </section>
</div>

{% import 'ajaxMacros.twig' as ajax %}
{{ ajax.errorDiv }}
{{ ajax.loadingDiv }}

<div class="entityContainer" style="width:600px;">
    {% if anonymousHasViewAccess %}
        <div style="display:inline-block;margin-top:10px;" id="usersManagerAnonymousUserHasViewAccess">
            {{ ['UsersManager_AnonymousUserHasViewAccess'|translate("'anonymous'","'view'"), 'UsersManager_AnonymousUserHasViewAccess2'|translate]|join(' ')|notification({'placeAt': '#usersManagerAnonymousUserHasViewAccess', 'noclear': true}) }}
        </div>
    {% endif %}
    <table class="entityTable dataTable" id="access" style="display:inline-table;width:500px;">
        <thead>
        <tr>
            <th class='first'>{{ 'UsersManager_User'|translate }}</th>
            <th>{{ 'UsersManager_Alias'|translate }}</th>
            <th>{{ 'UsersManager_PrivNone'|translate }}</th>
            <th>{{ 'UsersManager_PrivView'|translate }}</th>
            <th>{{ 'UsersManager_PrivAdmin'|translate }}</th>
        </tr>
        </thead>

        <tbody>
        {% set accesValid %}<img src='plugins/UsersManager/images/ok.png' class='accessGranted' />{% endset %}
        {% set accesInvalid %}<img src='plugins/UsersManager/images/no-access.png' class='updateAccess' />{% endset %}
        {% set superUserAccess %}<span title="{{ 'UsersManager_ExceptionSuperUserAccess'|translate }}">N/A</span>{% endset %}
        {% for login,access in usersAccessByWebsite %}
            <tr>
                <td id='login'>{{ login }}</td>
                <td>{{ usersAliasByLogin[login]|raw }}</td>
                <td id='noaccess'>
                    {% if login in superUserLogins %}
                        {{ superUserAccess }}
                    {% elseif access=='noaccess' and idSiteSelected != 'all' %}
                        {{ accesValid }}
                    {% else %}
                        {{ accesInvalid }}
                    {% endif %}&nbsp;</td>
                <td id='view'>
                    {% if login in superUserLogins %}
                        {{ superUserAccess }}
                    {% elseif access == 'view' and idSiteSelected != 'all' %}
                        {{ accesValid }}
                    {% else %}
                        {{ accesInvalid }}
                    {% endif %}&nbsp;</td>
                <td id='admin'>
                    {% if login in superUserLogins %}
                        {{ superUserAccess }}
                    {% elseif login == 'anonymous' %}
                        N/A
                    {% else %}
                        {% if access == 'admin' and idSiteSelected != 'all' %}{{ accesValid }}{% else %}{{ accesInvalid }}{% endif %}&nbsp;
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    <div id="accessUpdated" style="vertical-align:top;"></div>
</div>

<div class="ui-confirm" id="confirm">
    <h2>{{ 'UsersManager_ChangeAllConfirm'|translate("<span id='login'></span>")|raw }}</h2>
    <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
    <input role="no" type="button" value="{{ 'General_No'|translate }}"/>
</div>

{% if userIsSuperUser %}
    <div class="ui-confirm" id="confirmUserRemove">
        <h2></h2>
        <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
        <input role="no" type="button" value="{{ 'General_No'|translate }}"/>
    </div>
    <div class="ui-confirm" id="confirmPasswordChange">
        <h2>{{ 'UsersManager_ChangePasswordConfirm'|translate }}</h2>
        <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
        <input role="no" type="button" value="{{ 'General_No'|translate }}"/>
    </div>
    <br/>
    <h2>{{ 'UsersManager_UsersManagement'|translate }}</h2>
    <p>{{ 'UsersManager_UsersManagementMainDescription'|translate }}
        {{ 'UsersManager_ThereAreCurrentlyNRegisteredUsers'|translate("<b>"~usersCount~"</b>")|raw }}</p>
    {% import 'ajaxMacros.twig' as ajax %}
    {{ ajax.errorDiv('ajaxErrorUsersManagement') }}
    {{ ajax.loadingDiv('ajaxLoadingUsersManagement') }}
    <div class="entityContainer" style="margin-bottom:50px;">
        <table class="entityTable dataTable" id="users">
            <thead>
            <tr>
                <th>{{ 'General_Username'|translate }}</th>
                <th>{{ 'General_Password'|translate }}</th>
                <th>{{ 'UsersManager_Email'|translate }}</th>
                <th>{{ 'UsersManager_Alias'|translate }}</th>
                <th>token_auth</th>
                <th>{{ 'General_Edit'|translate }}</th>
                <th>{{ 'General_Delete'|translate }}</th>
            </tr>
            </thead>

            <tbody>
            {% for i,user in users %}
                {% if user.login != 'anonymous' %}
                    <tr class="editable" id="row{{ i }}">
                        <td id="userLogin" class="editable">{{ user.login }}</td>
                        <td id="password" class="editable">-</td>
                        <td id="email" class="editable">{{ user.email }}</td>
                        <td id="alias" class="editable">{{ user.alias|raw }}</td>
                        <td id="token_auth">{{ user.token_auth }}</td>
                        <td>
                            <span class="edituser link_but" id="row{{ i }}">
                                <img title="{{ 'General_Edit'|translate }}" src='plugins/Zeitgeist/images/ico_edit.png'/>
                                <span>{{ 'General_Edit'|translate }}</span>
                            </span>
                        </td>
                        <td>
                            <span class="deleteuser link_but" id="row{{ i }}">
                                <img title="{{ 'General_Delete'|translate }}" src='plugins/Zeitgeist/images/ico_delete.png'/>
                                <span>{{ 'General_Delete'|translate }}</span>
                            </span>
                        </td>
                    </tr>
                {% endif %}
            {% endfor %}
            </tbody>
        </table>
        <div class="addrow"><img src='plugins/UsersManager/images/add.png'/> {{ 'UsersManager_AddUser'|translate }}</div>
    </div>


    <h2>{{ 'UsersManager_SuperUserAccessManagement'|translate }}</h2>
    <p>{{ 'UsersManager_SuperUserAccessManagementMainDescription'|translate }} <br/>
    {{ 'UsersManager_SuperUserAccessManagementGrantMore'|translate }}</p>

    {{ ajax.errorDiv('ajaxErrorSuperUsersManagement') }}
    {{ ajax.loadingDiv('ajaxLoadingSuperUsersManagement') }}

    <table class="entityTable dataTable" id="superUserAccess" style="display:inline-table;width:400px;">
        <thead>
        <tr>
            <th class='first'>{{ 'UsersManager_User'|translate }}</th>
            <th>{{ 'UsersManager_Alias'|translate }}</th>
            <th>{{ 'Installation_SuperUser'|translate }}</th>
        </tr>
        </thead>

        <tbody>
        {% if users|length > 1 %}
            {% for login,alias in usersAliasByLogin if login != 'anonymous' %}
                <tr>
                    <td id='login'>{{ login }}</td>
                    <td>{{ alias|raw }}</td>
                    <td id='superuser' data-login="{{ login|e('html_attr') }}">
                        <img src='plugins/UsersManager/images/ok.png' class='accessGranted' data-hasaccess="1" {% if not (login in superUserLogins) %}style="display:none"{% endif %} />
                        <img src='plugins/UsersManager/images/no-access.png' class='updateAccess' data-hasaccess="0" {% if login in superUserLogins %}style="display:none"{% endif %} />
                        &nbsp;
                    </td>
                </tr>
            {% endfor %}
        {% else %}
            <tr>
                <td colspan="3">
                    {{ 'UsersManager_NoUsersExist'|translate }}
                </td>
            </tr>
        {% endif %}
        </tbody>
    </table>

    <div id="superUserAccessUpdated" style="vertical-align:top;"></div>

    <div class="ui-confirm" id="superUserAccessConfirm">
        <h2> </h2>
        <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
        <input role="no" type="button" value="{{ 'General_No'|translate }}"/>
    </div>

{% endif %}
{% endblock %}