#5 b2login.php optional redirect


Currently the pages of the admin interface use
b2verifyauth.php to ensure that the user has been
logged in before being able to access the interface.

This patch enhances the behaviour of b2verifyauth.php
and b2login.php. If a user isn't logged in, he is
redirected to the b2login form (as before) and, after
correct submission of the correct username/password
combination redirected back to the page he wanted to
access before.

Example: I'm not logged in and want to access
wp-admin/b2categories.php directly in order to change
category setup. The old behaviour would be:
b2verifyauth sees that I'm not logged in, redirects me
to b2login, and b2login then redirects me to
wp-admin/b2edit.php, from where I had to change over to
b2categories.php manually. The new behaviour:
b2verifyauth redirects me to b2login, and b2login
redirects me to wp-admin/b2categories.php directly.

Purpose: this will be used as part of my comment
moderation patch, but maybe is useful for other things
as well. Therefore I submit that as stand-alone patch.


  • Michael Renzmann

    Logged In: YES

    I forgot to mention: if you want b2login.php to redirect you
    to another site, just append "?redirect_to=<url>" to the
    request. This is done automatically in b2verifyauth.php.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks