(refs #896)Add description and migration for separation of notification and SMTP configuration

This commit is contained in:
Naoki Takezoe
2015-09-24 03:48:08 +09:00
parent 3c53fd8618
commit b11d36c3a5
3 changed files with 14 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ trait SystemSettingsControllerBase extends ControllerBase {
"activityLogLimit" -> trim(label("Limit of activity logs", optional(number()))),
"ssh" -> trim(label("SSH access", boolean())),
"sshPort" -> trim(label("SSH port", optional(number()))),
"useSMTP" -> trim(label("SMTP", boolean())),
"useSMTP" -> trim(label("SMTP", boolean())),
"smtp" -> optionalIfNotChecked("useSMTP", mapping(
"host" -> trim(label("SMTP Host", text(required))),
"port" -> trim(label("SMTP Port", optional(number()))),

View File

@@ -21,6 +21,15 @@ object AutoUpdate {
* The history of versions. A head of this sequence is the current BitBucket version.
*/
val versions = Seq(
new Version(3, 7) with SystemSettingsService {
override def update(conn: Connection, cl: ClassLoader): Unit = {
super.update(conn, cl)
val settings = loadSystemSettings()
if(settings.notification){
saveSystemSettings(settings.copy(useSMTP = true))
}
}
},
new Version(3, 6),
new Version(3, 5),
new Version(3, 4),

View File

@@ -239,7 +239,7 @@
<fieldset>
<label class="checkbox">
<input type="checkbox" id="useSMTP" name="useSMTP" @if(settings.useSMTP){ checked}/>
use SMTP
SMTP
</label>
</fieldset>
<div class="form-horizontal useSMTP">
@@ -288,6 +288,9 @@
<input type="text" id="fromName" name="smtp.fromName" value="@settings.smtp.map(_.fromName)"/>
</div>
</div>
<p class="muted">
Enable notification not only SMTP configuration if you want to send nitification email.
</p>
</div>
</div>
</div>