Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
broose
Regular
Regular



Joined: Feb 17, 2006
Posts: 94

PostPosted: Tue Feb 21, 2006 4:45 pm Reply with quote

Another noob question by me, i am trying to get login names to have square brackets, i have searched and found that in my account module index there is this line in the example that i found

if ((!$username) || ($username=="") || (ereg("[^a-zA-Z0-9_-]",$username)))

but my one looks like this

if ((!$username) || (empty($username)) || (ereg("[^a-zA-Z0-9_-\[\]]",$username))) $stop = "<center>"._ERRORINVNICK."</center><br>";

i have added the square bracket like it says but still does not allow users to have it in their names, also why does my line have the word empty in it?

cheers
 
View user's profile Send private message
broose







PostPosted: Wed Feb 22, 2006 4:23 pm Reply with quote

someone must know, pleeeeeeeease
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed Feb 22, 2006 4:32 pm Reply with quote

Square brackets are not allowed for a reason - security.
As this isnt a 'problem' specific to RN I have moved it to the Modules forum.
 
View user's profile Send private message Send e-mail
broose







PostPosted: Wed Feb 22, 2006 5:10 pm Reply with quote

but i need square brackets and other symbols as our site is a gaming clan site and most have clan tags, there must be a way to enable them as there are several threads with people that have done it. i have tried what they did but nothing works

why does my index line have the word empty in it?

cheers
 
Guardian2003







PostPosted: Wed Feb 22, 2006 5:47 pm Reply with quote

Because you did not use the code tag - the forum intepreted it as something else which is why you shouldnt allow square brackets.

Obviously it is up to you what you do with your site but someone else will have to guide you here. I would not feel right giving you information which might leave your site vulnerable.
 
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Feb 22, 2006 7:48 pm Reply with quote

Unfortunately with those regular expressions, I don't think you can escape brackets

Quote:

The special characters:
. * [ \


(period, asterisk, left-bracket and backslash, respectively) lose their special meaning within a bracket expression.

[ Only registered users can see links on this board! Get registered or login! ]

Wish I could help further, but it doesn't seem a simple solution

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
broose







PostPosted: Thu Feb 23, 2006 3:16 pm Reply with quote

what exactly is the list of brackets and symbols that cant be used?
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Fri Feb 24, 2006 1:09 am Reply with quote

Actually, using \[ and \] is the correct syntax. The word empty is a function and is checking to see if $username is empty.

Where exactly do you get the error message? When you try to register or when you try to login?
 
View user's profile Send private message
broose







PostPosted: Fri Feb 24, 2006 2:12 am Reply with quote

i get the activation email after registering but when i click on the link i just get a message saying no such user in database
 
Raven







PostPosted: Fri Feb 24, 2006 4:43 am Reply with quote

That's a whole different issue, really, that's why I asked for clarification Smile

Are you trying to also enter spaces anywhere in the username?

Can you enter names without the [] ?
 
broose







PostPosted: Fri Feb 24, 2006 12:24 pm Reply with quote

no i dont put in any spaces, and yes i can use names without the [].
if i register with the brackets i cant activate it coz it says no such user in database
 
Raven







PostPosted: Fri Feb 24, 2006 12:58 pm Reply with quote

Great. Now, Register a name with the []. Do NOT respond to the email. Now, use phpMyAdmin and Browse the nuke_users_temp table. Is the new user name in the table? It probably isn't, but I want to be sure. Assuming it is NOT, then that means the resolution lies in the code that is supposed to write the data to the temp table.
 
broose







PostPosted: Fri Feb 24, 2006 2:21 pm Reply with quote

yes i see the name there, that is when i click on the nuke_users_temp and then browse i see the name there
 
Raven







PostPosted: Fri Feb 24, 2006 5:46 pm Reply with quote

So, everything is working so far. Now, we are into the confirmation email routine Smile

Verify that the link that is sent in the email is exactly the same as the link that is sent for a regular username w/o the []. Obviously there will be a difference with the link as far as values go, but the link and url variable names in the link should be the same. Assuming they are, then you need to look at the modules/Your_Account/index.php file, especially at the function activate(). That's where your issue appears to be if it's not in the email link.
 
broose







PostPosted: Fri Feb 24, 2006 6:26 pm Reply with quote

no they dont match, the activation url for the [ ] ends after the last bracket, the rest of the url that is after the last bracket is just showing up as text and numbers

in the normal activation url all the text past the username is part of the url

should i post the urls?
 
Raven







PostPosted: Fri Feb 24, 2006 10:35 pm Reply with quote

Is it all on one line or two?
 
broose







PostPosted: Sat Feb 25, 2006 1:47 am Reply with quote

its all on one line but the end part after the last bracket is not part of the link,all the &check_num etc is just normal text and not part of the link
 
Raven







PostPosted: Sat Feb 25, 2006 9:16 am Reply with quote

Please email (forward) to me one of these emails:

raven AT ravenphpscripts DOT com
 
broose







PostPosted: Sat Feb 25, 2006 9:20 am Reply with quote

ok done
 
Raven







PostPosted: Sat Feb 25, 2006 10:01 am Reply with quote

Got it. Let me now ask, if you manually copy the entire string in the email and paste it into your browser, will it activate the user?
 
broose







PostPosted: Sat Feb 25, 2006 10:46 am Reply with quote

i will make another as i deleted that one, BRB
 
broose







PostPosted: Sat Feb 25, 2006 10:51 am Reply with quote

yes it does get activated
 
Raven







PostPosted: Sat Feb 25, 2006 11:06 am Reply with quote

Then it's an issue either with the email (url formation) that is sent or the email reader and url formatter. Here's something to try. You don't say what version of nuke you are using, but in general, you should have a function called finishNewUser. Find a line similar to this:

$finishlink = "$nukeurl/modules.php?name=$module_name&op=activate&username=$username&check_num=$check_num";

Change it to:

$finishlink = urlencode("$nukeurl/modules.php?name=$module_name&op=activate&username=$username&check_num=$check_num");
 
broose







PostPosted: Sat Feb 25, 2006 11:10 am Reply with quote

ok thanks i will give it a try, where will this line be?

i am using rwsRavenNuke76_v2.02.00_FULL
 
Raven







PostPosted: Sat Feb 25, 2006 11:17 am Reply with quote

In the modules/Your_Account/index.php file, in the function finishNewUser section.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©