$g['captiveportal_element_sizelimit']) { $input_errors[] = gettext("The total size of all files uploaded may not exceed ") . format_bytes($g['captiveportal_element_sizelimit']) . "."; } if (!$input_errors) { $element = array(); $element['name'] = $name; $element['size'] = $size; $element['content'] = base64_encode(file_get_contents($_FILES['new']['tmp_name'])); $a_element[] = $element; cpelements_sort(); write_config(); captiveportal_write_elements(); header("Location: services_captiveportal_filemanager.php?zone={$cpzone}"); exit; } } } else if (($_GET['act'] == "del") && !empty($cpzone) && $a_element[$_GET['id']]) { conf_mount_rw(); @unlink("{$g['captiveportal_element_path']}/" . $a_element[$_GET['id']]['name']); @unlink("{$g['captiveportal_path']}/" . $a_element[$_GET['id']]['name']); conf_mount_ro(); unset($a_element[$_GET['id']]); write_config(); header("Location: services_captiveportal_filemanager.php?zone={$cpzone}"); exit; } include("head.inc"); if ($input_errors) print_input_errors($input_errors); $tab_array = array(); $tab_array[] = array(gettext("Captive Portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MAC"), false, "services_captiveportal_mac.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed IP Addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php?zone={$cpzone}"); $tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php?zone={$cpzone}"); $tab_array[] = array(gettext("File Manager"), true, "services_captiveportal_filemanager.php?zone={$cpzone}"); display_top_tabs($tab_array, true); if ($_GET['act'] == 'add') { $form = new Form(new Form_Button( 'Submit', 'Upload' )); $form->setMultipartEncoding(); $section = new Form_Section('Upload a new file'); $section->addInput(new Form_Input( 'zone', null, 'hidden', $cpzone )); $section->addInput(new Form_Input( 'new', 'File', 'file' )); $form->add($section); print($form); } if (is_array($a_cp[$cpzone]['element'])): ?>
=gettext("Name"); ?> | =gettext("Size"); ?> | |
---|---|---|
=htmlspecialchars($element['name'])?> | =format_bytes($element['size'])?> | " href="services_captiveportal_filemanager.php?zone==$cpzone?>&act=del&id==$i?>"> |
Total | =format_bytes($total_size);?> |
<img src="captiveportal-test.jpg" width=... height=...>
<a href="/captiveportal-aup.php?zone=$PORTAL_ZONE$&redirurl=$PORTAL_REDIRURL$">=gettext("Acceptable usage policy"); ?></a>