File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
app/code/Magento/Backup/Controller/Adminhtml/Index Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ public function execute()
58
58
$ this ->_coreRegistry ->register ('backup_manager ' , $ backupManager );
59
59
60
60
if ($ this ->getRequest ()->getParam ('maintenance_mode ' )) {
61
- if (!$ this ->maintenanceMode ->set (true )) {
61
+ $ this ->maintenanceMode ->set (true );
62
+
63
+ if (!$ this ->maintenanceMode ->isOn ()) {
62
64
$ response ->setError (
63
65
__ (
64
66
'You need more permissions to activate maintenance mode right now. '
Original file line number Diff line number Diff line change 6
6
*/
7
7
namespace Magento \Backup \Controller \Adminhtml \Index ;
8
8
9
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
9
10
use Magento \Framework \App \Filesystem \DirectoryList ;
10
11
use Magento \Framework \Filesystem ;
11
12
12
13
/**
14
+ * Backup rollback controller.
15
+ *
13
16
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
14
17
*/
15
- class Rollback extends \Magento \Backup \Controller \Adminhtml \Index
18
+ class Rollback extends \Magento \Backup \Controller \Adminhtml \Index implements HttpPostActionInterface
16
19
{
17
20
/**
18
21
* Rollback Action
@@ -82,7 +85,9 @@ public function execute()
82
85
}
83
86
84
87
if ($ this ->getRequest ()->getParam ('maintenance_mode ' )) {
85
- if (!$ this ->maintenanceMode ->set (true )) {
88
+ $ this ->maintenanceMode ->set (true );
89
+
90
+ if (!$ this ->maintenanceMode ->isOn ()) {
86
91
$ response ->setError (
87
92
__ (
88
93
'You need more permissions to activate maintenance mode right now. '
@@ -122,6 +127,7 @@ public function execute()
122
127
$ adminSession ->destroy ();
123
128
124
129
$ response ->setRedirectUrl ($ this ->getUrl ('* ' ));
130
+ // phpcs:disable Magento2.Exceptions.ThrowCatch
125
131
} catch (\Magento \Framework \Backup \Exception \CantLoadSnapshot $ e ) {
126
132
$ errorMsg = __ ('We can \'t find the backup file. ' );
127
133
} catch (\Magento \Framework \Backup \Exception \FtpConnectionFailed $ e ) {
You can’t perform that action at this time.
0 commit comments