2015-04-11 17:30:01 +00:00
< ? php
register_module ([
" name " => " Logout " ,
2015-05-24 20:00:30 +00:00
" version " => " 0.5 " ,
2015-04-11 17:30:01 +00:00
" author " => " Starbeamrainbowlabs " ,
" description " => " Adds an action to let users user out. For security reasons it is wise to add this module since logging in automatically opens a session that is valid for 30 days. " ,
" id " => " page-logout " ,
" code " => function () {
add_action ( " logout " , function () {
global $user , $pass , $isloggedin ;
$isloggedin = false ;
unset ( $user );
unset ( $pass );
//clear the session variables
$_SESSION = [];
session_destroy ();
2015-05-24 20:00:30 +00:00
exit ( page_renderer :: render_main ( " Logout Successful " , " <h1>Logout Successful</h1>
2015-04-11 17:30:01 +00:00
< p > Logout Successful . You can login again < a href = 'index.php?action=login' > here </ a >.</ p > " ));
});
}
]);
?>