$priuser = $member_handler->getUser($priuid); if (!is_object($priuser) || !in_array(-$form['priuid'], $priuser->groups())) { $priuid = 0; } } if (empty($priuid)) { $back = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : XOOPS_URL; redirect_header($back, 3, _NOPERM); exit; } else { $form['priuser'] = array('uid' => $priuser->getVar('uid'), 'uname' => $priuser->getVar('uname'), 'name' => $priuser->getVar('name')); } } $errors = array(); if ($op != "form") { $errors = assign_post_values($items); if (count($errors)) { $op = 'form'; assign_form_widgets($items); } elseif ($op == 'store') { $errors = store_message($items, $form); } elseif ($op == 'confirm') { assign_form_widgets($items, true); } } else { assign_form_widgets($items); } $cust = $form['custom']; $form['items'] =& $items; $action = "index.php?form=" . $form['formid']; if (!empty($form['priuser'])) {
function post_optvars() { $items = get_form_attribute(_CC_OPTDEFS, '', 'optvar'); $errors = assign_post_values($items); $vars = array(); foreach ($items as $item) { $fname = $item['name']; if ($fname == "others") { foreach (unserialize_vars($item['value']) as $k => $v) { $vars[$k] = $v; } } else { if ($item['value']) { $vars[$fname] = $item['value']; } } } return serialize_text($vars); }