From aa4da63f959d897757803c5cb259e441e8da718b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 24 May 2018 19:50:21 +0000 Subject: [PATCH] interfaces: add remote-safe reload; closes #1642 Demote the current actions to non-primary actions as they are local and selective. --- src/www/status_interfaces.php | 82 +++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/src/www/status_interfaces.php b/src/www/status_interfaces.php index 64e14f35c..d6ada2213 100644 --- a/src/www/status_interfaces.php +++ b/src/www/status_interfaces.php @@ -1,32 +1,32 @@ - Copyright (C) 2003-2005 Manuel Kasper - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (C) 2014-2015 Deciso B.V. + * Copyright (C) 2009 Scott Ullrich + * Copyright (C) 2003-2005 Manuel Kasper + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ require_once("guiconfig.inc"); require_once("system.inc"); @@ -36,7 +36,9 @@ require_once("interfaces.inc"); if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($_POST['if']) && !empty($_POST['submit'])) { $interface = $_POST['if']; - if (!empty($_POST['status']) && $_POST['status'] == 'up') { + if ($_POST['submit'] == 'remote') { + configd_run(exec_safe('interface reconfigure %s', array($interface))); + } elseif (!empty($_POST['status']) && $_POST['status'] == 'up') { interface_bring_down($interface); } else { interface_configure(false, $interface, true); @@ -114,7 +116,8 @@ include("head.inc");    - " /> + + @@ -128,7 +131,8 @@ include("head.inc");    - " /> + + @@ -142,7 +146,8 @@ include("head.inc");    - " /> + + @@ -156,7 +161,8 @@ include("head.inc");    - " /> + + @@ -170,7 +176,8 @@ include("head.inc");    - " /> + + @@ -184,13 +191,12 @@ include("head.inc"); + - " /> - - - " /> - - + + + +