vpanel-stack/panel/classes/Panel/Logout.php

32 lines
650 B
PHP
Raw Normal View History

2022-07-01 15:24:26 -07:00
<?php
/**
* vpanel-stack
* https://git.stack-source.com/msb/vpanel-stack
* Copyright (c) 2022 Matthew Saunders Brown <matthewsaundersbrown@gmail.com>
* GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
*/
namespace Panel;
class Logout extends \Panel {
function beforeRoute($f3) {
parent::beforeRoute($f3);
}
static function get($f3) {
$f3->clear('SESSION.expiration');
$messages[] = "You have been logged out. Please re-enter info to log back in.";
$f3->set('SESSION.messages', $messages);
if ($f3->get('PATH') != '/Login') {
$f3->reroute('/Login');
}
}
}