[9fbddb]: / Allura / allura / templates / site_admin_user_details.html  Maximize  Restore  History

Download this file

228 lines (210 with data), 8.3 kB

  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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% set page = 'user_details' %}
{% extends 'allura:templates/site_admin.html' %}
{% set hide_left_bar=True %}
{% block title %}User Details - {{ user.username }}{% endblock %}
{% block header %}User Details{% endblock %}
{% block content %}
<div class="grid-23"><p><a href="/nf/admin">Back to Site Admin Home</a></p></div>
{% block general_info %}
<div class="grid-23">
<fieldset class="preferences">
<legend>General</legend>
<div class="grid-16">
<ul>
<li>Username: {{ user.username }} (<a href="{{ user.url() }}">Go to profile page</a>)</li>
<li>Full name: {{ user.get_pref('display_name') }}</li>
<li>Registered: {{ user.registration_date() }} ({{ h.ago(user.registration_date(), show_date_after=None) }})</li>
<li>Multifactor auth: {{ user.get_pref('multifactor') or False }}</li>
</ul>
{% block extra_general_info %}{% endblock %}
</div>
<div class="grid-6">
<form action='/nf/admin/user/set_status' method="POST">
Account Status:<br>
<label><input type="radio" name="status" value="enable"{% if status == 'enabled' %} checked="checked"{% endif %}>Enabled</label><br>
<label><input type="radio" name="status" value="disable"{% if status == 'disabled' %} checked="checked"{% endif %}>
{%- if status == 'disabled' -%}
<strong>Disabled</strong>
(see Audit Log below)
{%- else -%}
Disabled
{%- endif -%}
</label><br>
<label><input type="radio" name="status" value="pending"{% if status == 'pending' %} checked="checked"{% endif %}>Pending</label>
<input type='hidden' name='username' value='{{ user.username }}'>
{{lib.csrf_token()}}
</form>
{% if status == 'enabled' %}
<br>
<form action='/nf/admin/user/set_random_password' method="POST">
<input type="submit" value="Set random password">
<input type='hidden' name='username' value='{{ user.username }}'>
{{lib.csrf_token()}}
</form>
<form action='/nf/admin/user/send_password_reset_link' method="POST">
<input type="submit" value="Send password reset link">
<input type='hidden' name='username' value='{{ user.username }}'>
{{lib.csrf_token()}}
</form>
<form action='/nf/admin/user/make_password_reset_url' method="POST" id="get-reset">
<input type="submit" value="Get password reset link">
<input type='hidden' name='username' value='{{ user.username }}'>
{{lib.csrf_token()}}
</form>
<div id="password_reset_url_modal" class="modal">
<h1>Password Reset URL</h1>
<p>Be very careful to share this only with the intended user.</p>
<input type="url" readonly id="password_reset_url">
<a href="#" id="password_reset_url_copy">copy</a>
<p>Whenever you regenerate a new password reset URL, previous URLs are invalidated.</p>
</div>
{% endif %}
</div>
</fieldset>
</div>
{% endblock general_info %}
{% block emails %}
<div class="grid-23">
<fieldset class="preferences">
<legend>Emails</legend>
<form action="update_emails" method="post">
{% include 'allura:templates/update_emails_form.html' %}
<input type='hidden' name='username' value='{{ user.username }}'>
</form>
</fieldset>
</div>
{% endblock emails %}
{% block session_info %}
<div class="grid-23">
<fieldset class="preferences">
<legend>Session</legend>
<h3>Last login</h3>
<ul>
<li>Date: {{ user.last_access.login_date }} ({{ h.ago(user.last_access.login_date, show_date_after=None) }})</li>
<li>IP: {{ user.last_access.login_ip }}</li>
<li>UA: {{ user.last_access.login_ua }}</li>
</ul>
<h3>Last page access</h3>
<ul>
<li>Date: {{ user.last_access.session_date and user.last_access.session_date.date() }}</li>
<li>IP: {{ user.last_access.session_ip }}</li>
<li>UA: {{ user.last_access.session_ua }}</li>
</ul>
</fieldset>
</div>
{% endblock session_info %}
{% block extra_info %}
{% endblock extra_info %}
{% block audit_log %}
<div class="grid-23">
{% set al = audit_log %}
<fieldset class="preferences">
<legend>Audit log</legend>
<form action='/nf/admin/user/add_audit_trail_entry' method='POST'>
<div class='grid-22'>
<label for='comment'>Comment:</label>
</div>
<div class='grid-22'>
<textarea name="comment" cols="38" rows="5"></textarea>
</div>
<div class='grid-5'>
<input type='hidden' name='username' value='{{ user.username }}'>
<input type='submit' value='Add comment'>
{{lib.csrf_token()}}
</div>
</form>
{% if al['entries'] %}
{{ c.audit_log_widget.display(entries=al['entries'], limit=al['limit'], page=al['page'], count=al['count'], class='grid-22') }}
{% endif %}
</fieldset>
</div>
{% endblock audit_log %}
{% block user_projects %}
<div class="grid-23">
<fieldset class="preferences">
<legend>Projects</legend>
<ul>
{% for p in projects %}
<li><a href="{{ p.url() }}">{{p.name}}</a>
<span class="spacer">&ndash;</span>
<a href="{{ p.url() }}admin/">Admin</a>
{% if not p.is_root %}
(subproject)
{% elif p.is_user_project %}
(user profile project)
{% elif p.is_nbhd_project %}
(neighborhood)
{% endif %}
</li>
{% endfor %}
</ul>
<a href="/nf/admin/delete_projects/?projects={% for p in projects %}{{ p.url() }}%0A{% endfor %}&reason=%0A%0A%0A(projects by user {{user.username}})">Delete all these projects</a>
</fieldset>
</div>
{% endblock user_projects %}
{% endblock %}
{% block extra_css %}
{{ super() }}
<style>
.pad table {
width: 860px;
margin-left: 0;
}
li .spacer {
margin: 0 0.5em;
}
#password_reset_url_modal {
display: none;
}
#password_reset_url {
width: 30em;
margin-right: 1em;
}
</style>
{% endblock %}
{% block extra_js %}
{{ super() }}
<script>
$(document).ready(function() {
// enabled/disabled change
$('input[name="status"]').change(function(e) {
$(this).parents('form').submit();
});
// handling for get password reset URL
$('#get-reset').submit(function(e) {
e.preventDefault();
var $form = $(this);
$.post($form.attr('action'), $form.serialize())
.done(function(data) {
var reset_url = data;
$('#password_reset_url_modal').lightbox_me();
$('#password_reset_url').val(reset_url);
})
.fail(function() {
$('#messages').notify({message: 'Error getting reset link', status: 'error'});
});
});
$('#password_reset_url_copy').click(function(){
$('#password_reset_url').select();
document.execCommand("copy");
$(this).text('copied!');
})
});
</script>
{% endblock %}