Trainee Posted July 23, 2007 Share Posted July 23, 2007 Everytime some one trys to register on my site they are automatticaly given the nuckname Guest as well as being able to login with their name. Although one person has registered no others can as it says username already taken because they are all called guest. How do i fix this?? Quote Link to comment Share on other sites More sharing options...
trq Posted July 23, 2007 Share Posted July 23, 2007 You'll need to delete this user who has signed up using Guest. You'll then need to wrap the sign up process in a condition that will not allow anyone to sign up with the user name Guest. Quote Link to comment Share on other sites More sharing options...
Guardian-Mage Posted July 23, 2007 Share Posted July 23, 2007 Or you could edit your database or code to allow duplicate entries Quote Link to comment Share on other sites More sharing options...
dg Posted July 23, 2007 Share Posted July 23, 2007 ya .... i agree ... while checking who has logged in ......give a condition that when the user is guest don't check for duplicates Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 23, 2007 Author Share Posted July 23, 2007 ok well im new to this so a detailed tutorial on telling me how to do this would help. im a bit of a newbie to php and only know the basics. Quote Link to comment Share on other sites More sharing options...
trq Posted July 23, 2007 Share Posted July 23, 2007 Your not going to find a detailed tutorial on such an exact issue. Did you write the system in question? If so, you should know where and how to impliment such a feature. If you didn't write the system in question maybe you can find a mod for it that does what you want. Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 23, 2007 Author Share Posted July 23, 2007 again where would i find such a thing?? and no i didnt do the coding and things so i wouldnt know where to find it. The preogram i use is just to bind and wrap pictures i think so the problem may lie in the php nuke 7.9 itself?? i can give you access to the files if anyone thinks they can sort it. Quote Link to comment Share on other sites More sharing options...
trq Posted July 23, 2007 Share Posted July 23, 2007 If its php nuke, try the php web site. Someone may have already written a fix. Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 23, 2007 Author Share Posted July 23, 2007 i checked the site and there are no updates that i can see of any othewr sugestions? how could i tell the system to ignore duplicates? Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 23, 2007 Author Share Posted July 23, 2007 i checked it out and it turns out they are given the name guest as a perm name. You can login with your other details but are still named guest for forums and things. if there is anyone out there that knows a fix im desperate to know. Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 23, 2007 Share Posted July 23, 2007 post the code that makes the user get the nickname guess. Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 23, 2007 Author Share Posted July 23, 2007 like i said im a noob so i wouldnt now where to fun this. i will search around though and see what i can find Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 23, 2007 Author Share Posted July 23, 2007 this is a real shot in the dark but would this be the code? if (!defined('IN_PHPBB')) { die(); } function nuke_sql($query) { //echo "before = $query<br>"; $nuke_sql = str_replace(" username", " username", $query); if (ereg ('privmsgs_text', $nuke_sql)){ $nuke_sql = str_replace("uname_", "username_", $query); } $nuke_sql = str_replace("u.username", "u.username", $nuke_sql); $nuke_sql = str_replace("u2.username", "u2.username", $nuke_sql); $nuke_sql = str_replace("user_password", "user_password", $nuke_sql); $nuke_sql = str_replace("user_website", "user_website", $nuke_sql); if ((stristr($nuke_sql, "user_email,")) || (stristr($nuke_sql, "user_email "))){ $nuke_sql = str_replace("user_email", "user_email", $nuke_sql); } $nuke_sql = str_replace("user_interests", "user_intrest", $nuke_sql); if (stristr($nuke_sql,"topics_watch") || (stristr($nuke_sql,"user_group"))){ } else { $nuke_sql = str_replace(" user_id", " user_id", $nuke_sql); } $nuke_sql = str_replace("uid_", "user_id_", $nuke_sql); $nuke_sql = str_replace("\(user_id", "\(user_id", $nuke_sql); $nuke_sql = str_replace("u.user_id", "u.user_id", $nuke_sql); $nuke_sql = str_replace("u2.user_id", "u2.user_id", $nuke_sql); //echo "after = $nuke_sql<br><br>"; return $nuke_sql; } ?> Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 23, 2007 Share Posted July 23, 2007 post register.php Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 24, 2007 Author Share Posted July 24, 2007 ok i turned it into a txt doc so i can atach it on the post bescause it would be an awful load of posts to pst the contents. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Trainee Posted July 26, 2007 Author Share Posted July 26, 2007 ok is this a dead pist then?? i really need this done and if you know how i would be very gratefull. Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 26, 2007 Share Posted July 26, 2007 make a backup of your code and then delete all what you see that all i cn say ok. it worth a try ok. remember if it dosent do nothink then put the new backup file back ok. <?php // // Let's make sure the user isn't logged in while registering, // and ensure that they were trying to register a second time // (Prevents double registrations) // if ($mode == 'register' && ($userdata['session_logged_in'] || $username == $userdata['username'])) { message_die(GENERAL_MESSAGE, $lang['Username_taken'], '', __LINE__, __FILE__); } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.