|
@@ -22,6 +22,9 @@
|
|
<strong>{{Name}}</strong>
|
|
<strong>{{Name}}</strong>
|
|
<span class="d-block">{{Email}}</span>
|
|
<span class="d-block">{{Email}}</span>
|
|
<span class="d-block">
|
|
<span class="d-block">
|
|
|
|
+ {{#unless user_enabled}}
|
|
|
|
+ <span class="badge badge-danger mr-2" title="User is disabled">Disabled</span>
|
|
|
|
+ {{/unless}}
|
|
{{#if TwoFactorEnabled}}
|
|
{{#if TwoFactorEnabled}}
|
|
<span class="badge badge-success mr-2" title="2FA is enabled">2FA</span>
|
|
<span class="badge badge-success mr-2" title="2FA is enabled">2FA</span>
|
|
{{/if}}
|
|
{{/if}}
|
|
@@ -54,6 +57,11 @@
|
|
{{/if}}
|
|
{{/if}}
|
|
<a class="d-block" href="#" onclick='deauthUser({{jsesc Id}})'>Deauthorize sessions</a>
|
|
<a class="d-block" href="#" onclick='deauthUser({{jsesc Id}})'>Deauthorize sessions</a>
|
|
<a class="d-block" href="#" onclick='deleteUser({{jsesc Id}}, {{jsesc Email}})'>Delete User</a>
|
|
<a class="d-block" href="#" onclick='deleteUser({{jsesc Id}}, {{jsesc Email}})'>Delete User</a>
|
|
|
|
+ {{#if user_enabled}}
|
|
|
|
+ <a class="d-block" href="#" onclick='disableUser({{jsesc Id}}, {{jsesc Email}})'>Disable User</a>
|
|
|
|
+ {{else}}
|
|
|
|
+ <a class="d-block" href="#" onclick='enableUser({{jsesc Id}}, {{jsesc Email}})'>Enable User</a>
|
|
|
|
+ {{/if}}
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
{{/each}}
|
|
{{/each}}
|
|
@@ -113,6 +121,24 @@
|
|
"Error deauthorizing sessions");
|
|
"Error deauthorizing sessions");
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ function disableUser(id, mail) {
|
|
|
|
+ var confirmed = confirm("Are you sure you want to disable user '" + mail + "'? This will also deauthorize their sessions.")
|
|
|
|
+ if (confirmed) {
|
|
|
|
+ _post("{{urlpath}}/admin/users/" + id + "/disable",
|
|
|
|
+ "User disabled successfully",
|
|
|
|
+ "Error disabling user");
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ function enableUser(id, mail) {
|
|
|
|
+ var confirmed = confirm("Are you sure you want to enable user '" + mail + "'?")
|
|
|
|
+ if (confirmed) {
|
|
|
|
+ _post("{{urlpath}}/admin/users/" + id + "/enable",
|
|
|
|
+ "User enabled successfully",
|
|
|
|
+ "Error enabling user");
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
function updateRevisions() {
|
|
function updateRevisions() {
|
|
_post("{{urlpath}}/admin/users/update_revision",
|
|
_post("{{urlpath}}/admin/users/update_revision",
|
|
"Success, clients will sync next time they connect",
|
|
"Success, clients will sync next time they connect",
|