mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
(refs #115)Disable ssh key setting page if ssh access is disabled
This commit is contained in:
@@ -131,7 +131,9 @@ trait AccountControllerBase extends AccountManagementControllerBase {
|
||||
|
||||
get("/:userName/_edit")(oneselfOnly {
|
||||
val userName = params("userName")
|
||||
getAccountByUserName(userName).map(x => account.html.edit(x, flash.get("info"))) getOrElse NotFound
|
||||
getAccountByUserName(userName).map { x =>
|
||||
account.html.edit(x, loadSystemSettings(), flash.get("info"))
|
||||
} getOrElse NotFound
|
||||
})
|
||||
|
||||
post("/:userName/_edit", editForm)(oneselfOnly { form =>
|
||||
@@ -174,7 +176,7 @@ trait AccountControllerBase extends AccountManagementControllerBase {
|
||||
get("/:userName/_ssh")(oneselfOnly {
|
||||
val userName = params("userName")
|
||||
getAccountByUserName(userName).map { x =>
|
||||
account.html.ssh(x, getPublicKeys(x.userName))
|
||||
account.html.ssh(x, loadSystemSettings(), getPublicKeys(x.userName))
|
||||
} getOrElse NotFound
|
||||
})
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@(account: model.Account, info: Option[Any])(implicit context: app.Context)
|
||||
@(account: model.Account, settings: service.SystemSettingsService.SystemSettings, info: Option[Any])(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@html.main("Edit your profile"){
|
||||
<div class="row-fluid">
|
||||
<div class="span3">
|
||||
@menu("profile")
|
||||
@menu("profile", settings.ssh)
|
||||
</div>
|
||||
<div class="span9">
|
||||
@helper.html.information(info)
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
@(active: String)(implicit context: app.Context)
|
||||
@(active: String, ssh: Boolean)(implicit context: app.Context)
|
||||
@import context._
|
||||
<div class="box">
|
||||
<ul class="nav nav-tabs nav-stacked side-menu">
|
||||
<li@if(active=="profile"){ class="active"}>
|
||||
<a href="@path/@loginAccount.get.userName/_edit">Profile</a>
|
||||
</li>
|
||||
@if(ssh){
|
||||
<li@if(active=="ssh"){ class="active"}>
|
||||
<a href="@path/@loginAccount.get.userName/_ssh">SSH Keys</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@(account: model.Account, sshKeys: List[model.SshKey])(implicit context: app.Context)
|
||||
@(account: model.Account, settings: service.SystemSettingsService.SystemSettings, sshKeys: List[model.SshKey])(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@html.main("SSH Keys"){
|
||||
<div class="row-fluid">
|
||||
<div class="span3">
|
||||
@menu("ssh")
|
||||
@menu("ssh", settings.ssh)
|
||||
</div>
|
||||
<div class="span9">
|
||||
<div class="box">
|
||||
|
||||
Reference in New Issue
Block a user