I know many of you know by now that the GD Library captcha that we have been using on nuke is old and outdated. We hear ya and couldn't agree with you more. So I started working on rewriting the function for the captcha and well, removed it. Only thing saved from the old system is just the functions names and how and where it should be shown. I installed it on this live site for more testing. You can see it working by logging in on the site and registering. I have already implemented it into the "Old Downloads" module that I had updated, as well as the feedback module. There are still somethings I am working on but the system is working great. There was an issue at first, but after a day of talking to Lonestar and smashing my head into the keyboard, (not literally), I was able to figure it out and I do discuss it below. Just read the "Update" below for that is from the original post before I edited it again to rewrite this section.
UPDATE:
Okay, after a whole day of testing, and changing things and working on it, I was able to figure out the issue and it was not with my edits, (well, i did create one little bug with my edits while I was trying to figure out what's wrong with the system), but the main issue that was causing people not to be able to register on the Your_Account module itself was actually an issue with the module and nothing I did. When the module was written, the system itself had a table open, then the form, then all the TR's and TDs for the fields then all the closing. All I had to do was move the form so it wrapped the whole table and not just the TR's and TD's.
If all goes well, if this is something you like to have on your site before the next release of the CMS and you want me to install this for you, there will be a flat fee. It won't be much. I am not going to pack this up into a readme because it would be too much to go into specifics on certain things because it really takes a basic knowledge of PHP and functions to understand what you need to do. Not every script is going to be the same. As of now, I have only coded it on my site for the new user registration, and login, which you can do from the block on the site, or, you can do it from the Your_Account module by just clicking "Account" at the top. Test it out and if you experience any issues, let me know.
Known Modules / Blocks that I know uses the old captcha system:
- Your_Account module
- File Repository
- Downloads module
- Feedback module
- CZ_UserInfo block
- Evo_User_Info block
- User_Info block
- User_Login block
If any of you can think if any others that I missed, be sure to let me know.
Before anyone suggest the File_Repository, that uses a captcha system that Lonestar put in, and not the default one.
Here is a screenshot of the ACP for it:
As you can see, the old captcha is gone, completely. I don't know if this is going to be a permanent thing we do, but as of now, I think its for the best. Signing up for a API key is VERY easy.
For Developers Only:
The calls for it in modules and blocks are going to be very similar with a few exceptions. For displaying the captcha, looks like this now:
PHP: [ Select all ]
$gfxchk = array(2,4,5,7);
echo security_code($gfxchk, 'compact', '0.95'); //Size - compact || normal //Scale Adjustment - 0.90 = 90% scaledown.
Well, as you see, you have an extra option from before.
- The first option, where $gfxchk is telling the script if it should display or not.
- Second option if the size of the captcha, should it be the long rectangle, or the smaller and more compact squarish one.
- Third option is a downscale option, (optional). It allows you to make the recaptcha even smaller if it is just a tad too big. This is done by doing something like 0.95, which will make it 95% the size of the original one. This is more for those developer that just need to adjust it ever so slightly. It's not recommended that you go less than like 0.85, or 85% of the original size. If you need to go much smaller than the compact size, then you may need to redesign your scripts layout.
The 3rd option is optional. you can get away with just
PHP: [ Select all ]
$gfxchk = array(2,4,5,7);
echo security_code($gfxchk, 'compact');
The other end of the system, for the $POST side, that has change the least, all you would need to do is is change the $_POST['gfx_check'] to $_POST['g-recaptcha-response']. Here is an example below:
PHP: [ Select all ]
$gfxchk = array(3,4,6);
if (!security_code_check($_POST['g-recaptcha-response'], $gfxchk)) {
OpenTable();
echo "<center><span class='title'><strong>"._ERRORREG."</strong></span><br /><br />";
echo "<span class='content'>"._SECCODEINCOR."<br /><br />"._GOBACK."</span></center>";
CloseTable();
include_once(NUKE_BASE_DIR.'footer.php');
exit;
}
For those of you that are just web owners, this will mean very little to you, but for those developers out there, I kept it as close as I could to the original.
Note:
You can also see the admin side of the new admin fail checker that was requested by Shadz over on Lonestars site:
Please login to see this link Get registered or Log in |
That I have been testing and running on my site for a few weeks now and has worked really good.
One other note for all the developers, I am not sure if this has to do something with recaptcha or what, but it seems to need the table that is holding whatever the captcha page is used for to be wrapped in the form tag
So let's say, you have a form that looks something like this:
PHP: [ Select all ]
echo '<table>';
echo '<form action="whatever.php?op=submit" method="post">';
echo ' <tr>';
echo ' <td colspan="2">';
The captcha will not work at all. What you would need to do is this instead.
PHP: [ Select all ]
echo '<form action="whatever.php?op=submit" method="post">';
echo '<table>';
echo ' <tr>';
echo ' <td colspan="2">";
moving the form to wrap the whole table and not between the table and the tr. You would also need to move the closing form tag as well to match, but that's just common sense.
Last edited by coRpSE on Sat Mar 24, 2018 10:34 am; edited 14 times in total
I updated my first post. I got the issue solved. It was nothing I did. I also have a list of known blocks and modules that use the old captcha system. If you can think of any that I missed, let me know and I will add them to the list.
— Lonestar wroteGreat work m8, Excellent new addition to Xtreme CMS.
Thanks.
Thank you for all of your hard work. We know keeping up with CMS updates, and things integrated into it takes a lot of time. We look forward to future updates, and what you have in store.
Okay, for those that have been listening to me in stream and on TS3, you guys know that I ran into an issue with it being a pain and not working everywhere it should, well, It's fixed. I don't know what was going on or why it was not working in certain areas, (admin login), but it works now. The only thing I different was I put the array right into the call of the function. I mean it could have been a typo in the first place because I did reinstall it into the admin login, so that is a high probability, but it's working now everywhere I have it that I can see.
I also like to note that I have updated the screenshot of the admin Security Options which may be replacing the old Security Code Options in the new CMS. I am just waiting on Lonestar for some stuff, then I will code this system in and verify its working, then get him the changed files to finalize them. In the screenshot, you can see all 3 systems so you can have an idea what will be your options for the updated security.
I also like to note that I have updated the screenshot of the admin Security Options which may be replacing the old Security Code Options in the new CMS. I am just waiting on Lonestar for some stuff, then I will code this system in and verify its working, then get him the changed files to finalize them. In the screenshot, you can see all 3 systems so you can have an idea what will be your options for the updated security.