$g['captiveportal_element_sizelimit']) { $input_errors[] = sprintf(gettext("The total size of all files uploaded may not exceed %s."), 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("Configuration"), false, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MACs"), 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(false); $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); $form->addGlobal(new Form_Button( 'Submit', 'Upload', null, 'fa-upload' ))->addClass('btn-primary'); print($form); } if (is_array($a_cp[$cpzone]['element'])): ?>



<img src="captiveportal-test.jpg" width=... height=...>



<a href="/captiveportal-aup.php?zone=$PORTAL_ZONE$&redirurl=$PORTAL_REDIRURL$"></a>