From 410e0fc28f25835c4b10e31066b641387cb53391 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 25 Oct 2016 12:20:02 +0200 Subject: Require password confirmation when changing workflow rules Signed-off-by: Joas Schilling --- apps/workflowengine/js/admin.js | 10 ++++++++++ apps/workflowengine/lib/Controller/FlowOperations.php | 6 ++++++ 2 files changed, 16 insertions(+) (limited to 'apps') diff --git a/apps/workflowengine/js/admin.js b/apps/workflowengine/js/admin.js index 0357d741ab1..7f9a709ec14 100644 --- a/apps/workflowengine/js/admin.js +++ b/apps/workflowengine/js/admin.js @@ -163,6 +163,11 @@ } }, delete: function() { + if (OC.PasswordConfirmation.requiresPasswordConfirmation()) { + OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.delete, this)); + return; + } + this.model.destroy(); this.remove(); }, @@ -173,6 +178,11 @@ this.render(); }, save: function() { + if (OC.PasswordConfirmation.requiresPasswordConfirmation()) { + OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.save, this)); + return; + } + var success = function(model, response, options) { this.saving = false; this.originalModel = JSON.parse(JSON.stringify(this.model)); diff --git a/apps/workflowengine/lib/Controller/FlowOperations.php b/apps/workflowengine/lib/Controller/FlowOperations.php index 94b8b9ddc79..753aa2c26a7 100644 --- a/apps/workflowengine/lib/Controller/FlowOperations.php +++ b/apps/workflowengine/lib/Controller/FlowOperations.php @@ -58,6 +58,8 @@ class FlowOperations extends Controller { } /** + * @PasswordConfirmationRequired + * * @param string $class * @param string $name * @param array[] $checks @@ -75,6 +77,8 @@ class FlowOperations extends Controller { } /** + * @PasswordConfirmationRequired + * * @param int $id * @param string $name * @param array[] $checks @@ -92,6 +96,8 @@ class FlowOperations extends Controller { } /** + * @PasswordConfirmationRequired + * * @param int $id * @return JSONResponse */ -- cgit v1.2.3