[BETA] AJAX Registration Checks 0.1.2

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
Locked
devilside
Registered User
Posts: 48
Joined: Thu Dec 13, 2007 5:11 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by devilside »

i changed

Code: Select all

elseif ($mode == 'passwordcheck')
{
	//
	// Check that the two passwords given are the same
	//
	
	// Set the variables
	$password1 = utf8_normalize_nfc(request_var('password1', '', true));
	$password2 = utf8_normalize_nfc(request_var('password2', '', true));
	
	// Check the password doesn't contain any illegal chars, etc.
	$passwordcheckresult = validate_password($password1);
	
	// Check if it the password is ok (false means it is)
	if ($passwordcheckresult === false)
	{
		// Check the passwords are the same
		if ($password1 == $password2)
		{
			// Passwords are the same, show a correct message
			$return = 'passwordcheck|' . $user->img('icon_ajax_true', 'AJAX_CHECK_PASSWORD_TRUE') . '&nbsp;<span style="color: #008000;">' . $user->lang['AJAX_CHECK_PASSWORD_TRUE'] . '</span>';
			
			// Now, check the "strength" of the password and show an image accordingly
			function check_password_strength($password)
			{
			    
			    $strength = 0;
			    $patterns = array('#[a-z]#','#[A-Z]#','#[0-9]#','/[¬!"£$%^&*()`{}\[\]:@~;\'#<>?,.\/\\-=_+\|]/');
			    foreach($patterns as $pattern)
			    {
			        if(preg_match($pattern, $password, $matches))
			        {
			            $strength++;
			        }
			    }
			    
			    if (strlen($password) < 6 && $strength > 2)
			    {
			    	// If the length is less than 6 maximum can be rating can be 2
			    	$strength = 2;
			    }
			    elseif (strlen($password) >= 14 && $strength != 4)
			    {
			    	// If the length is 14 or more then give it one higher rating (unless 4 already)
			    	$strength++;
			    	
			    }
			    return $strength;
			}
			
			// Why not actually do the check now that we've got the function done :-)
			$passwordstrength = check_password_strength($password1);
			$return = $return . '<br /><br />' . $user->img('icon_ajax_password_strength_' . $passwordstrength, 'AJAX_CHECK_PASSWORD_STRENGTH') . '&nbsp;' . $user->lang['AJAX_CHECK_PASSWORD_STRENGTH_' . $passwordstrength];

		}
		else
		{
			// Passwords not the same, show the error
			$return = 'passwordcheck|' . $user->img('icon_ajax_false', 'AJAX_CHECK_PASSWORD_FALSE') . '&nbsp;<span style="color: #FF0000;">' . $user->lang['AJAX_CHECK_PASSWORD_FALSE'] . '</span>';
		}
	}
	else
	{
		// Failed the password validation
		$return = 'passwordcheck|' . $user->img('icon_ajax_false', 'AJAX_CHECK_PASSWORD_FALSE') . '&nbsp;<span style="color: #FF0000;">' . $user->lang[$passwordcheckresult . '_PASSWORD'] . '</span>';
	}
	
	// Stop execution and show the result
	die($return);
back to

Code: Select all

elseif ($mode == 'passwordcheck')
{
	//
	// Check that the two passwords given are the same
	//
	
	// Set the variables
	$password1 = utf8_normalize_nfc(request_var('password1', '', true));
	$password2 = utf8_normalize_nfc(request_var('password2', '', true));
	
	// Check the passwords are the same
	if ($password1 == $password2)
	{
		$return = 'passwordcheck|' . $user->img('icon_ajax_true', 'AJAX_CHECK_PASSWORD_TRUE') . '&nbsp;<span style="color: #008000;">' . $user->lang['AJAX_CHECK_PASSWORD_TRUE'] . '</span>';
	}
	else
	{
		$return = 'passwordcheck|' . $user->img('icon_ajax_false', 'AJAX_CHECK_PASSWORD_FALSE') . '&nbsp;<span style="color: #FF0000;">' . $user->lang['AJAX_CHECK_PASSWORD_FALSE'] . '</span>';
	}
	
	// Stop execution and show the result
	die($return);
The new passwordcheck was not working for me, now its working okay.
Marius_Krack
Registered User
Posts: 15
Joined: Mon Jan 29, 2007 1:41 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by Marius_Krack »

I think that I've found a bug.
If I entered in the two password-fields "-#" and so on, the check said "Your passwords are not the same", but they are the same.

I use phpBB gold.
My English is bad, because I'm from Germany. I speak only German and a little bit English.
devilside
Registered User
Posts: 48
Joined: Thu Dec 13, 2007 5:11 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by devilside »

I had the same problem. I Changed it and now its working but i'am still waiting of a next release. :)
s60Addict
Registered User
Posts: 49
Joined: Tue Sep 26, 2006 5:08 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by s60Addict »

Isnt checking Username length at the demo board!

I entered "hi". it says This username is still available
crevette
Registered User
Posts: 4
Joined: Thu Dec 27, 2007 1:56 pm
Location: France - normandy

Re: [BETA] AJAX Registration Checks 0.1.2

Post by crevette »

draky wrote: But got a white blank page on registration, after agreement...
MOD uninstalled, cause don't see where the problem came...
Your problem comes from the french file "ajaxchecks.php"
In the translation, they have two mistakes.

Find

Code: Select all

	'AJAX_CHECK_PASSWORD_STRENGTH_4'	=>	'Mot de passe Robuste'
	'AJAX_CHECK_EMAIL_TRUE'			=>	'Vos adresses eMails correspondent',
	'AJAX_CHECK_EMAIL_FALSE'		=>	'Vos adresses eMails ne correspondent pas',
	'AJAX_CHECK_EMAIL_FORMAT_FALSE'	=>	'Le format de votre adresse eMail n'est pas correct',
Replace With

Code: Select all

	'AJAX_CHECK_PASSWORD_STRENGTH_4'	=>	'Mot de passe Robuste',
	'AJAX_CHECK_EMAIL_TRUE'			=>	'Vos adresses eMails correspondent',
	'AJAX_CHECK_EMAIL_FALSE'		=>	'Vos adresses eMails ne correspondent pas',
	'AJAX_CHECK_EMAIL_FORMAT_FALSE'	=>	'Le format de votre adresse eMail n\'est pas correct',
ghettowboy
Registered User
Posts: 216
Joined: Tue Jun 12, 2007 3:53 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by ghettowboy »

i would very much still like to see an ip check with this ... checking for duplicate ips
Anyasha
Registered User
Posts: 704
Joined: Mon Aug 07, 2006 4:02 am
Name: Anyasha

Re: [BETA] AJAX Registration Checks 0.1.2

Post by Anyasha »

I tried this out and it didn't even check the username field. The email and passwords stay on "checking to see if..." and never change, I let it set for MINUTES and it never changed. The password level check didn't even show. I undid the changes and re-did them, refreshed the template and imageset, and still the same thing. So I uninstalled it.
Kiss me, I'm Polish!
jordguitar
Registered User
Posts: 1
Joined: Fri Mar 14, 2008 7:14 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by jordguitar »

Code: Select all

[phpBB Debug] PHP Notice: in file /adm/index.php on line 149: Cannot modify header information - headers already sent by (output started at /language/en/acp/styles.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 151: Cannot modify header information - headers already sent by (output started at /language/en/acp/styles.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 152: Cannot modify header information - headers already sent by (output started at /language/en/acp/styles.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /language/en/acp/styles.php:1)
That is what I get after installing. What happened?
User avatar
tas2580
Registered User
Posts: 295
Joined: Wed May 30, 2007 1:56 am
Location: Stuttgart, Germany
Contact:

Re: [BETA] AJAX Registration Checks 0.1.2

Post by tas2580 »

I had a little bug with german letters like äöü

find in ajaxchecks.php 3x

Code: Select all

die($return);
replace with

Code: Select all

die(utf8_decode($return));
And here my german translation for this Mod:

Code: Select all

<?php

/**
* DO NOT CHANGE
*/
if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// AJAX Checks stuff
$lang = array_merge($lang, array(
	'AJAX_CHECK_USERNAME_FALSE'		=>	'Der Benutzername wird bereits verwendet',
	'AJAX_CHECK_USERNAME_TRUE'		=>	'Der Benutzername ist noch frei',
	'AJAX_CHECKING'					=>	'Checking using AJAX',
	'AJAX_CHECKING_USERNAME'		=>	'Pr&uuml;ft ob der Benutzername noch frei ist',
	'AJAX_CHECKING_PASSWORD'		=>	'Pr&uuml;ft ob die Passw&ouml;rter gleich sind',
	'AJAX_CHECKING_EMAIL'			=>	'Pr&uuml;ft ob die E-Mail Adresse gleich ist',
	'AJAX_CHECK_PASSWORD_TRUE'		=>	'Die Passw&ouml;rter sind gleich',
	'AJAX_CHECK_PASSWORD_FALSE'		=>	'Die Passw&ouml;rter sind nicht gleich',
	'AJAX_CHECK_PASSWORD_STRENGTH'	=>	'Deine Passwortst&auml;rke',
	'AJAX_CHECK_PASSWORD_STRENGTH_1'	=>	'Sehr schwaches Passwort',
	'AJAX_CHECK_PASSWORD_STRENGTH_2'	=>	'Schwaches Passwort',
	'AJAX_CHECK_PASSWORD_STRENGTH_3'	=>	'Akzeptabeles Passwort',
	'AJAX_CHECK_PASSWORD_STRENGTH_4'	=>	'Starkes Passwort',
	'AJAX_CHECK_EMAIL_TRUE'			=>	'Die E-MailAdressen sind gleich',
	'AJAX_CHECK_EMAIL_FALSE'		=>	'Die E-MailAdressen sind nicht gleich',
	'AJAX_CHECK_EMAIL_FORMAT_FALSE'	=>	'Die E-Mail Adresse hat ein falsches Format',
));

?>
devilside
Registered User
Posts: 48
Joined: Thu Dec 13, 2007 5:11 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by devilside »

password strength dont displayed...
saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Re: [BETA] AJAX Registration Checks 0.1.2

Post by saaiberke »

Did somebody get this working on subsilver2 or subsilver2 based style? I really need this for my new board style but it is a subsilver2 based one..... :-(

Nic
User avatar
justhink
Registered User
Posts: 55
Joined: Fri Jun 29, 2007 10:26 pm
Name: Saugata Datta

Re: [BETA] AJAX Registration Checks 0.1.2

Post by justhink »

Marius_Krack wrote:I think that I've found a bug.
If I entered in the two password-fields "-#" and so on, the check said "Your passwords are not the same", but they are the same.

I use phpBB gold.

Open ajaxchecks.php
Find:

Code: Select all

	// Set the variables
	$password1 = utf8_normalize_nfc(request_var('password1', '', true));
	$password2 = utf8_normalize_nfc(request_var('password2', '', true));
replace with

Code: Select all

	// Set the variables
	$password1 = urldecode(utf8_normalize_nfc(request_var('password1', '', true)));
	$password2 = urldecode(utf8_normalize_nfc(request_var('password2', '', true)));
Open ucp_register.html
Find

Code: Select all

		// Make the request
	    http.open('get', '{AJAX_CHECKS_FILE}?mode='+mode+'&'+valuename1+'='+value1+'&'+valuename2+'='+value2);
Replace with,

Code: Select all

		// Make the request
	    http.open('get', '{AJAX_CHECKS_FILE}?mode='+mode+'&'+valuename1+'='+escape(value1)+'&'+valuename2+'='+escape(value2));
after that everything will works fine.. in FF and IE both..
:)
Hav FunZ
User avatar
fiorefrank
Registered User
Posts: 226
Joined: Fri Jun 08, 2007 10:43 am
Location: Italy
Contact:

Re: [BETA] AJAX Registration Checks 0.1.2

Post by fiorefrank »

yeah!!!
really a nice mod!
ttuu
Registered User
Posts: 224
Joined: Wed Feb 13, 2008 6:28 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by ttuu »

i heve a problem.
if i writer in "username" user name in hebrew character the "AJAX Registration Checks" to say "The username contains forbidden characters" even the hebrew character is not forbidden for my board.
J.o.h
Registered User
Posts: 32
Joined: Tue May 11, 2004 12:47 pm

Re: [BETA] AJAX Registration Checks 0.1.2

Post by J.o.h »

Very nice mod!
Works fine!

:)

Here is a "Geman Lang Pack"

;)
Locked

Return to “[3.0.x] MODs in Development”