aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2017-03-19 18:17:41 +0100
committerTristan Darricau <github@nicofuma.fr>2017-03-19 18:17:41 +0100
commit4b6b73ea9d85e24bb69a58197973686411391f9c (patch)
treea64cc8f14d1672c327578d3fd18c5bdce6345cb0 /phpBB/phpbb
parent0730d142475aee08285b5cb466a9c45c520f59c0 (diff)
parent45f0adcd0a4e6c7e43183fe641fa03ef2d90d45b (diff)
downloadforums-4b6b73ea9d85e24bb69a58197973686411391f9c.tar
forums-4b6b73ea9d85e24bb69a58197973686411391f9c.tar.gz
forums-4b6b73ea9d85e24bb69a58197973686411391f9c.tar.bz2
forums-4b6b73ea9d85e24bb69a58197973686411391f9c.tar.xz
forums-4b6b73ea9d85e24bb69a58197973686411391f9c.zip
Merge pull request #4736 from rubencm/ticket/15123
[ticket/15123] Check if extension was enabled/disabled before enable or disable * rubencm/ticket/15123: [ticket/15123] modified return error codes [ticket/15123] modified language strings [ticket/15123] modified language string [ticket/15123] removed blank spaces [ticket/15123] add check before enable or disable extension
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/console/command/extension/disable.php7
-rw-r--r--phpBB/phpbb/console/command/extension/enable.php7
2 files changed, 14 insertions, 0 deletions
diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php
index d022755753..b2e10fb960 100644
--- a/phpBB/phpbb/console/command/extension/disable.php
+++ b/phpBB/phpbb/console/command/extension/disable.php
@@ -37,6 +37,13 @@ class disable extends command
$io = new SymfonyStyle($input, $output);
$name = $input->getArgument('extension-name');
+
+ if (!$this->manager->is_enabled($name))
+ {
+ $io->error($this->user->lang('CLI_EXTENSION_DISABLED', $name));
+ return 2;
+ }
+
$this->manager->disable($name);
$this->manager->load_extensions();
diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php
index 14077d688b..a8312d5c15 100644
--- a/phpBB/phpbb/console/command/extension/enable.php
+++ b/phpBB/phpbb/console/command/extension/enable.php
@@ -37,6 +37,13 @@ class enable extends command
$io = new SymfonyStyle($input, $output);
$name = $input->getArgument('extension-name');
+
+ if ($this->manager->is_enabled($name))
+ {
+ $io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name));
+ return 2;
+ }
+
$this->manager->enable($name);
$this->manager->load_extensions();