diff options
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/firewall_shaper_vinterface.php | 26 | ||||
-rw-r--r-- | usr/local/www/interfaces.php | 12 | ||||
-rwxr-xr-x | usr/local/www/pkg.php | 11 |
3 files changed, 34 insertions, 15 deletions
diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php index 0930af1..75bc0e0 100644 --- a/usr/local/www/firewall_shaper_vinterface.php +++ b/usr/local/www/firewall_shaper_vinterface.php @@ -317,7 +317,7 @@ $output_form .= gettext("Queue Actions"); $output_form .= "</td><td valign=\"top\" class=\"vncellreq\" width=\"78%\">"; $output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"formbtn\" />"; -if ($can_add || $addnewaltq) { +if ($can_add && ($action != "add")) { $output_form .= "<a href=\"firewall_shaper_vinterface.php?pipe="; $output_form .= $pipe; if ($queue) { @@ -327,18 +327,20 @@ if ($can_add || $addnewaltq) { $output_form .= "<input type=\"button\" class=\"formbtn\" name=\"add\" value=\"" . gettext("Add new queue") ."\" />"; $output_form .= "</a>"; } -$output_form .= "<a href=\"firewall_shaper_vinterface.php?pipe="; -$output_form .= $pipe; -if ($queue) { - $output_form .= "&queue=" . $queue->GetQname(); +if ($action != "add") { + $output_form .= "<a href=\"firewall_shaper_vinterface.php?pipe="; + $output_form .= $pipe; + if ($queue) { + $output_form .= "&queue=" . $queue->GetQname(); + } + $output_form .= "&action=delete\">"; + $output_form .= "<input type=\"button\" class=\"formbtn\" name=\"delete\""; + if (($queue) && ($qname != $pipe)) + $output_form .= " value=\"" . gettext("Delete this queue") ."\" />"; + else + $output_form .= " value=\"" . gettext("Delete Limiter") ."\" />"; + $output_form .= "</a>"; } -$output_form .= "&action=delete\">"; -$output_form .= "<input type=\"button\" class=\"formbtn\" name=\"delete\""; -if ($queue) - $output_form .= " value=\"" . gettext("Delete this queue") ."\" />"; -else - $output_form .= " value=\"" . gettext("Delete Limiter") ."\" />"; -$output_form .= "</a>"; $output_form .= "</td></tr>"; $output_form .= "</table>"; } diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 7184dee..6a140b7 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -504,6 +504,16 @@ if ($_POST['apply']) { break; } } + + /* Is the description already used as an alias name? */ + if (is_array($config['aliases']['alias'])) { + foreach ($config['aliases']['alias'] as $alias) { + if ($alias['name'] == $_POST['descr']) { + $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."), $_POST['descr']); + } + } + } + if(is_numeric($_POST['descr'])) { $input_errors[] = gettext("The interface description cannot contain only numbers."); } @@ -1493,7 +1503,7 @@ foreach ($mediaopts as $mediaopt){ } } -$pgtitle = array(gettext("Interfaces"), $pconfig['descr']); +$pgtitle = array(gettext("Interfaces"), $wancfg['descr']); $shortcut_section = "interfaces"; $closehead = false; diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index 4b600cc..c60806d 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -53,8 +53,15 @@ if($xml == "") { } else { $pkg_xml_prefix = "/usr/local/pkg/"; $pkg_full_path = "{$pkg_xml_prefix}/{$xml}"; - if (substr_compare(realpath($pkg_full_path), $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) { - print_info_box_np(gettext("ERROR: Invalid path specified.")); + $pkg_realpath = realpath($pkg_full_path); + if (empty($pkg_realpath)) { + $path_error = sprintf(gettext("ERROR: Package path %s not found."), htmlspecialchars($pkg_full_path)); + } else if (substr_compare($pkg_realpath, $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) { + $path_error = sprintf(gettext("ERROR: Invalid path %s specified."), htmlspecialchars($pkg_full_path)); + } + + if (!empty($path_error)) { + print_info_box_np($path_error . "<br />" . gettext("Try reinstalling the package.") . "<br />" . gettext("Use the back button on your browser to return to the previous page.")); die; } |