X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=notification_edit.php;h=cd3f41bd1841f4f9c33f5417ad5698bf934e1927;hb=60d2288b7fca6caf0f5d9d3eee972f040eb24fb0;hp=b3d2dc1b173c380ec9df80aee92cf60d0e384799;hpb=a7ba11adfecf6cb906749efe5abce688363aef07;p=timetracker.git diff --git a/notification_edit.php b/notification_edit.php index b3d2dc1b..cd3f41bd 100644 --- a/notification_edit.php +++ b/notification_edit.php @@ -34,7 +34,7 @@ import('ttFavReportHelper'); import('ttNotificationHelper'); // Access check. -if (!ttAccessCheck(right_manage_team)) { +if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('no')) { header('Location: access_denied.php'); exit(); } @@ -68,11 +68,11 @@ $form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getK if ($request->isPost()) { // Validate user input. - if (!$cl_fav_report) $errors->add($i18n->getKey('error.report')); - if (!ttValidCronSpec($cl_cron_spec)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.cron_schedule')); - if (!ttValidEmail($cl_email)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.email')); + if (!$cl_fav_report) $err->add($i18n->getKey('error.report')); + if (!ttValidCronSpec($cl_cron_spec)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cron_schedule')); + if (!ttValidEmail($cl_email)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email')); - if ($errors->no()) { + if ($err->no()) { // Calculate next execution time. $next = tdCron::getNextOccurrence($cl_cron_spec, mktime()); @@ -87,9 +87,9 @@ if ($request->isPost()) { header('Location: notifications.php'); exit(); } else - $errors->add($i18n->getKey('error.db')); + $err->add($i18n->getKey('error.db')); } -} // POST +} // isPost $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->getKey('title.add_notification'));