X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=notification_delete.php;h=c1f0785e2473246714cb6f91bd2508197cdb1e22;hb=HEAD;hp=46de065d6b6f3ce7f28e053a5373dd6fb2d1fb23;hpb=fd0872d9e582113346fa1e93557f370286c5c9f2;p=timetracker.git diff --git a/notification_delete.php b/notification_delete.php index 46de065d..c1f0785e 100644 --- a/notification_delete.php +++ b/notification_delete.php @@ -30,14 +30,27 @@ require_once('initialize.php'); import('form.Form'); import('ttNotificationHelper'); -// Access check. -if (!ttAccessAllowed('manage_advanced_settings') || !$user->isPluginEnabled('no')) { +// Access checks. +if (!ttAccessAllowed('manage_advanced_settings')) { header('Location: access_denied.php'); exit(); } - +if (!$user->isPluginEnabled('no')) { + header('Location: feature_disabled.php'); + exit(); +} +if (!$user->exists()) { + header('Location: access_denied.php'); // No users in subgroup. + exit(); +} $cl_notification_id = (int)$request->getParameter('id'); $notification = ttNotificationHelper::get($cl_notification_id); +if (!$notification) { + header('Location: access_denied.php'); // Wrong notification id. + exit(); +} +// End of access checks. + $notification_to_delete = $notification['name']; $form = new Form('notificationDeleteForm'); @@ -47,12 +60,9 @@ $form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get( if ($request->isPost()) { if ($request->getParameter('btn_delete')) { - if(ttNotificationHelper::get($cl_notification_id)) { - if (ttNotificationHelper::delete($cl_notification_id)) { - header('Location: notifications.php'); - exit(); - } else - $err->add($i18n->get('error.db')); + if (ttNotificationHelper::delete($cl_notification_id)) { + header('Location: notifications.php'); + exit(); } else $err->add($i18n->get('error.db')); } elseif ($request->getParameter('btn_cancel')) {