Actually Brian just made a (extensive) typo. The hook should be postLogout instead of postUpload. Also, the behavior of the postLogout hook is not as described here, so an additional change needs to be added. Below is the code that would work, and also attached that in a zipfile (I renamed files and classnames)
TL_ROOT/system/modules/member_logout/MemberLogout.php
Code:
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
class MemberLogout extends System {
public function redirectLoggedOutMember(FrontendUser $objUser) {
if ($objUser instanceof FrontendUser) {
$this->redirect('my-account');
}
}
}
*change my-account to whatever this needs to be*
TL_ROOT/system/modules/member_logout/config/config.php
Code:
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
$GLOBALS['TL_HOOKS']['postLogout'][] = array('MemberLogout', 'redirectLoggedOutMember');
Alternatives
- Could you not also log out by sending a member to a specific page and add the automatic logout module there? It has a redirect feature.[/*:mc4t1hon]
- You can add two login modules and hide one for guests and the other for logged in members. Set the different redirect pages and it should work just the same[/*:mc4t1hon]
Bookmarks