Skip to content

Commit

Permalink
Fix form field visibility/submission permissions. Close #744
Browse files Browse the repository at this point in the history
* customforms::get_custom_form_fields() wasn't honoring the
  action type: submit/view
  • Loading branch information
rjmackay committed Apr 16, 2013
1 parent 36aaee9 commit 1197f03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/customforms.php
Expand Up @@ -57,7 +57,7 @@ public static function get_custom_form_fields($incident_id = FALSE, $form_id = N
{
$sql = "SELECT ff.*, fr.form_response
FROM `{$table_prefix}form_field` ff
LEFT JOIN `{$table_prefix}roles` r ON (r.id = field_ispublic_visible)
LEFT JOIN `{$table_prefix}roles` r ON (r.id = {$ispublic_field})
LEFT JOIN
`{$table_prefix}form_response` fr ON (
fr.form_field_id = ff.id AND
Expand All @@ -71,7 +71,7 @@ public static function get_custom_form_fields($incident_id = FALSE, $form_id = N
{
$sql = "SELECT ff.*
FROM `{$table_prefix}form_field` ff
LEFT JOIN `{$table_prefix}roles` r ON (r.id = field_ispublic_visible)
LEFT JOIN `{$table_prefix}roles` r ON (r.id = {$ispublic_field})
WHERE (access_level <= :user_level OR access_level IS NULL) "
. ( ! empty($form_id) ? "AND form_id = :form_id " : '')
. "ORDER BY field_position ASC";
Expand Down

0 comments on commit 1197f03

Please sign in to comment.