PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

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
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

someone must know, pleeeeeeeease
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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 Visit poster's website
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

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
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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.
View user's profile Send private message Send e-mail Visit poster's website
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

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

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 to the forums!


Wish I could help further, but it doesn't seem a simple solution
View user's profile Send private message Visit poster's website
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

what exactly is the list of brackets and symbols that cant be used?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

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
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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 [] ?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

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
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

yes i see the name there, that is when i click on the nuke_users_temp and then browse i see the name there
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

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?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

Is it all on one line or two?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

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
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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

raven AT ravenphpscripts DOT com
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

ok done
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

i will make another as i deleted that one, BRB
View user's profile Send private message
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

yes it does get activated
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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");
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
broose
Regular
Regular


Joined: Feb 17, 2006
Posts: 94

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

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

i am using rwsRavenNuke76_v2.02.00_FULL
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

In the modules/Your_Account/index.php file, in the function finishNewUser section.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum