- $sql = "select c.id, c.cron_spec, c.report_id, c.email, c.cc, c.subject, c.report_condition, c.status, fr.name from tt_cron c
- left join tt_fav_reports fr on (fr.id = c.report_id)
- where c.id = $id and c.group_id = ".$user->getGroup();
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
+
+ $sql = "select c.id, c.cron_spec, c.report_id, c.email, c.cc, c.subject, c.report_condition, c.status, fr.name from tt_cron c".
+ " left join tt_fav_reports fr on (fr.id = c.report_id)".
+ " where c.id = $id and c.group_id = $group_id and c.org_id = $org_id";