I have WebloginPE set up and pretty much all working. In the header of the document I have a link to ’login | register’ or ’logout username’ depending on if the user is logged in. I had this working the other day, but now the link changes if a ’logout’ button is pressed. But if the ’logout’ link at the top is pressed it just redirects to the succeful logout page, but doesnt actually log the user out and the ’logout’ link doesnt change to login.
I have creates a snippet which I have them placed in the header chunk, the code is as follows:
<?php
# do the work
$user = $modx->getLoginUserName();
if ($user) {
return '<a href="[~14~]&service=logout">Logout ' . $user . '</a>';
} else {
return '<a href="[~9~]">Login</a> | <a href="[~10~]">Register</a>';
}
?>
so the service ’logout’ is not getting executed when the link is clicked.. annoying as it was working yesterdya and I dont know what I have changed since.