LBCAlerte_ynh/sources/app/user/scripts/settings-disable-notification.php
Jimmy Monin 58ffd500e6 Upgrade LBCAlerte to version 3.3
Add upgrade script
2016-11-26 19:25:53 +01:00

34 lines
640 B
PHP

<?php
if (empty($_GET["s"])) {
header("LOCATION: ./?mod=user&a=settings");
exit;
}
switch ($_GET["s"]) {
case "sms-free-mobile":
$key = "freeMobile";
break;
case "sms-ovh":
$key = "ovh";
break;
default:
$key = $_GET["s"];
}
$notifications = $userAuthed->getOption("notification");
if (!isset($notifications[$key])) {
header("LOCATION: ./?mod=user&a=settings");
exit;
}
$notifications[$key]["active"] = false;
$userAuthed->mergeOptions(array(
"notification" => $notifications
));
$userStorage->save($userAuthed);
header("LOCATION: ./?mod=user&a=settings");
exit;