mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-26 05:10:49 +02:00
Upgrade LBCAlerte to version 3.3
Add upgrade script
This commit is contained in:
33
sources/app/user/scripts/settings-disable-notification.php
Normal file
33
sources/app/user/scripts/settings-disable-notification.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?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;
|
Reference in New Issue
Block a user