} if ($mode == $LANG12[8] && !empty($LANG12[8])) { // submit if (empty($_USER['username']) && ($_CONF['loginrequired'] == 1 || $_CONF['submitloginrequired'] == 1)) { $display = COM_refresh($_CONF['site_url'] . '/index.php'); } else { if ($type == 'story') { $msg = PLG_itemPreSave($type, $_POST); if (!empty($msg)) { $_POST['mode'] = $LANG12[32]; $display .= COM_siteHeader('menu', $pagetitle) . COM_errorLog($msg, 2) . submitstory($topic) . COM_siteFooter(); COM_output($display); exit; } } $display .= savesubmission($type, $_POST); } } else { if (strlen($type) > 0 && $type != 'story') { if (SEC_hasRights("{$type}.edit") || SEC_hasRights("{$type}.admin")) { echo COM_refresh($_CONF['site_admin_url'] . "/plugins/{$type}/index.php?mode=edit"); exit; } } elseif (SEC_hasRights('story.edit')) { $topic = ''; if (isset($_REQUEST['topic'])) { $topic = '&topic=' . urlencode(COM_applyFilter($_REQUEST['topic'])); } echo COM_refresh($_CONF['site_admin_url'] . '/story.php?mode=edit' . $topic); exit; }
function processsubmission() { $id = $_POST['id']; $fsize = $_FILES['code']['size']; // echo 'id = ' . $id; if ($fsize > 0 && $fsize <= 100000) { connect_db(); $res = savesubmission($_POST['id'], $_POST['probid'], $_FILES['code']['tmp_name']); close_db(); if ($res != NULL) { $_SESSION['msg'] = $res; } } else { $_SESSION['msg'] = 'ERROR: File too large'; } }