It's all working fine except I can't find a nice way to perform the logout. It works if you do the same link as in the admin page:
Code: Select all
serendipity_entries.php?serendipity[adminModule]=logout
but I don't want it to take you to the login page, I just want it to reload the default page, but with the user logged out.
I can do a "serendipity[action]=logout" and catch that within the plugin, and then do a "serendipity_logout()":
Code: Select all
if (isset($serendipity['GET']['action']) && $serendipity['GET']['action'] == 'logout') serendipity_logout();
if (serendipity_userLoggedIn()){
echo '<a href="?serendipity[action]=logout">Logout</a></div>';
} // else draw username / password boxes
but obviously anything processed before the plugin still considers you to be logged in. I'm hoping to do it without an edit to any other file, just because that would miss the point of having a plugin.
I'm new to php (although not to programming) so forgive me if I've missed something obvious.