Welcome to Geeklog Saturday, August 24 2019 @ 07:09 am EDT

Geeklog Forums

Block Anonymous User Creation


Status: offline

T1Pimp

Forum User
Junior
Registered: 20/08/02
Posts: 27
I've just recently begun using Geeklog. WOW is it smooth. Does everything I wanted my site to do and then some! Since going live with GL, I decided to force users to have a login to post, reply with comments, etc. I've had a user that keeps creating bogus accounts with names like 'Anonymous User', 'Anonymous F*cker', etc. So I tore into GL's code to see what I could do to block creation of accounts like this and thought I would pass it along. Edit public_html\users.php and look for the switch ($mode) { statement, it's towards the bottom. Replace the exising case create statement with the following: case 'create': $i = similar_text(strtolower($username), 'anon', &$p); if ($p > 45) { $display .= createuser($username,$email); break; } else { $display .= COM_refresh($_CONF['site_url'] . '/index.php'); break; } All this does it drop the user back at the front page if the name they choose is similar enough to anonymous. It doesn't return any kind of message that their account wasn't created etc. I'm sure GL could be easily modifed to display a message, or an ASCII middle finger (that's what I plan on doing), or anything you choose.
Paul 'T1Pimp' http://www.Huggybeer.com - Geek news with attitude

Status: offline

T1Pimp

Forum User
Junior
Registered: 20/08/02
Posts: 27
Correction/addition to the code I posted earlier. I had my comparison going the wrong direction. Sorry about that folks. I've got that corrected and also added a message that will display the reason you will not allow them to use that username. Edit public_html\users.php and look for the switch ($mode) { statement, it's towards the bottom. Replace the exising case create statement with the following: case 'create': $i = similar_text(strtolower($username), 'anon', &$p); if ($p < 36) { $display .= createuser($username,$email); break; } else { $display .= COM_refresh($_CONF['site_url'] . '/index.php?msg=47'); break; } Then edit language\english.php and any additional languages you will be supporting. Look for # confirmation and error messages. Place a comma at the end of item 46 and add item 47. Your code will look like this: 46 => "Sorry, you do not have access to the database backup utility. Please note that all attempts to access unauthorized features are logged", 47 => "Sorry but that user name is to similar to anonymous."
Paul 'T1Pimp' http://www.Huggybeer.com - Geek news with attitude

bersi

Anonymous
This looks great but i would lijke to add hust a little thing: in a big site bad more words like the above will occur. So wy not link a new table (bad words) wich then could be used to test the usernames (and other). A little more work, but a lot easier later on. Also, since passwrds are emailed a banlist for IP / hosts could also be implemented. So you can get rid of the sucker! th

Anonymous

Anonymous
I'm currrently working on an IP ban module for Geeklog as well. Maybe I'll roll all this into one mod. Thanx for the input!

All times are EDT. The time is now 07:09 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content