/** * * private_item_storage_limit <= file size of all attachment files registered in private area(not public) * : return false. * */ function check_private_item_storage_limit() { $xnpsid = $_SESSION['XNPSID']; $uid = $_SESSION['xoopsUserId']; $account = array(); if (xnp_get_account($xnpsid, $uid, $account) == RES_OK) { if (filesize_private() >= $account['item_storage_limit']) { return FALSE; } } return TRUE; }
$xoopsTpl->assign("index_checked_id", $xoonipsCheckedXID); } $xoopsTpl->assign('scrollX', $scrollX); $xoopsTpl->assign('scrollY', $scrollY); $xoopsTpl->assign("invalid_doi_message", sprintf(_MD_XOONIPS_ITEM_DOI_INVALID_ID, XNP_CONFIG_DOI_FIELD_PARAM_MAXLEN)); $account = array(); if (xnp_get_account($xnpsid, $uid, $account) == RES_OK) { $iids = array(); if (xnp_get_private_item_id($xnpsid, $uid, $iids) == RES_OK) { $xoopsTpl->assign('num_of_items_current', count($iids)); } else { $xoopsTpl->assign('num_of_items_current', 0); } $xoopsTpl->assign('num_of_items_max', $account['item_number_limit']); $xoopsTpl->assign('storage_of_items_max', sprintf("%.02lf", $account['item_storage_limit'] / 1000 / 1000)); $xoopsTpl->assign('storage_of_items_current', sprintf("%.02lf", filesize_private() / 1000 / 1000)); } // If the page is made by POST, $_POST is made to save somewhere and page redirects. // rfc2616 10.3.4 303 See Other if ($_SERVER["REQUEST_METHOD"] == 'POST') { $post_id = uniqid('postid'); $_SESSION['post_id'] = array($post_id => serialize($_POST)); header("HTTP/1.0 303 See Other"); header("Location: " . XOOPS_URL . "/modules/xoonips/register.php?post_id={$post_id}"); echo sprintf(_IFNOTRELOAD, XOOPS_URL . "/modules/xoonips/register.php?post_id={$post_id}"); //redirect_header("register.php?post_id=$post_id", 5, "redirecting..."); exit; } // The output( header("Cache-control: no-cache") etc ) is prevented by footer.php. header('Content-Type:text/html; charset=' . _CHARSET); //echo "\r\n"; flush();