Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: wohoo on April 22, 2005, 02:12:29 PM

Title: Unregistered Guest trying to login.
Post by: wohoo on April 22, 2005, 02:12:29 PM
Hey guys,

for the last few weeks I've been getting a visitor who has tried to login but has yet to register an account. I suspect he's trying to get access as an admin.

I want to know what usernames he's trying to login with. How could I learn that ? Anything like 'failed login attempts' out there ?

Thanks so much.
Title: Re: Unregistered Guest trying to login.
Post by: Grudge on April 22, 2005, 02:22:10 PM
Failed login attempts are in all the error log:
Admin -> Maintenance -> Error Log
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on April 22, 2005, 02:24:44 PM
Woah, thanks so much.

I now have what might be a problem. There are 6313 pages of errors. :) And another error seems to come after each click.

This is what seems to be causing all those pages (the most occuring error):
8: Undefined variable: context
/home/wohoo/public_html/forums/Sources/Load.php
211


How would I get rid of/fix  that ?
Title: Re: Unregistered Guest trying to login.
Post by: Grudge on April 22, 2005, 04:26:51 PM
I assume you have a mod installed? Easiest way to *stop* the error is open Load.php in an editor, go to line 211, and find the top of the function it lives in. Then add $context to the global list.

To clear your error log out, so those particular errors go away, try something like:

DELETE FROM smf_log_errors WHERE message LIKE "%Undefined variable: context%"

Run that in phpMyAdmin.

Cheers,
Grudge
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on April 23, 2005, 03:50:33 AM
Thanks for the help but I don't I'm still a beginner at all this.
So bare with me please :)

This is what I have on line 211:
if (!$context['user']['is_guest'] && (!empty($modSettings['show_bookmark'])))

What now ?
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on April 24, 2005, 10:51:36 PM
The forum error log doesn't show what username he tried to login with. Where can I see that ?

I'd like to know if he wants to gain access to the admin account or is he's just having problems logging in.

Thanks!
Title: Re: Unregistered Guest trying to login.
Post by: Amacythe on April 24, 2005, 11:02:06 PM
The easiest way for you to see what you're looking for in your error log is to log out then when you try to log back in, enter a wrong password.  Log in and go look at the error log.  It sounds to me like a bot.
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on April 24, 2005, 11:31:36 PM
Ok, I see now. Thanks a lot.

But do bots print pages ? Cause that's what he does a few times a day.
Title: Re: Unregistered Guest trying to login.
Post by: Amacythe on April 24, 2005, 11:41:43 PM
'Who's Online' shows you what they are TRYING to do, not what is actually being done.

A bot will attempt to click each and every link it finds and that is what will be displayed. 

Next time you see a guest on the board doing something you think is odd, try checking the IP address. :)

Title: Re: Unregistered Guest trying to login.
Post by: wohoo on April 25, 2005, 12:04:43 AM
Yeah, I've been doing that. It comes up as WASHINGTON, REDMOND, MICROSOFT CORP
I banned him by ip, came back a day later as 207.46.98.126 instead of 207.46.98.127
So it's most likely a bot ?

And thanks for the explanation. I was getting paranoid over here :) (my first community)
Title: Re: Unregistered Guest trying to login.
Post by: Amacythe on April 25, 2005, 12:16:22 AM
yep... a bot :)

I wouldn't ban it if you want the added traffic it may bring.
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on April 25, 2005, 12:37:22 AM
It adds me to searh engines and such ?
Title: Re: Unregistered Guest trying to login.
Post by: Miraenda on April 25, 2005, 02:05:26 AM
Yeah, because 207.46.98.126 and 207.46.98.127 when traced belong to msn's bot (msnbot.msn.com).  You blocked MSN from spidering your site for their search engine basically...
Title: Re: Unregistered Guest trying to login.
Post by: Grudge on April 26, 2005, 06:34:24 PM
Quote from: wohoo on April 23, 2005, 03:50:33 AM
Thanks for the help but I don't I'm still a beginner at all this.
So bare with me please :)

This is what I have on line 211:
if (!$context['user']['is_guest'] && (!empty($modSettings['show_bookmark'])))

What now ?

Going back to this problem. Replace that line with:
if (!$GLOBALS['context']['user']['is_guest'] && (!empty($modSettings['show_bookmark'])))

To make all those error messages go away - it's the bookmark mod which is causing those errors.
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on April 28, 2005, 05:15:27 AM
Thanks for the help. I did what you said but now another error comes up:
8: Undefined index: user
/home/wohoo/public_html/forums/Sources/Load.php
211


On a side note, I uninstalled the bookmark mod a while ago.
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on May 03, 2005, 03:29:26 PM
Any help ?
Title: Re: Unregistered Guest trying to login.
Post by: [Unknown] on May 07, 2005, 05:30:04 PM
What are lines 205 to 216 of Load.php?

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on May 14, 2005, 11:00:32 PM
My apologies for the late response.
I used Dreamweaver to show the line numbers and lines 205 to 216 of Load.php are:
   elseif ($user_info['is_admin'])
$user_info['query_see_board'] = '1';
// Registered user.... just the groups in $user_info['groups'].
else
$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';
// Thread Bookmarks
if (!$GLOBALS['context']['user']['is_guest'] && (!empty($modSettings['show_bookmark'])))
{
if (!empty($user_info['n_bookmarks']))
{

$t_book = array();
Title: Re: Unregistered Guest trying to login.
Post by: [Unknown] on May 14, 2005, 11:27:57 PM
Replace !$GLOBALS['context']['user']['is_guest'] with !$user_info['is_guest'].

-[Unknown]
Title: Re: Unregistered Guest trying to login.
Post by: wohoo on May 16, 2005, 10:09:27 AM
Yes, that does it. Thank you!