Added a delete page with options to delete the local database, as well as the remote files. Added a captcha to protect against automated attacks that would attempt to delete the remote files. This fixes #1201
22 lines
587 B
JavaScript
22 lines
587 B
JavaScript
backupApp.controller('CaptchaController', function($scope, CaptchaService, DialogService, AppService, AppUtils) {
|
|
var entry = $scope.entry = CaptchaService.active;
|
|
|
|
function refreshImage() {
|
|
entry.imageurl = null;
|
|
|
|
AppService.post('/captcha', { 'target': entry.target}).then(function(resp) {
|
|
entry.token = resp.data.token;
|
|
entry.imageurl = AppService.apiurl + '/captcha/' + entry.token;
|
|
|
|
}, function(err) {
|
|
DialogService.dismissCurrent();
|
|
AppUtils.connectionError(err);
|
|
});
|
|
};
|
|
|
|
if (entry.token == null)
|
|
refreshImage();
|
|
|
|
$scope.reload = refreshImage;
|
|
});
|