2017-12-20 20:49:11 +00:00
|
|
|
<?
|
|
|
|
|
|
|
|
require_once($config['models_folder']."d.users.php");
|
|
|
|
|
|
|
|
ini_set("session.cookie_lifetime",60*60*24*30);
|
|
|
|
session_start();
|
|
|
|
|
2018-10-22 18:03:03 +00:00
|
|
|
$user = new Kabano\User();
|
2017-12-20 20:49:11 +00:00
|
|
|
|
|
|
|
if(isset($_SESSION['userid'])) {
|
2018-10-13 13:25:37 +00:00
|
|
|
if ($user->checkID($_SESSION['userid'])) {
|
2017-12-20 20:49:11 +00:00
|
|
|
$user->updateLoginDate();
|
2022-02-01 20:13:27 +00:00
|
|
|
$config['locale'] = $user->locale;
|
|
|
|
$config['timezone'] = $user->timezone;
|
2017-12-20 20:49:11 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
session_destroy();
|
2022-02-01 21:25:52 +00:00
|
|
|
$config['locale'] = "fr_FR";
|
|
|
|
$config['timezone'] = "Europe/Paris";
|
2022-02-01 20:13:27 +00:00
|
|
|
$user->rank = "visitor"; // All users are visitors
|
2017-12-20 20:49:11 +00:00
|
|
|
}
|
|
|
|
}
|
2022-02-01 20:13:27 +00:00
|
|
|
else {
|
2022-02-01 21:25:52 +00:00
|
|
|
$config['locale'] = "fr_FR";
|
|
|
|
$config['timezone'] = "Europe/Paris";
|
2022-02-01 20:13:27 +00:00
|
|
|
$user->rank = "visitor"; // All users are visitors
|
|
|
|
}
|
|
|
|
|
2022-02-01 21:39:26 +00:00
|
|
|
if (PHP_VERSION_ID < 80000) {
|
|
|
|
$user->date_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::LONG, IntlDateFormatter::NONE, $config['timezone']);
|
|
|
|
} else {
|
|
|
|
$user->date_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::RELATIVE_LONG, IntlDateFormatter::NONE, $config['timezone']);
|
|
|
|
}
|
2022-02-01 20:13:27 +00:00
|
|
|
$user->datetime_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::LONG, IntlDateFormatter::SHORT, $config['timezone']);
|
|
|
|
$user->datetimeshort_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, $config['timezone']);
|
|
|
|
|
2017-12-20 20:49:11 +00:00
|
|
|
|
|
|
|
?>
|