Yes, there’s no reason why logout can’t work just like login.
I think it could be done with just two changes.
First in webloginpe.snippet.php:
//change this
$liHomeId = isset($liHomeId) ? explode(',', $liHomeId) : '';
$loHomeId = isset($loHomeId) ? $loHomeId : '';
//to this
$liHomeId = isset($liHomeId) ? explode(',', $liHomeId) : '';
$loHomeId = isset($loHomeId) ? explode(',', $loHomeId) : '';
Note that the above will break the current snippet without the following (untested) change.
Second, in weblogin.class.php replace the entire LogoutHomePage function with this code:
function LogoutHomePage()
{
global $modx;
if (!empty($this->Report))
{
return; //There was an error in the last step
}
if ($this->Type == 'taconite')
{
return;
}
if (!empty($this->loHomeId))
{
if (is_array($this->loHomeId))
{
foreach($this->loHomeId as $id)
{
$id = trim($id);
if ($modx->getPageInfo($id))
{
$url = $modx->makeURL($id);
$modx->sendRedirect($url,0,'REDIRECT_REFRESH');
return;
}
}
}
else
{
$url = $modx->makeURL($this->loHomeId);
$modx->sendRedirect($url,0,'REDIRECT_REFRESH');
return;
}
}
else
{
$url = $modx->makeURL($modx->documentIdentifier);
$modx->sendRedirect($url,0,'REDIRECT_REFRESH');
}
return;
}
The only change in the second part is within the if (!empty($this->loHomeId)) {...} section so you could just paste that part in if you’re careful.
If this works, it shouldn’t affect any current installs so it would be a good addition to the code.