misuzu/public/auth/logout.php

17 lines
374 B
PHP
Raw Normal View History

2019-03-08 00:35:53 +00:00
<?php
require_once '../../misuzu.php';
if (!user_session_active()) {
url_redirect('index');
2019-03-08 00:35:53 +00:00
return;
}
2019-03-18 21:30:19 +00:00
if (!empty($_GET['token']) && is_string($_GET['token']) && csrf_verify('logout', $_GET['token'])) {
2019-03-08 00:35:53 +00:00
setcookie('msz_auth', '', -9001, '/', '', true, true);
user_session_stop(true);
url_redirect('index');
2019-03-08 00:35:53 +00:00
return;
}
echo tpl_render('auth.logout');