Session cookie is configurable. Added apache2 config example.
[toast/cookiecaptcha.git] / CookieCaptcha.class.php
index a85973608223f3438f4c2326d53feae9ad6459a3..b96ac4c674db1774ca47df8333bf1fcbce89471d 100644 (file)
@@ -10,7 +10,8 @@ class CookieCaptcha extends SimpleCaptcha {
         * @return bool
         */
        function keyMatch( $answer, $info ) {
-               if (isset($_COOKIE['cookiecaptcha'])) {
+               global $wgCaptchaCookieName;
+               if (isset($_COOKIE[$wgCaptchaCookieName])) {
                        wfDebug( "CookieCaptcha: Found cookie\n" );
                        return true;
                } else {
@@ -43,11 +44,12 @@ class CookieCaptcha extends SimpleCaptcha {
         * Insert the captcha prompt into the edit form.
         */
        function getForm() {
-               global $wgLogo;
+               global $wgCaptchaCookieName, $wgCaptchaCookieImage, $wgCaptchaCookieAlt, $wgCaptchaCookieStyle;
                return "<p>" .
                        Html::element( 'img', array(
-                               'src'    => $wgLogo,
-                               'alt'    => '' ) ) .
+                               'src'    => $wgCaptchaCookieImage,
+                               'alt'    => $wgCaptchaCookieAlt,
+                               'style'  => $wgCaptchaCookieStyle ) ) .
                        "</p>\n";
        }