if (!empty($_POST['sid'])) $sid = intval($_POST['sid']); elseif (!empty($_GET['sid'])) $sid = intval($_GET['sid']); else $sid = ''; $errstr = ""; $bg = ''; if ($sid) { if($_SESSION['acl']['superuser'] == 'Y') { $sql = "SELECT s.name, s.title, s.owner, s.realm, s.public FROM ".$GLOBALS['ESPCONFIG']['survey_table']." s WHERE s.id = $sid"; $sql1 = "SELECT a.realm, a.maxlogin, a.resume, a.navigate FROM ".$GLOBALS['ESPCONFIG']['access_table']." a WHERE a.survey_id = $sid ORDER BY a.realm"; } else { $realms = array_to_insql( array_intersect( $_SESSION['acl']['pall'], array_merge( $_SESSION['acl']['pall'], $_SESSION['acl']['pdesign']))); $sql = "SELECT s.name, s.title, s.owner, s.realm, s.public FROM ".$GLOBALS['ESPCONFIG']['survey_table']." s WHERE s.id = $sid AND NOT (status & " .STATUS_DELETED. ") AND (s.owner = "._addslashes($_SESSION['acl']['username']) ." || s.realm $realms)"; $sql1 = "SELECT a.realm, a.maxlogin, a.resume, a.navigate FROM ".$GLOBALS['ESPCONFIG']['access_table']." a, ".$GLOBALS['ESPCONFIG']['survey_table']." s WHERE a.survey_id = $sid AND s.id=a.survey_id AND (s.owner = ". _addslashes($_SESSION['acl']['username']) ." || s.realm $realms) ORDER BY a.realm"; } $result = execute_sql($sql); if (record_count($result) < 1) { $sid = 0; } } if ($sid) { list($name,$title,$owner,$realm,$public) = fetch_row($result); db_close($result); if (!empty($_POST['op'])) $op = $_POST['op']; elseif (!empty($_GET['op'])) $op = $_GET['op']; else $op = ''; if (!empty($_POST['realm'])) $arealm = _addslashes($_POST['realm']); elseif (!empty($_GET['realm'])) $arealm = _addslashes($_GET['realm']); if (isset($_POST['resume'])) $resume = 'Y'; else $resume = 'N'; $resume = _addslashes($resume); if (isset($_POST['navigate'])) $navigate = 'Y'; else $navigate = 'N'; $navigate = _addslashes($navigate); if (!empty($_POST['max'])) $max = intval($_POST['max']); elseif (!empty($_GET['max'])) $max = intval($_GET['max']); else $max = 0; if ($op == 'a') { if (empty($_POST['realm'])) { $errstr = mkerror(_('Please select a group.')); } else { $sql = "INSERT INTO ".$GLOBALS['ESPCONFIG']['access_table']." (survey_id, realm, maxlogin, resume, navigate) VALUES ($sid, $arealm, $max, $resume, $navigate)"; execute_sql($sql); } } elseif ($op == 'r') { $sql = "DELETE FROM ".$GLOBALS['ESPCONFIG']['access_table']." WHERE survey_id = $sid AND realm = $arealm"; execute_sql($sql); } elseif ($op == 'v') { $sql = "UPDATE ".$GLOBALS['ESPCONFIG']['survey_table']." SET public = 'N' WHERE id = $sid"; execute_sql($sql); $sid = 0; } elseif ($op == 'p') { $sql = "UPDATE ".$GLOBALS['ESPCONFIG']['survey_table']." SET public = 'Y' WHERE id = $sid"; execute_sql($sql); $sid = 0; } } if ($sid) { if ($public == 'N') $public = _('Private'); else $public = _('Public'); $r = ''; } ?>

$errstr

\n"); ?>

: '. substr(strrchr($ESPCONFIG['handler_prefix'], '/'), 1) . ' & '. substr(strrchr($ESPCONFIG['handler'], '/'), 1) . ''); ?>

" . _('Go back to Management Interface') . "\n"); ?> MoveNext(); ?>

 
">
" . _('Go back to Management Interface') . "\n"); ?> MoveNext(); if($bg != $ESPCONFIG['bgalt_color1']) $bg = $ESPCONFIG['bgalt_color1']; else $bg = $ESPCONFIG['bgalt_color2']; if ($public == 'N') { $public = _('Private'); $op = '". _('Make Public') .''; } else { $public = _('Public'); $op = '". _('Make Private') .''; } ?>
 
">
" . _('Go back to Management Interface') . "\n"); ?>