Page Index Toggle Pages: 1 2 [3] 4 
Topic Tools
Very Hot Topic (More than 25 Replies) [Serious] Check usernames when registering (Read 18,831 times)
cepheid
Senior Member
****
Offline



Posts: 516
Re: Check usernames when registering
Reply #18 - Jul 10th, 2009 at 3:50am
Post Tools
Unilat wrote on Jul 10th, 2009 at 3:37am:
So this must be due to the change deti has made.

I think so, because I think it has to do with the behavior of the MemberList function.  Yes, I made that comment after testing on the SVN version.
« Last Edit: Jul 10th, 2009 at 3:51am by cepheid »  
Back to top
WWW  
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Re: Check usernames when registering
Reply #17 - Jul 10th, 2009 at 3:37am
Post Tools
cepheid wrote on Jul 9th, 2009 at 11:29pm:
Also, it appears that the Display Name checks against both displayed name AND userid... is this deliberate?  For example, I tried putting a displayname of "admin" and it said it was taken, even though my admin user has a displayname of "YaBB Administrator" ...  my forum doesn't require displayname != userid, so I think the displayname should only check against displaynames, not userids.  (This would still take care of both possibilities.)


Was this tested in the new SVN or with the code on my test site? My test site, I swore  Wink, checks only against display name for the display name. In fact I just tested and "admin" in the display name does not return taken. So this must be due to the change deti has made.

And yes, I always capitalize my filenames and images, but that can be changed no issues  Smiley
« Last Edit: Jul 10th, 2009 at 3:39am by Unilat »  
Back to top
 
IP Logged
 
OH Eng
Past Team Members
Documentation Team
Offline



Posts: 4,026
Location: Pensacola, Florida USA
Re: Check usernames when registering
Reply #16 - Jul 10th, 2009 at 2:16am
Post Tools
Can I make a recommendation that you change the file names from Cross.png and Check.png to cross.png and check.png?  Right now those are the only two files in the whole image directory with names that have leading capitals.  Small thing, but for consistency.

  

 
Back to top
 
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Check usernames when registering
Reply #15 - Jul 9th, 2009 at 11:29pm
Post Tools
Minor bug: if the field is cleared, the "taken/not taken" status should also be cleared.  This is mostly cosmetic since all these fields are required, so it's not a functional improvement, just a minor UI consistency thing.

Also, it appears that the Display Name checks against both displayed name AND userid... is this deliberate?  For example, I tried putting a displayname of "admin" and it said it was taken, even though my admin user has a displayname of "YaBB Administrator" ...  my forum doesn't require displayname != userid, so I think the displayname should only check against displaynames, not userids.  (This would still take care of both possibilities.)
« Last Edit: Jul 9th, 2009 at 11:30pm by cepheid »  
Back to top
WWW  
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Re: Check usernames when registering
Reply #14 - Jul 9th, 2009 at 11:03pm
Post Tools
Is MemberIndex new? I had no clue it was there if its old!  Cheesy

Those changes are fine, although either way didnt make too much of a difference.
  
Back to top
 
IP Logged
 
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: Check usernames when registering
Reply #13 - Jul 9th, 2009 at 9:26pm
Post Tools
New
cgi-bin/yabb2/Languages/English/Register.lng
cgi-bin/yabb2/Sources/Register.pl
cgi-bin/yabb2/Sources/SubList.pl
cgi-bin/yabb2/Sources/UserSelect.pl
cgi-bin/yabb2/YaBB.pl
public_html/yabbfiles/ajax.js
public_html/yabbfiles/Templates/Forum/default/Check.png
public_html/yabbfiles/Templates/Forum/default/Cross.png
public_html/yabbfiles/Templates/Forum/yabb21/Check.png
public_html/yabbfiles/Templates/Forum/yabb21/Cross.png

in SVN.

Changelog:
=============
- Added user ID, Displayed Name and Email Ajax Check
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Check usernames when registering
Reply #12 - Jul 9th, 2009 at 7:57pm
Post Tools
Hmmm, Register.pl does it this way as I modified you sub Unilat:
Code
Select All
sub checkUserAvail {
	my $taken = "false$INFO{'type'}";

	if ($INFO{'type'} eq "email") {
		$INFO{'email'} =~ s~\A\s+|\s+\z~~g;
		if (lc $INFO{'email'} eq lc &MemberIndex("check_exist", $INFO{'email'})) { $taken = "trueemail" };
	} elsif ($INFO{'type'} eq "display") {
		$INFO{'display'} =~ s~\A\s+|\s+\z~~g;
		if (lc $INFO{'display'} eq lc &MemberIndex("check_exist", $INFO{'display'})) { $taken = "truedisplay" };
	} elsif ($INFO{'type'} eq "user") {
		$INFO{'user'} =~ s~\A\s+|\s+\z~~g;
		$INFO{'user'} =~ s/\s/_/g;
		if (lc $INFO{'user'} eq lc &MemberIndex("check_exist", $INFO{'user'})) { $taken = "trueuser" };
	}

	print "Content-type: text/plain\n\n$taken";

	CORE::exit; # This is here only to avoid server error log entries!
} 

  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Re: Check usernames when registering
Reply #11 - Jul 9th, 2009 at 7:46pm
Post Tools
I dont think YaBB is case sensitive when it comes to user ids. It would make sense not to be so two people werent named the same thing with only a variation in capital letters. If it is not, then go ahead and make the changes once the files are in SVN. deti probably will make the language changes before he submits them but if not then go ahead and do those too  Wink
  
Back to top
 
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Check usernames when registering
Reply #10 - Jul 9th, 2009 at 7:29pm
Post Tools
Unilat wrote on Jul 9th, 2009 at 2:40pm:
Try again. Included images and text as well as display name checking.

Looks great.  One thing: you might want to make the searches case-insensitive, especially for the email address and displayed name, since YaBB isn't case-sensitive on those.

(I'm not sure if YaBB is case-sensitive on usernames or not.)

Or, I can do it, plus add the appropriate Register.lng text, once it's integrated into SVN. Smiley
« Last Edit: Jul 9th, 2009 at 7:31pm by cepheid »  
Back to top
WWW  
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Re: Check usernames when registering
Reply #9 - Jul 9th, 2009 at 5:17pm
Post Tools
I have much more time now to provide fixes and new features since school is out. Work is pretty slow and I have time here (where I am now) to do things in between.

So anything you need just ask, especially AJAX features lol. But of course I'll modify other things as well. Sometimes AJAX can be tiring.  Tongue

Here are the changed files. All that needs to be done is find the appropriate place to put the strings from Register.pl. They are hardcoded into the printed javascript variables and should be moved to register.lng.
  

RegisterAvailability.zip ( 29 KB | 201 Downloads )
Back to top
 
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Check usernames when registering
Reply #8 - Jul 9th, 2009 at 4:26pm
Post Tools
Unilat wrote on Mar 7th, 2009 at 2:17am:
I might get a chance to look at it tomorrow

Grin Tomorrow? 4 month have past. Grin

Wink

Good job Unilat!! Can you attach a zip with the changed files so I can overtake it into Y3?
« Last Edit: Jul 9th, 2009 at 4:31pm by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Re: Username and Email availability (AJAX)
Reply #7 - Jul 9th, 2009 at 2:40pm
Post Tools
Try again. Included images and text as well as display name checking.

Taken display name: Unilat
« Last Edit: Jul 9th, 2009 at 2:42pm by Unilat »  
Back to top
 
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Username and Email availability (AJAX)
Reply #6 - Jul 9th, 2009 at 4:00am
Post Tools
Great feature, this would certainly help on larger boards.  I'd recommend using text instead of images because the "X" doesn't tell people why the entry was rejected... having text would make it clear that "this username is already taken."

If you haven't done so already, this should also extend to the Displayed Name.

You might also want to update the "Taken" and "Not Taken" text to be a bit longer, e.g. "This username is already registered; please choose another" and/or "This username is available!"
« Last Edit: Jul 9th, 2009 at 4:02am by cepheid »  
Back to top
WWW  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: Username and Email availability (AJAX)
Reply #5 - Jul 9th, 2009 at 3:36am
Post Tools
This is pretty neat.

All new features will go into Y3, so that's what you should target Wink

We're just starting the really big changes, so your code will probably still work with the current Y3 codebase.
  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Username and Email availability (AJAX)
Reply #4 - Jul 9th, 2009 at 1:54am
Post Tools
This was asked a while ago and I finally had time to whip up the code. Test it out at:

http://nbvrl.servebeer.com/~shoutbox/cgi-bin/yabb2/YaBB.pl

This was written on 2.4 non database code. So it may or may not work on the base Y3 code. But I figured I'd better not write it on the new code as it is going to go through major changes and this could possibly be added to 2.x series instead of waiting until 3.0

Anyways, when you lose focus on the user id and email boxes a notification will appear beneath telling whether the user id/email is "Taken" or "Not Taken" and are color coded red and green.

Tell me whether its 2.x or 3.x and I'll provide the changes granted there are no errors you find first  Wink

Oh, and some same id's and emails that are taken so you can test:

ids: admin, Adderyiff
emails: bob@bob.com, calvar@columbus.rr.com

Beneath are possible replacement images rather than text which I created myself  Wink
« Last Edit: Jul 9th, 2009 at 2:58am by Unilat »  

Check.png ( 2 KB | 247 Downloads )
Check.png
Cross.png ( 2 KB | 277 Downloads )
Cross.png
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 4 
Topic Tools
 
  « Board Index ‹ Board  ^Top