(refs #115)Fix account registration page and add public key deletion

This commit is contained in:
takezoe
2014-03-09 01:38:23 +09:00
parent 9541771703
commit 5e6c33df6c
4 changed files with 63 additions and 4 deletions

View File

@@ -184,12 +184,19 @@ trait AccountControllerBase extends AccountManagementControllerBase {
redirect(s"/${userName}/_ssh")
})
get("/:userName/_ssh/delete/:id")(oneselfOnly {
val userName = params("userName")
val sshKeyId = params("id").toInt
deletePublicKey(userName, sshKeyId)
redirect(s"/${userName}/_ssh")
})
get("/register"){
if(loadSystemSettings().allowAccountRegistration){
if(context.loginAccount.isDefined){
redirect("/")
} else {
account.html.edit(None, None)
account.html.register()
}
} else NotFound
}