FEATURE: further restrict downloading of backups

- send email to logged in admin when they press the "download" button
- show pop-up that email was sent
- create email template
- require a valid token to download backup
This commit is contained in:
Blake Erickson
2017-03-01 08:26:18 -07:00
parent b20b568039
commit 80858bae2c
10 changed files with 175 additions and 30 deletions

View File

@ -1,4 +1,3 @@
import DiscourseURL from 'discourse/lib/url';
import { ajax } from 'discourse/lib/ajax';
export default Ember.Controller.extend({
@ -39,7 +38,11 @@ export default Ember.Controller.extend({
},
download(backup) {
DiscourseURL.redirectTo(backup.get('link'));
let link = backup.get('filename');
ajax("/admin/backups/" + link, { type: "PUT" })
.then(() => {
bootbox.alert(I18n.t("admin.backups.operations.download.alert"));
});
}
},
@ -48,7 +51,7 @@ export default Ember.Controller.extend({
ajax("/admin/backups/readonly", {
type: "PUT",
data: { enable: enable }
}).then(function() {
}).then(() => {
site.set("isReadOnly", enable);
});
}