|
how to use the CB captcha plugin 2 Months, 4 Weeks ago
|
|
I am not sure where to post this, so I'll just try here...
I am using FB 1.0.5 RC2 and some of my subforums are public and need a captcha. Unfortunately the Fireboard captcha plugin does not work for some reason. I posted about this but got a little impatient, I never really liked the SecurityImages captchas much, and also I realised that it would be nice to have one captcha style throughout the website instead of a different one for each component. The captcha used most in my website is that of the Community Builder plugin, so I decided to have a go at that.
I am pretty sure that I am almost there, and basically what I have done is similar to 'Hack to use the cb on the Joomla Contact form' here: www.joomlapolis.com/component/option,com...ew/catid,7/id,35409/. I have spread the bits of code around FB files more or less like someone who put reCaptcha into FireBoard (see www.bestofjoomla.com/component/option,co...w/id,55112/catid,75/).
The only thing I think I am stuck with is where to put the bit that checks the captcha:
| Code: |
if ( ! (($_SESSION['security_code'] == mosGetParam($_REQUEST,"captcha")) && (!empty($_SESSION['security_code'])) ) ) {
mosErrorAlert( "Invalid Security Code" );
}
|
I think this will have to go where Fireboard checks the form input, but I just haven't figured out yet where that happena.. So if there is anyone who could help me suggest where to put this, hopefully it will work and then I would be more than happy to make a small contribution to FB by posting this hack.
Btw I think I will try to make an option for choosing between the existing captcha and the CB captcha but first I'd like it to actually work!
|
|
ewel (User)
Junior Boarder
Posts: 61
|
Logged
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 3 Weeks ago
|
|
I figured out how to use the CB Captcha plugin for Community Builder in Fireboard instead of the standard captcha (see extensions.joomla.org/component/option,c...k_id,1802/Itemid,35/).
What is nice about this is that when you use CB with FB you will have one type of captcha instead of two, and in the settings of the plugin you can adjust the colour to match your website layout.
I have made my hack in such a way that there is an option in the Fireboard backend to switch using the CB Captcha plugin on and off - and the general captcha option is also still there. Also, I think I managed to avoid potential problems by making the bits of code work only if the plugin is actually installed.
I am using Joomla 1.5.7 with FB 1.0.5 RC2 b804 of 2008-10-10 and CB 1.1 and CB Captcha Plugin 1.0.3 of 2007-02-12. If you have another setup this hack may not work. Also, I have made the hack in such a way that it works only with Joomla 1.5. In fact it should not need the legacy plugin except for one line where I did not manage to find the equivalent of 'mosErrorAlert' (if you know how please tell me!).
Before you use this hack, backup everything and in particular your database.
In order to use this hack you need an extra field in your database where FB stores its settings. I created this field with PhpMyAdmin and got the following as confirmation of success:
ALTER TABLE `jos_fb_config` ADD `cbcaptcha` INT( 11 ) NULL DEFAULT NULL COMMENT 'ADDED BY EW'; This will put the Use CB Captcha option at No, so you will still have to activate it in the Fireboard settings.
For the remainder, you need the hacked code in the files in the attached zip. Showing the changes in this post would take more time than I have today, but if you open the files and scroll down through them you will see the changes very clearly marked. If you are using the above mentioned version of Fireboard without changes and modifications, you can also unpack the zip, strip the filenames from '_ed_cbcaptchahack_105rc2b804', make a backup of your FB installation and database tables, and upload the files to their respective folders.
When all is done you should be able to activate the use of the CB Captcha Plugin in Fireboard in the FB Integration settings under Community Builder.
Have fun with it!
|
|
ewel (User)
Junior Boarder
Posts: 61
|
Logged
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 3 Weeks ago
|
|
|
Hi
Does your 'hack' works with CB CAPTCHA 2.0 ?
I use CB Captcha 2.0
I would be veyr very happy if you can make a hack so that CB CAPTCHA 2.0 can work with both Joomla (1.0.x) Contact and Fireboard.
For more support, email me -
|
|
|
Logged
|
|
|
Last Edit: 2008/10/15 16:10 By iosoft.
|
|
Developer: FB-Poll System, FB-Joomap plugin, FB-OpenSEF extension, FB-Primezilla Hacker, Fireboard WAP.
Vote my site- GigaHertZ
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 3 Weeks ago
|
|
Btw I forgot a small but crucial bit of info..
If you use the free version 1 of the CB Captcha plugin itself, /components/com_comprofiler/plugin/user/plug_cbcaptcha/cb.captcha.php, you need to make all the $_PLUGINS->registerFunction() calls conditional as shown below:
| Code: |
if ($_PLUGINS) {
$_PLUGINS->registerFunction( 'onBeforeRegisterForm', 'onBeforeRegisterForm', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onBeforeUserRegistration','onBeforeUserRegistration', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onLostPassForm', 'onLostPassForm', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onLostPassForm', 'onLostPassFormB', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onBeforeNewPassword', 'onBeforeNewPassword', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onAfterEmailUserForm', 'onAfterEmailUserForm', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onBeforeEmailUser', 'onBeforeEmailUser', 'getcaptchaTab' );
}
|
If you have version 2 for joomlapolis document subscribers the last module setting already does this trick.
|
|
ewel (User)
Junior Boarder
Posts: 61
|
Logged
|
|
|
Last Edit: 2008/10/16 03:39 By ewel.
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 3 Weeks ago
|
|
I personally used your HACK with CB Captcha 1.1. Then I switched to Captcha 2.0. So have to remove the HACK.
I am eagerly waiting for your HACK to be used with -
- Joomla Contact
- Fireboard
- Fireboard-DisscussBot
Don't take toooo much time
PM me when done.
|
|
|
Logged
|
|
Developer: FB-Poll System, FB-Joomap plugin, FB-OpenSEF extension, FB-Primezilla Hacker, Fireboard WAP.
Vote my site- GigaHertZ
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 3 Weeks ago
|
|
I don't think you have to remove anything from cb.captcha.php in version 2+. Those with the free version have to hack to add what is standard in version 2+.
For a hack of the Joomla contact form see the post of phlux0r at www.joomlapolis.com/component/option,com...ew/id,35381/catid,7/ which in fact is what I based my hack on. I think he probably based it on this explanatory post by beat: www.joomlapolis.com/component/option,com...mit,6/limitstart,12/.
The way discussbot works the only reason for having a captcha would be allowing guests to use the quick comment form. If guests cannot use the quick form they will be put into Fireboard when they make a comment and there they would get a captcha. If registered users use either the Discussbot quickform or Fireboard to post, they will not get a captcha because they (should) already have come across a captcha at login. So I'd have to see about putting a captcha in the Discussbot quick form, but for myself I think I would simply disallow the quick form for guests.
|
|
ewel (User)
Junior Boarder
Posts: 61
|
Logged
|
|
|
Last Edit: 2008/10/16 11:10 By ewel.
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 3 Weeks ago
|
|
Eagerly waiting for the 'hack' with CB2.0 
|
|
|
Logged
|
|
Developer: FB-Poll System, FB-Joomap plugin, FB-OpenSEF extension, FB-Primezilla Hacker, Fireboard WAP.
Vote my site- GigaHertZ
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 2 Weeks ago
|
|
As far as I can find out it simply is not possible to use the CB Captcha Plugin 2.x outside of the CB plugins framework, although ironically the creators thought they specifically provided for doing so. The many experiments I did all fail, mostly with this error:
Fatal error: Call to a member function get() on a non-object in /home/aapje06/public_html/joomlaloft.com/components/com_comprofiler/plugin/user/plug_cbcaptcha/cb.captcha.php on line 136
If the CB team has in fact tested the use of the classes of the plugin from outside the CB framework it would be nice to find how they did that, but I cannot find even one example out there of anyone managing this.
In short, don't waste your time, use version 1, and hope that the CB team will one day release a version which does work outside of CB.
There is an alternative, which I do not want to waste my time on, which is to use the code that the plugin is probably based on and apply it whereever you need:
http://www.white-hat-web-design.co.uk/articles/php-captcha.php
|
|
ewel (User)
Junior Boarder
Posts: 61
|
Logged
|
|
|
|
|
|
Re:how to use the CB captcha plugin 2 Months, 1 Week ago
|
|
|
any progress ?
|
|
|
Logged
|
|
Developer: FB-Poll System, FB-Joomap plugin, FB-OpenSEF extension, FB-Primezilla Hacker, Fireboard WAP.
Vote my site- GigaHertZ
|
|
|
|
|
|