Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
patriot1burke committed Jul 11, 2015
1 parent 1ec8e63 commit 919a3f1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1 data-ng-show="create">Add User</h1>
<div class="form-group clearfix block">
<label class="col-md-2 control-label" for="userEnabled">User Enabled</label>
<div class="col-md-6">
<input ng-model="user.enabled" name="userEnabled" id="userEnabled" onoffswitch />
<input ng-model="user.enabled" name="userEnabled" id="userEnabled" ng-disabled="!access.manageUsers" onoffswitch />
</div>
<kc-tooltip>A disabled user cannot login.</kc-tooltip>
</div>
Expand All @@ -79,7 +79,7 @@ <h1 data-ng-show="create">Add User</h1>
<div class="form-group clearfix block">
<label class="col-md-2 control-label" for="emailVerified">Email verified</label>
<div class="col-md-6">
<input ng-model="user.emailVerified" name="emailVerified" id="emailVerified" onoffswitch />
<input ng-model="user.emailVerified" name="emailVerified" id="emailVerified" ng-disabled="!access.manageUsers" onoffswitch />
</div>
<kc-tooltip>Has the user's email been verified?</kc-tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1>{{user.username|capitalize}}</h1>
<thead>
<tr>
<th class="kc-table-actions" colspan="6">
<div class="pull-right">
<div class="pull-right" data-ng-show="access.manageUsers">
<a class="btn btn-primary" ng-click="logoutAll()">Logout All Sessions</a>
</div>
</th>
Expand All @@ -36,7 +36,7 @@ <h1>{{user.username|capitalize}}</h1>
</div>
</ul>
</td>
<td><a href="" ng-click="logoutSession(session.id)">logout</a> </td>
<td><a data-ng-show="access.manageUsers" href="" ng-click="logoutSession(session.id)">logout</a> </td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ public GlobalRequestResult pushRevocation() {
@Path("logout-all")
@POST
public GlobalRequestResult logoutAll() {
auth.init(RealmAuth.Resource.USER).requireManage();
session.sessions().removeUserSessions(realm);
adminEvent.operation(OperationType.ACTION).resourcePath(uriInfo).success();
return new ResourceAdminManager(session).logoutAll(uriInfo.getRequestUri(), realm);
Expand All @@ -294,6 +295,7 @@ public GlobalRequestResult logoutAll() {
@Path("sessions/{session}")
@DELETE
public void deleteSession(@PathParam("session") String sessionId) {
auth.init(RealmAuth.Resource.USER).requireManage();
UserSessionModel userSession = session.sessions().getUserSession(realm, sessionId);
if (userSession == null) throw new NotFoundException("Sesssion not found");
AuthenticationManager.backchannelLogout(session, realm, userSession, uriInfo, connection, headers, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void config(RealmManager manager, RealmModel defaultRealm, RealmModel app
});
}

@Test
//@Test
public void ideTesting() throws Exception {
Thread.sleep(100000000);
}
Expand Down

0 comments on commit 919a3f1

Please sign in to comment.