summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-03-28 11:39:23 -0400
committerJames Moger <james.moger@gitblit.com>2014-04-10 19:00:52 -0400
commitcd45b5fe5ae88c1d526211e67068ce7b2a066d70 (patch)
tree13956101e3159684ea8a02b2da90181089b9b375 /src
parent8ec06317276abd624630c37675d8d563a1fcb754 (diff)
downloadgitblit-cd45b5fe5ae88c1d526211e67068ce7b2a066d70.tar.gz
gitblit-cd45b5fe5ae88c1d526211e67068ce7b2a066d70.zip
Finish user and team administration commands
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java12
-rw-r--r--src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java7
2 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java b/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java
index 710ec4eb..d0ec58f0 100644
--- a/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java
+++ b/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java
@@ -72,7 +72,7 @@ public class TeamsDispatcher extends DispatchCommand {
}
}
- @CommandMetaData(name = "new", description = "Create a new team")
+ @CommandMetaData(name = "new", aliases = { "add" }, description = "Create a new team")
@UsageExample(syntax = "${cmd} contributors --canFork --canCreate")
public static class NewTeam extends TeamCommand {
@@ -148,7 +148,7 @@ public class TeamsDispatcher extends DispatchCommand {
protected List<String> fieldValues = new ArrayList<String>();
protected enum Field {
- mailingList, canAdmin, canFork, canCreate;
+ mailingList, preReceive, postReceive, canAdmin, canFork, canCreate;
static Field fromString(String name) {
for (Field field : values()) {
@@ -185,6 +185,14 @@ public class TeamsDispatcher extends DispatchCommand {
team.mailingLists.clear();
team.mailingLists.addAll(fieldValues);
break;
+ case preReceive:
+ team.preReceiveScripts.clear();
+ team.preReceiveScripts.addAll(fieldValues);
+ break;
+ case postReceive:
+ team.postReceiveScripts.clear();
+ team.postReceiveScripts.addAll(fieldValues);
+ break;
case canAdmin:
team.canAdmin = toBool(value);
break;
diff --git a/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java b/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java
index 4f604a2f..1a6dee46 100644
--- a/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java
+++ b/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java
@@ -74,7 +74,7 @@ public class UsersDispatcher extends DispatchCommand {
}
}
- @CommandMetaData(name = "new", description = "Create a new user account")
+ @CommandMetaData(name = "new", aliases = { "add" }, description = "Create a new user account")
@UsageExample(syntax = "${cmd} john 12345 --email john@smith.com --canFork --canCreate")
public static class NewUser extends UserCommand {
@@ -165,7 +165,7 @@ public class UsersDispatcher extends DispatchCommand {
protected List<String> fieldValues = new ArrayList<String>();
protected enum Field {
- name, displayName, email, password, canAdmin, canFork, canCreate;
+ name, displayName, email, password, canAdmin, canFork, canCreate, disabled;
static Field fromString(String name) {
for (Field field : values()) {
@@ -253,6 +253,9 @@ public class UsersDispatcher extends DispatchCommand {
case canCreate:
user.canCreate = toBool(value);
break;
+ case disabled:
+ user.disabled = toBool(value);
+ break;
default:
throw new UnloggedFailure(1, String.format("Field %s was not properly handled by the set command.", fieldName));
}