import('ttNotificationHelper');
// Access check.
-if (!ttAccessCheck(right_manage_team)) {
+if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('no')) {
header('Location: access_denied.php');
exit();
}
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());
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'));