aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/captcha/captcha_plugin.php
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2009-06-02 14:12:23 +0000
committerHenry Sudhof <kellanved@phpbb.com>2009-06-02 14:12:23 +0000
commitb776d02682492077a4fafd8835d7c4a17e50762d (patch)
tree0c94c7e662baaaf047f1eace9658bd13fc36b8e3 /phpBB/includes/captcha/captcha_plugin.php
parentb9ece6bdfe65b2e63c42d4a83fd831b4377e1b90 (diff)
downloadforums-b776d02682492077a4fafd8835d7c4a17e50762d.tar
forums-b776d02682492077a4fafd8835d7c4a17e50762d.tar.gz
forums-b776d02682492077a4fafd8835d7c4a17e50762d.tar.bz2
forums-b776d02682492077a4fafd8835d7c4a17e50762d.tar.xz
forums-b776d02682492077a4fafd8835d7c4a17e50762d.zip
Okay, a first ci of the new captcha plugins. We'll add dynamic template includes later, as well as documentation on how to use this. I'm prepared to get yelled at for bugs (oh, I know that there are plenty); but please blame spammers for broken styles and MODs.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9524 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/captcha/captcha_plugin.php')
-rwxr-xr-xphpBB/includes/captcha/captcha_plugin.php97
1 files changed, 97 insertions, 0 deletions
diff --git a/phpBB/includes/captcha/captcha_plugin.php b/phpBB/includes/captcha/captcha_plugin.php
new file mode 100755
index 0000000000..08a149764c
--- /dev/null
+++ b/phpBB/includes/captcha/captcha_plugin.php
@@ -0,0 +1,97 @@
+<?
+
+interface phpbb_captcha_plugin
+{
+ /**
+ * Initiates the CAPTCHA to validate codes.
+ * @param int $type the type as defined in constants.php
+ */
+ function init($type);
+
+
+ /**
+ * Returns true if the captcha will work on the current install
+ */
+ static function is_available();
+
+ /**
+ * Returns the translated pretty name of the captcha.
+ */
+ static function get_name();
+
+ /**
+ * Returns the class name of the captcha.
+ */
+ static function get_class_name();
+
+ /**
+ * Returns an instance; does not have to be the same instance twice.
+ */
+ static function get_instance();
+
+ /**
+ * Returns the HTML needed to embed the captcha in another template
+ */
+ function get_template();
+
+
+ /**
+ * Delivers the image of image based captchas; not required for text/remote etc CAPTCHAs
+ */
+ function execute();
+
+ /**
+ * Returns the HTML needed to display a demo of the captcha
+ */
+ function get_demo_template($id);
+
+
+ /**
+ * Delivers the demo image of image based captchas; not required for text/remote etc CAPTCHAs
+ */
+ function execute_demo();
+
+ /**
+ * Clears leftover entries in the database.
+ */
+ static function garbage_collect($type);
+
+
+ /**
+ * Clears all entries from the database if the CAPTCHA is replaced
+ */
+ function uninstall();
+
+ /**
+ * Sets up the CAPTCHA when it is selected in the ACP.
+ */
+ function install();
+
+
+ /**
+ * Checks the captcha; returns false if the code was correct; a translated error string otherwise
+ */
+ function validate();
+
+ /**
+ * Prepares the captcha to ask a new question; required call on failed answers
+ */
+ function reset();
+
+ /**
+ * Displays the configuration options in the ACP
+ */
+ function acp_page($id, &$module);
+
+ /**
+ * Returns the entries for the hidden field array needed to preserve the current state.
+ */
+ function get_hidden_fields();
+
+
+ /**
+ * Returns the number of solving attempts of the current user
+ */
+ function get_attempt_count();
+
+} \ No newline at end of file