summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-11-10 16:47:48 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-11-10 16:47:48 +0000
commit49ac5dc701e8d5628284a50ada4e49c3febe9ea1 (patch)
tree39c30f690335988c76878ec4f6f8c7978adeb056 /lib
parent912f831af6ada99a712c49f0c461c940d7d3a17e (diff)
downloadgitano-49ac5dc701e8d5628284a50ada4e49c3febe9ea1.tar.gz
ADMINCOMMAND: Lowercase user and group names
Diffstat (limited to 'lib')
-rw-r--r--lib/gitano/admincommand.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitano/admincommand.lua b/lib/gitano/admincommand.lua
index 61803bd..57744c1 100644
--- a/lib/gitano/admincommand.lua
+++ b/lib/gitano/admincommand.lua
@@ -95,7 +95,7 @@ usage: user [list]
user add <username> <email> <real name>
user del <username> [confirm token]
user email <username> <email>
- user name <user> <real name>
+ user name <username> <real name>
With no subcommand, or the subcommand 'list' the user command will
show a list of all the users, along with their email addresses and
@@ -129,6 +129,9 @@ local function builtin_user_validate(conf, _, cmdline)
log.error("user list takes no arguments")
return false
end
+ if #cmdline > 2 then
+ cmdline[3] = cmdline[3]:lower()
+ end
if cmdline[2] == "add" and #cmdline < 5 then
log.error("user add takes a username, email address and real name")
return false
@@ -292,6 +295,9 @@ local function builtin_group_validate(conf, _, cmdline)
log.error("Unknown sub command", cmdline[2], "for group")
return false
end
+ if #cmdline > 2 then
+ cmdline[3] = cmdline[3]:lower()
+ end
if cmdline[2] == "list" and #cmdline ~= 2 then
log.error("List takes no arguments")
return false
@@ -328,6 +334,9 @@ local function builtin_group_validate(conf, _, cmdline)
log.error("Delgroup takes a group name, a second group name, and a confirmation token")
return false
end
+ if ({adduser=true,addgroup=true,deluser=true,delgroup=true})[cmdline[2]] then
+ cmdline[4] = cmdline[4]:lower()
+ end
return true
end