Exemplo n.º 1
0
//This file cannot be called directly, only included.
if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) {
    exit;
}
if (!EfrontUser::isOptionVisible('notifications')) {
    eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
}
!isset($currentUser->coreAccess['notifications']) || $currentUser->coreAccess['notifications'] == 'change' ? $_change_ = 1 : ($_change_ = 0);
$smarty->assign("_change_", $_change_);
$loadScripts[] = "includes/digests";
if (isset($_GET['add_default']) && $_GET['add_default'] == 1) {
    EfrontNotification::addDefaultNotifications();
}
if (isset($_GET['activate_notification'])) {
    if (isset($_GET['event']) && $_GET['event']) {
        EfrontNotification::activateEventNotification($_GET['activate_notification']);
    } else {
        $notification = new EfrontNotification($_GET['activate_notification']);
        $notification->activate();
    }
    exit;
} else {
    if (isset($_GET['deactivate_notification'])) {
        if (isset($_GET['event']) && $_GET['event']) {
            EfrontNotification::deactivateEventNotification($_GET['deactivate_notification']);
        } else {
            $notification = new EfrontNotification($_GET['deactivate_notification']);
            $notification->deactivate();
        }
        exit;
    }