diff -r 000000000000 -r ceef6d64c21d includes/captcha/captcha_factory.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/includes/captcha/captcha_factory.php Wed Mar 07 16:41:10 2012 +0400 @@ -0,0 +1,100 @@ + array(), + 'unavailable' => array(), + ); + + $dp = @opendir($phpbb_root_path . 'includes/captcha/plugins'); + + if ($dp) + { + while (($file = readdir($dp)) !== false) + { + if ((preg_match('#_plugin\.' . $phpEx . '$#', $file))) + { + $name = preg_replace('#^(.*?)_plugin\.' . $phpEx . '$#', '\1', $file); + if (!class_exists($name)) + { + include($phpbb_root_path . "includes/captcha/plugins/$file"); + } + + if (call_user_func(array($name, 'is_available'))) + { + $captchas['available'][$name] = call_user_func(array($name, 'get_name')); + } + else + { + $captchas['unavailable'][$name] = call_user_func(array($name, 'get_name')); + } + } + } + closedir($dp); + } + + return $captchas; + } +} + +?> \ No newline at end of file