Avatar Verification

Started by Akyhne, October 18, 2009, 09:32:39 PM

Previous topic - Next topic

Akyhne

Link to the mod

Avatar Verification v1.5
By Akyhne

Compatibility
For SMF 1.1.x (No new features are added)
For SMF 2.0, SMF 2.1 Alpha 1

Requirements
GD-lib 2.x

Introduction
REQUIRED: A manual edit is REQUIRED for ALL themes (other than SMF Core Default) which have a custom Register.template.php
If you don't do perform the edit, nobody will be able to register using those themes.

Features
o Adds a verification of 10 avatar images when people try to register
o Uses images from the forums avatar folders. You can control which folders to use*
o Adds bans to the ban list on failed attempts. Can be disabled in the admin center.
o Decide how long people should be banned by first hacking attempt
o Decide how long people should be banned by the following hacking attempt(s)
o Receive email on every bann attempt, only continousy ban attempts, or disable email
o If there's not enough avatars in the forum, a simple image with numbers are used

*) As standard, the standard avatar folders of SMF are used (For SMF 1 & 2.0.x Actors & Musicians, for SMF 2.1 Oxygen)

Installation
Simply install the package to install on the SMF Default Core Theme ONLY.

A Manual edit will be required for ALL themes (other than SMF Default Core Theme) which have a custom Register.template.php
If you don't perform the manual edit, nobody will be able to register using those themes.


Unistallation
Just uninstall the mod as usual from the package center.

Where to change settings for the mod
In SMF 1.1.x: Goto the admin center, choose registration -> Settings
In SMF 2.0 xx: Goto the admin center -> Security and Moderation -> Anti-spam

Additional Notes
GD lib is required for the mod to work.
Note that GD Lib cannot create thumbs from corrupted images. That you can view images via your browser, doesn't nessescarily mean they are not corrupted. Check your avatars! You best do that by trying out the mod several times to see if some avatars are not generated.
Servers that have Sleep() disabled, will give an error in the log. I have no solution, but to enable the sleep function! Ask your host.

Supported languages
Danish
Dutch
English
English British

Translators
Thanks to the translators who bothered making a translation:
Dutch by JulesW

Changelog
1.0 beta 1 - 18th December 2008
o First beta
o SMF 2.0 support

1.0 beta 2 - 19th December 2008
o Made a few functions to make the code more right

1.0 beta 2 rev. 1 - 20th December 2008
Edited some texts

1.0 beta 2 rev. 2 - 05th February 2009
Few edits and checked the mod to work with SMF 1.1.8 and SMF 2.0 Beta 4

1.0 beta 2 rev. 3 - 22th May 2009
Checked the mod to work with SMF 1.1.8 and SMF 2.0 RC1-1

1.0 beta 2 rev. 4 - 1st June 2009
When guest access was disabled, the mod didn't show the images.

1.0 beta 2 rev. 5 - 9th August 2009
Corrected a few small errors when spiders checked old links

1.0 beta 2 rev. 6 - 3rd October 2009
! Corrected an error that made errors in the log when the mod was disabled.
! Corrected that png files didn't work
+ Made a check for jpg, gif and png files only
+ Splitted the languages from the installation files
! Corrected a helptext in SMF that should not be there
+ Added Dutch language

1.0 beta 3 rev. 1 - 3rd October 2009
+ SMF 2 RC2 support

1.0 beta 3 rev. 2 - 27th October 2009
! When logged in users browsed to the register page, errors were generated in the log

1.0 beta 3 rev. 3 - 7th November 2009
! Corrected an error in the Dutch language

1.0 beta 3 rev. 4 - 9th November 2009
+ Added final SMF 2.0 RC2 support
! Split the language files into UTF-8 and non UTF-8 files

1.0 - 7th December 2009
! Fixed .gifs could make an error and not being generated
+ Finally went out of beta :)
+ Improved stretch and rotation of images
+ Cleaned up code to use divs instead of tables (RC2 version only)

1.1 - 27th April 2010
Added RC3 support
! Added a fix provided by butchs

1.2 - 24th May 2010
! Fixed spiders generating errors in the error log

1.3 - 2nd November 2010
+ Made an update to work with SMF2 RC4

1.4 - 14nd December 2010
- Removed SMF 2 RC1.xx support
+ Added redirect to the modsettings after installation
! Fixed users without an avatar got a default avatar when saving their profile
! Fixed GD 2.0 doesn't support rotate

1.4.1 - 7nd January 2011
! Changed the mod to use $modSettings['avatar_directory'] to make sure the mod works with a custom avatar folder (thanks to baggeroli for the idea).

1.4.2 - 12th february 2011
+ Upgraded to SMF 2 RC5 and SMF 1.1.13

1.4.3 - 17th June 2011
+ Upgraded to SMF 2.0
- Removed official support of RC's, although the mod will still work with those in an emulated enviroment
! Fixed avatars using tables in SMF 1

1.4.4 - 10th June 2012
+ SMF 2.0.2 support (no changes)

1.5 - 17th November 2012
+ Added SMF 2.1 (Alfa) support
! Fixed mod not working with SEF support (Tested with SimpleSEF & PortaMx SEF).
! Fixed the verification not showing up, when the registration agreemenent is not in use.

Costa

Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

JulesW

Congratulations on the official release!!

Today I switched from the cavecost captcha to this mod, and had several members successfully registered for the forum, and 1 one hr ban :)  However later today I had a member that generated 40 pages worth of error messages in the log.

Quotehttp://www.bitethebullet.dk/index.php?PHPSESSID=f3c7d3fc10b7d95b6f0494bec300722f&action=register

8: Undefined index: member
File: /customers/bitethebullet.dk/bitethebullet.dk/httpd.www/Sources/Profile.php
Line: 3279

There was also one error in the log that is the same as the above mentioned, but in line 3260.

Any idea what's happening here?

Appreciate any input!
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

Akyhne

I can't tell you. Your file path looks very odd and my profile.php in SMF 1.1.x forums only have ~3000 lines of code and for SMF 2 ~800 lines.
You must have other mods installed that altered that file.

JulesW

I do have other mods installed, and you're right. This bit of code is from the ultimate profile mod.
My apologies.

A completely unrelated question: Did you get a lot of complaints from users that didn't know how to complete the cavecost captcha? Ppl don't seem to read the instructions and just fill in the whole thing. That's one of the reasons we switched to this mod instead/
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

Akyhne

No, I never had any complains. But I think the Capthca mod is to complicated for registrants to use, hence this mod.

JulesW

#6
I'm sorry to bother you again, but I seems I've been wrong. The code that generates the error is from this mod, but the reason my profile.php is bigger is because of the ultimate profile mod. it is the
'checked' => $context['user']['is_guest'] ? '' : in_array($context['member']['avatar']['server_pic'], array('', 'blank.gif')),
and
'checked' => $context['user']['is_guest'] ? '' : $line == $context['member']['avatar']['server_pic'], part of the code.

I would really appreciate it if you could take a look at the file and see if there's anything wrong with it.

Today there was another user that generated 80! pages of the error I mentioned above...
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

JulesW

Today I found out what triggers the errors. Every time a user is logged in to the forum and surfs to forumurl.dk?action=register from the history, 14 pages worth of the errors are generated.
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

Akyhne

I'll take a look on it. However it's very unlikely that a user would browse that way. Sure it's not a bot?

JulesW

I'm sure they're users, cuz I when browsed the same way and generated the errors. I think that if it's the first link in the browsing history people will just hit enter on the first link that takes them to a page, regardless the action at the end of the url.
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

Akyhne

Found the "bug". Will be releasing a new version soon. Thanks for the notice!

JulesW

Ah great!

Can't wait for the new version. Deleted 212 pages with errors today :D
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

Akyhne

New version released.

Changelog:
1.0 beta 3 rev. 2 - 27th October 2009
! When logged in users browsed to the register page, errors were generated in the log

qtime

I got this feedback of a user:
blanc screen when using Safari
IE en FF are working ok

Akyhne


Sabre™

#15
Very nice mod mate!
I was working on a similar thing I had seen elsewhere, in which you would drag the chosen image into a box to confirm you weren't a bot.
Any how, I just installed this on my local, and I'm getting these 2 errors

2: imagecopyresampled(): supplied argument is not a valid Image resource
File: \Sources\Subs-CaptchaAvatar.php
Line: 110

2: imagedestroy(): supplied argument is not a valid Image resource
File: \Sources\Subs-CaptchaAvatar.php
Line: 111


Do you have any idea why this is?
Cheers :)

EDIT:
Just tried it online on a test site and received these, but not the above errors
2: sleep() has been disabled for security reasons
File: /Sources/Register.php
Line: 599

2: sleep() has been disabled for security reasons
File: /Sources/Register.php
Line: 714


EDITS EDIT:
Just changed the error code, as I just tried it on a fresh install.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Akyhne

The first error, I guess, is because some of your image files are corrupted. The second one, I'll have to look further into.

JulesW

Today I had a ip that upon googling was listed as a spam server on the honeypot website, and generated errors in the log.
Quote2: Invalid argument supplied for foreach()
File: /Sources/Subs-CaptchaAvatar.php
line:16
Quote8: Undefined index: AvatarsToShow
File: /customers/bitethebullet.dk/bitethebullet.dk/httpd.www/Sources/Subs-CaptchaAvatar.php
line 8
last one is repeated for line 16

any idea why this is?
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

simplebeer

i got a error on the dutch "help.dutch.php"

Parse error: syntax error, unexpected T_STRING in /mnt/web6/40/02/51993402/htdocs/forum/Themes/default/languages/Help.dutch.php on line 499

499: $helptxt['verification_avatar_folders'] = 'Deze mod maakt gebruik van uw standaard avatar map "Actors" en "Musicians".<br />Als u plaatjes uit een andere submap in de avater map wilt gebruiken kunt u deze hier opgeven, gescheiden door komma/'s.<br /><br /><b>Nb</b>: Wees voorzichtig bij deze selectie. Er zouden prive folders bij kunnen zitten waarvan u liever niet wilt dat deze openbaar worden! Het zou kunnen voorkomen dat er identieke plaatjes in de mappen zitten. Dit maakt het onmogelijk voor gebruikers het juiste plaatje te selecteren.<br /><br />De maker van deze mod, raad u aan de mod <a href="http://custom.simplemachines.org/mods/index.php?mod=644" target="blank">Country Flags Avatars</a> te instaleren. Deze voegt 259 verschillende vlaggen toe aan uw avater folder in een submap "CountryFlags".';

500: $helptxt['verification_avatar_first_ban'] = 'De eerste keer dat een gebruiker de test niet doorstaat, wordt hij/zij geband voor het hier opgegeven aantal uren. Standaard is ingesteld op 1 uur.';
501

Does someone know the problem?

Gr
Sorry for my poor English, but i think it's probably better then your Dutch :)

simplebeer

i think its something with the (') sign (don't know the word in english  :-X )

Shouldn't that sign end with /' ?

Gr
Sorry for my poor English, but i think it's probably better then your Dutch :)

Advertisement: