mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-01-01 13:20:03 +01:00
fixed by review comment.
This commit is contained in:
@@ -333,15 +333,11 @@ trait SystemSettingsControllerBase extends AccountManagementControllerBase {
|
||||
val includeRemoved = params.get("includeRemoved").map(_.toBoolean).getOrElse(false)
|
||||
val includeGroups = params.get("includeGroups").map(_.toBoolean).getOrElse(false)
|
||||
val users = getAllUsers(includeRemoved, includeGroups)
|
||||
if(includeGroups){
|
||||
val members = users.collect { case account if(account.isGroupAccount) =>
|
||||
account.userName -> getGroupMembers(account.userName).map(_.userName)
|
||||
}.toMap
|
||||
val members = users.collect { case account if(account.isGroupAccount) =>
|
||||
account.userName -> getGroupMembers(account.userName).map(_.userName)
|
||||
}.toMap
|
||||
|
||||
html.userlist(users, members, includeRemoved, includeGroups)
|
||||
}else{
|
||||
html.userlist(users, Map[String, List[String]](), includeRemoved, includeGroups)
|
||||
}
|
||||
html.userlist(users, members, includeRemoved, includeGroups)
|
||||
})
|
||||
|
||||
get("/admin/users/_newuser")(adminOnly {
|
||||
|
||||
@@ -98,16 +98,11 @@ trait AccountService {
|
||||
|
||||
def getAllUsers(includeRemoved: Boolean = true, includeGroups: Boolean = true)(implicit s: Session): List[Account] =
|
||||
{
|
||||
((includeRemoved, includeGroups) match {
|
||||
case (true, true) =>
|
||||
Accounts
|
||||
case (true, false) =>
|
||||
Accounts filter (_.groupAccount === false.bind)
|
||||
case (false, true) =>
|
||||
Accounts filter (_.removed === false.bind)
|
||||
case (false, false) =>
|
||||
Accounts filter (t => t.removed === false.bind && t.groupAccount === false.bind)
|
||||
}) sortBy(_.userName) list
|
||||
Accounts filter { t =>
|
||||
(1.bind === 1.bind) &&
|
||||
(t.groupAccount === false.bind, !includeGroups) &&
|
||||
(t.removed === false.bind, !includeRemoved)
|
||||
} sortBy(_.userName) list
|
||||
}
|
||||
|
||||
def isLastAdministrator(account: Account)(implicit s: Session): Boolean = {
|
||||
|
||||
Reference in New Issue
Block a user