| Author |
Message |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Tue Feb 21, 2006 4:45 pm |
|
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 |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Wed Feb 22, 2006 4:23 pm |
|
someone must know, pleeeeeeeease |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
|
Posted:
Wed Feb 22, 2006 4:32 pm |
|
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. |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Wed Feb 22, 2006 5:10 pm |
|
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 Site Admin

Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
|
Posted:
Wed Feb 22, 2006 5:47 pm |
|
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
|
Posted:
Wed Feb 22, 2006 7:48 pm |
|
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.
|
Wish I could help further, but it doesn't seem a simple solution |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Thu Feb 23, 2006 3:16 pm |
|
what exactly is the list of brackets and symbols that cant be used? |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Fri Feb 24, 2006 1:09 am |
|
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? |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Fri Feb 24, 2006 2:12 am |
|
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 Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Fri Feb 24, 2006 4:43 am |
|
That's a whole different issue, really, that's why I asked for clarification
Are you trying to also enter spaces anywhere in the username?
Can you enter names without the [] ? |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Fri Feb 24, 2006 12:24 pm |
|
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 Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Fri Feb 24, 2006 12:58 pm |
|
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 Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Fri Feb 24, 2006 2:21 pm |
|
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 Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Fri Feb 24, 2006 5:46 pm |
|
So, everything is working so far. Now, we are into the confirmation email routine
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 Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Fri Feb 24, 2006 6:26 pm |
|
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 Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Fri Feb 24, 2006 10:35 pm |
|
Is it all on one line or two? |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Sat Feb 25, 2006 1:47 am |
|
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 Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Sat Feb 25, 2006 9:16 am |
|
Please email (forward) to me one of these emails:
raven AT ravenphpscripts DOT com |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Sat Feb 25, 2006 9:20 am |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Sat Feb 25, 2006 10:01 am |
|
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 Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Sat Feb 25, 2006 10:46 am |
|
i will make another as i deleted that one, BRB |
|
|
|
 |
broose Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Sat Feb 25, 2006 10:51 am |
|
yes it does get activated |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Sat Feb 25, 2006 11:06 am |
|
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 Regular


Joined: Feb 17, 2006 Posts: 94
|
Posted:
Sat Feb 25, 2006 11:10 am |
|
ok thanks i will give it a try, where will this line be?
i am using rwsRavenNuke76_v2.02.00_FULL |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Sat Feb 25, 2006 11:17 am |
|
In the modules/Your_Account/index.php file, in the function finishNewUser section. |
|
|
|
 |
|
|
|
|