mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35: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 {
|
get("/:userName/_edit")(oneselfOnly {
|
||||||
val userName = params("userName")
|
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 =>
|
post("/:userName/_edit", editForm)(oneselfOnly { form =>
|
||||||
@@ -174,7 +176,7 @@ trait AccountControllerBase extends AccountManagementControllerBase {
|
|||||||
get("/:userName/_ssh")(oneselfOnly {
|
get("/:userName/_ssh")(oneselfOnly {
|
||||||
val userName = params("userName")
|
val userName = params("userName")
|
||||||
getAccountByUserName(userName).map { x =>
|
getAccountByUserName(userName).map { x =>
|
||||||
account.html.ssh(x, getPublicKeys(x.userName))
|
account.html.ssh(x, loadSystemSettings(), getPublicKeys(x.userName))
|
||||||
} getOrElse NotFound
|
} 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 context._
|
||||||
@import view.helpers._
|
@import view.helpers._
|
||||||
@html.main("Edit your profile"){
|
@html.main("Edit your profile"){
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
@menu("profile")
|
@menu("profile", settings.ssh)
|
||||||
</div>
|
</div>
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
@helper.html.information(info)
|
@helper.html.information(info)
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
@(active: String)(implicit context: app.Context)
|
@(active: String, ssh: Boolean)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<ul class="nav nav-tabs nav-stacked side-menu">
|
<ul class="nav nav-tabs nav-stacked side-menu">
|
||||||
<li@if(active=="profile"){ class="active"}>
|
<li@if(active=="profile"){ class="active"}>
|
||||||
<a href="@path/@loginAccount.get.userName/_edit">Profile</a>
|
<a href="@path/@loginAccount.get.userName/_edit">Profile</a>
|
||||||
</li>
|
</li>
|
||||||
|
@if(ssh){
|
||||||
<li@if(active=="ssh"){ class="active"}>
|
<li@if(active=="ssh"){ class="active"}>
|
||||||
<a href="@path/@loginAccount.get.userName/_ssh">SSH Keys</a>
|
<a href="@path/@loginAccount.get.userName/_ssh">SSH Keys</a>
|
||||||
</li>
|
</li>
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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 context._
|
||||||
@import view.helpers._
|
@import view.helpers._
|
||||||
@html.main("SSH Keys"){
|
@html.main("SSH Keys"){
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
@menu("ssh")
|
@menu("ssh", settings.ssh)
|
||||||
</div>
|
</div>
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
|
|||||||
Reference in New Issue
Block a user