'.$sql.'
'.mysql_error()); //global $nb_fichier; if ( $res ) { while ( $row = mysql_fetch_array ( $res ) ) { $id_form = $fid; $admin = $row['admin']; $groupe = $row['groupe']; $email = $row['email']; $expe = $row['expe']; $singleentry = $row['singleentry']; $desc_form = $row['desc_form']; } } $myts =& MyTextSanitizer::getInstance(); $title = $myts->displayTarea($desc_form); $xoopsTpl->assign('xoops_pagetitle', $title); // new logic to handle invoking new interface // 1. determine if the form is a single or multi // 1.5 if multi->displayEntries, if single... // 2. if single, determine if the user has group or global scope // 2.5 if yes->displayEntries, if no... // 3 displayForm // get the global or group permission $groups = $xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; $uid = $xoopsUser ? $xoopsUser->getVar('uid') : 0; $mid = $xoopsModule->getVar('mid'); $gperm_handler = &xoops_gethandler('groupperm'); $view_globalscope = $gperm_handler->checkRight("view_globalscope", $id_form, $groups, $mid); $view_groupscope = $gperm_handler->checkRight("view_groupscope", $id_form, $groups, $mid); $config_handler =& xoops_gethandler('config'); $formulizeConfig =& $config_handler->getConfigsByCat(0, $mid); if(!$view_form = $gperm_handler->checkRight("view_form", $id_form, $groups, $mid) OR ($uid == 0 AND $id_form == $formulizeConfig['profileForm'])) { redirect_header(XOOPS_URL . "/user.php", 3, _formulize_NO_PERMISSION); } // check for $xoopsUser added by skenow. Forces anons to only see the form itself and never the list of entries view. // Really, we should build in better permission/configuration control so that more precise // control over anon behaviour is possible // gather $_GET['ve'] if(isset($_GET['ve']) AND is_numeric($_GET['ve'])) { $entry = $_GET['ve']; } else { $entry = ""; } if(isset($frid) AND is_numeric($frid) AND isset($id_form) AND is_numeric($id_form)) { if((!$singleentry OR ($view_globalscope OR $view_groupscope)) AND $xoopsUser AND !$entry) { include_once XOOPS_ROOT_PATH . "/modules/formulize/include/entriesdisplay.php"; displayEntries($frid, $id_form); // if it's a multi, or if a single and they have group or global scope } else { include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formdisplay.php"; displayForm($frid, $entry, $id_form, "", "{NOBUTTON}"); // if it's a single and they don't have group or global scope, OR if an entry was specified in particular } } elseif(isset($id_form) AND is_numeric($id_form)) { if((!$singleentry OR ($view_globalscope OR $view_groupscope)) AND $xoopsUser AND !$entry) { include_once XOOPS_ROOT_PATH . "/modules/formulize/include/entriesdisplay.php"; displayEntries($id_form); // if it's a multi, or if a single and they have group or global scope } else { include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formdisplay.php"; displayForm($id_form, $entry, "", "", "{NOBUTTON}"); // if it's a single and they don't have group or global scope, OR if an entry was specified in particular } } else { // if no form is specified, then show the General Forms category header("Location: " . XOOPS_URL . "/modules/formulize/cat.php"); } ?>

