Current time: 05-24-2012, 06:12 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] [Admin CP] odd login behavior
08-18-2008, 06:02 AM
Post: #1
[F] [Admin CP] odd login behavior
Let's say I request a page such as:

/admin/index.php?module=user/groups&action=add

and find that my admin session has expired so I need to log in again. After submitting the login form, MyBB complains that I didn't "enter a title for this new user group" even though I never tried to add a new user group. Toungue The problem is that the ACP modules might see the login POST request as a request intended for them.
Visit this user's website Find all posts by this user
08-18-2008, 12:36 PM
Post: #2
RE: [Admin CP] odd login behavior
I noticed that myself. It only checks if there is a POST request not what kind of POST request it is.
Find all posts by this user
08-18-2008, 03:31 PM
Post: #3
RE: [Admin CP] odd login behavior
Yeh, I noticed this to recently. Not exactly sure how we could fix it

Since logging in can't pass post request methods anyway I guess just making sure it's forced to get afterward would work

PHP Code:
$db->insert_query("adminsessions"$admin_session);
my_setcookie("adminsid"$sid);
$post_verify false

Add after

PHP Code:
$mybb->request_method "get"

Anybody have a better solution?
Visit this user's website Find all posts by this user
08-18-2008, 06:47 PM
Post: #4
RE: [Admin CP] odd login behavior
What about
PHP Code:
if($mybb->request_method == 'post' && $mybb->input['do'] != 'login'
Although you would have to change it in all the modules.
Find all posts by this user
08-18-2008, 07:08 PM
Post: #5
RE: [Admin CP] odd login behavior
Yeh, That's what I'm trying to avoid
Visit this user's website Find all posts by this user
08-19-2008, 09:33 AM
Post: #6
RE: [Admin CP] odd login behavior
Your solution sounds the most logical I think, Ryan.
Visit this user's website Find all posts by this user
08-19-2008, 11:04 AM
Post: #7
RE: [Admin CP] odd login behavior
Do a redirect back to the page instead of parsing/loading it internally?

Chris Boulton
Twitter | Blog
Visit this user's website Find all posts by this user
08-19-2008, 02:33 PM
Post: #8
RE: [Admin CP] odd login behavior
(08-19-2008 11:04 AM)Chris Boulton Wrote:  Do a redirect back to the page instead of parsing/loading it internally?

huh?
Visit this user's website Find all posts by this user
08-19-2008, 09:03 PM
Post: #9
RE: [Admin CP] odd login behavior
(08-18-2008 03:31 PM)Ryan Gordon Wrote:  
PHP Code:
$mybb->request_method "get"

That seems like kind of a hack, but I guess it's fine... /admin/index.php already does the same thing when your anti-CSRF token doesn't match up.
Visit this user's website Find all posts by this user
08-20-2008, 03:40 AM
Post: #10
[F] [Admin CP] odd login behavior
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication