From 891aab05935e9ebc237a83cef0b248998cb5fccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 11 Mar 2017 20:34:40 +0100 Subject: [ticket/15123] add check before enable or disable extension PHPBB3-15123 --- phpBB/phpbb/console/command/extension/disable.php | 7 +++++++ phpBB/phpbb/console/command/extension/enable.php | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php index d022755753..be5c77a9a0 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_ALREADY_DISABLED', $name)); + return 1; + } + $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..2de7498c71 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_ALREADY_ENABLED', $name)); + return 1; + } + $this->manager->enable($name); $this->manager->load_extensions(); -- cgit v1.2.1 From 68c167fe7a5f0c86d97c9c3dda30f66d9df5b032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 11 Mar 2017 20:39:16 +0100 Subject: [ticket/15123] removed blank spaces PHPBB3-15123 --- phpBB/phpbb/console/command/extension/disable.php | 2 +- phpBB/phpbb/console/command/extension/enable.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php index be5c77a9a0..323f9b6d83 100644 --- a/phpBB/phpbb/console/command/extension/disable.php +++ b/phpBB/phpbb/console/command/extension/disable.php @@ -43,7 +43,7 @@ class disable extends command $io->error($this->user->lang('CLI_EXTENSION_ALREADY_DISABLED', $name)); return 1; } - + $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 2de7498c71..e6b5f66c7f 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -43,7 +43,7 @@ class enable extends command $io->error($this->user->lang('CLI_EXTENSION_ALREADY_ENABLED', $name)); return 1; } - + $this->manager->enable($name); $this->manager->load_extensions(); -- cgit v1.2.1 From 8994295f2b7d5b2beece7bbd8f7a2861fa15625d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 11 Mar 2017 23:03:31 +0100 Subject: [ticket/15123] modified language string PHPBB3-15123 --- phpBB/phpbb/console/command/extension/disable.php | 2 +- phpBB/phpbb/console/command/extension/enable.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php index 323f9b6d83..05f7ce9704 100644 --- a/phpBB/phpbb/console/command/extension/disable.php +++ b/phpBB/phpbb/console/command/extension/disable.php @@ -40,7 +40,7 @@ class disable extends command if (!$this->manager->is_enabled($name)) { - $io->error($this->user->lang('CLI_EXTENSION_ALREADY_DISABLED', $name)); + $io->error($this->user->lang('CLI_EXTENSION_DISABLE_DISABLED', $name)); return 1; } diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index e6b5f66c7f..c7c336cdc9 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -40,7 +40,7 @@ class enable extends command if ($this->manager->is_enabled($name)) { - $io->error($this->user->lang('CLI_EXTENSION_ALREADY_ENABLED', $name)); + $io->error($this->user->lang('CLI_EXTENSION_ENABLE_ENABLED', $name)); return 1; } -- cgit v1.2.1 From 9b3609d6f60af328e6681146014453da0af4ee01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 12 Mar 2017 22:44:18 +0100 Subject: [ticket/15123] modified language strings PHPBB3-15123 --- phpBB/phpbb/console/command/extension/disable.php | 2 +- phpBB/phpbb/console/command/extension/enable.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php index 05f7ce9704..12674c16cb 100644 --- a/phpBB/phpbb/console/command/extension/disable.php +++ b/phpBB/phpbb/console/command/extension/disable.php @@ -40,7 +40,7 @@ class disable extends command if (!$this->manager->is_enabled($name)) { - $io->error($this->user->lang('CLI_EXTENSION_DISABLE_DISABLED', $name)); + $io->error($this->user->lang('CLI_EXTENSION_DISABLED', $name)); return 1; } diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index c7c336cdc9..079e4ce1f6 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -40,7 +40,7 @@ class enable extends command if ($this->manager->is_enabled($name)) { - $io->error($this->user->lang('CLI_EXTENSION_ENABLE_ENABLED', $name)); + $io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name)); return 1; } -- cgit v1.2.1 From 45f0adcd0a4e6c7e43183fe641fa03ef2d90d45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 12 Mar 2017 22:45:33 +0100 Subject: [ticket/15123] modified return error codes PHPBB3-15123 --- phpBB/phpbb/console/command/extension/disable.php | 2 +- phpBB/phpbb/console/command/extension/enable.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php index 12674c16cb..b2e10fb960 100644 --- a/phpBB/phpbb/console/command/extension/disable.php +++ b/phpBB/phpbb/console/command/extension/disable.php @@ -41,7 +41,7 @@ class disable extends command if (!$this->manager->is_enabled($name)) { $io->error($this->user->lang('CLI_EXTENSION_DISABLED', $name)); - return 1; + return 2; } $this->manager->disable($name); diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index 079e4ce1f6..a8312d5c15 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -41,7 +41,7 @@ class enable extends command if ($this->manager->is_enabled($name)) { $io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name)); - return 1; + return 2; } $this->manager->enable($name); -- cgit v1.2.1