summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2013-05-27 11:14:24 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2013-05-27 11:14:24 +0100
commit74d556b3f4e09a4052c0cc377c50ab4858fe127e (patch)
tree2746f3c54f7699a9209271f8ff8bdf9c81644e7c
parent886996ef0544e44042a70a8a0f30c044932a0d5f (diff)
downloadgitano-74d556b3f4e09a4052c0cc377c50ab4858fe127e.tar.bz2
COMMANDS: Add reasons to generate_confirmation calls
This adds reasons to all generate_confirmation calls which were still lacking them.
-rw-r--r--lib/gitano/admincommand.lua6
-rw-r--r--lib/gitano/command.lua3
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitano/admincommand.lua b/lib/gitano/admincommand.lua
index 0f2e4ee..f565e96 100644
--- a/lib/gitano/admincommand.lua
+++ b/lib/gitano/admincommand.lua
@@ -550,7 +550,8 @@ local function builtin_group_run(conf, _, cmdline, env)
if not gtab.members[u] then
log.fatal("User", u, "is not a member of", g)
end
- local token = conf.repo:generate_confirmation()
+ local token = conf.repo:generate_confirmation("delete user " .. u ..
+ " from group " .. g)
if not cmdline[5] then
log.state("To delete user", u, "from group", g, "you will need this token:")
log.state(token)
@@ -593,7 +594,8 @@ local function builtin_group_run(conf, _, cmdline, env)
if not gtab.subgroups[g2] then
log.fatal("Group", g2, "is not a subgroup of", g)
end
- local token = conf.repo:generate_confirmation()
+ local token = conf.repo:generate_confirmation("delete group " .. g ..
+ "from group " .. g2)
if not cmdline[5] then
log.state("To delete group", g2, "from group", g, "you will need this token:")
log.state(token)
diff --git a/lib/gitano/command.lua b/lib/gitano/command.lua
index c8f537a..c3fd108 100644
--- a/lib/gitano/command.lua
+++ b/lib/gitano/command.lua
@@ -673,16 +673,15 @@ local function builtin_destroy_prep(config, repo, cmdline, context)
end
local function builtin_destroy_run(config, repo, cmdline, env)
+ local token = repo:generate_confirmation("destroy repo " .. repo.name)
if #cmdline == 2 then
-- Generate the confirmation token
- local token = repo:generate_confirmation()
log.state("")
log.state("If you are *certain* you wish to destroy this repository")
log.state("Then re-run your command with the following confirmation token:")
log.state("")
log.state(" ", token)
else
- local token = repo:generate_confirmation()
if cmdline[3] ~= token then
log.error("Confirmation token does not match, refusing to destroy")
return "exit", 1