aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/migration/data
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-06 23:15:18 +0200
committerTristan Darricau <github@nicofuma.fr>2014-05-06 23:36:37 +0200
commit290a1b04c47a58b2abc28507db9c4df31a42bb3b (patch)
tree7f5b229a7ffb7630ca690510151bf6ee4bab01a5 /phpBB/phpbb/db/migration/data
parent571d6ae852fd6bc6d3ce57b00cb1faed84f45434 (diff)
downloadforums-290a1b04c47a58b2abc28507db9c4df31a42bb3b.tar
forums-290a1b04c47a58b2abc28507db9c4df31a42bb3b.tar.gz
forums-290a1b04c47a58b2abc28507db9c4df31a42bb3b.tar.bz2
forums-290a1b04c47a58b2abc28507db9c4df31a42bb3b.tar.xz
forums-290a1b04c47a58b2abc28507db9c4df31a42bb3b.zip
[ticket/12402] CAPTCHA plugin migration fails to detect missing plugins
PHPBB3-12402
Diffstat (limited to 'phpBB/phpbb/db/migration/data')
-rw-r--r--phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
new file mode 100644
index 0000000000..8fa6a3ff5b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+/**
+* Class captcha_plugin
+*
+* Reset the captcha setting to the default plugin if the defined 'captcha_plugin' is missing.
+*/
+class reset_missing_captcha_plugin extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ (!is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)),
+ array('config.update', array('captcha_plugin', 'phpbb_captcha_nogd')),
+ )),
+ );
+ }
+}