From 5da29b883740e6c6db3e0ad9c045c080a8f8946a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 9 Mar 2009 16:03:48 +0000 Subject: Fix for ticket #135 --- modules/server_add/controllers/admin_server_add.php | 5 +++-- modules/server_add/helpers/server_add.php | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php index cbac7eb5..b68ecc97 100644 --- a/modules/server_add/controllers/admin_server_add.php +++ b/modules/server_add/controllers/admin_server_add.php @@ -41,7 +41,8 @@ class Admin_Server_Add_Controller extends Admin_Controller { $form->add_path->inputs->path->value = ""; message::success(t("Added path %path", array("path" => $path))); - server_add::check_config(); + + server_add::check_config($paths); url::redirect("admin/server_add"); } else { $form->add_path->path->add_error("not_readable", 1); @@ -63,7 +64,7 @@ class Admin_Server_Add_Controller extends Admin_Controller { unset($paths[$path]); message::success(t("Removed path %path", array("path" => $path))); module::set_var("server_add", "authorized_paths", serialize($paths)); - server_add::check_config(); + server_add::check_config($paths); url::redirect("admin/server_add"); } diff --git a/modules/server_add/helpers/server_add.php b/modules/server_add/helpers/server_add.php index e51d3d98..10a7c626 100644 --- a/modules/server_add/helpers/server_add.php +++ b/modules/server_add/helpers/server_add.php @@ -18,8 +18,10 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class server_add_Core { - static function check_config() { - $paths = unserialize(module::get_var("server_add", "authorized_paths")); + static function check_config($paths=null) { + if ($paths === null) { + $paths = unserialize(module::get_var("server_add", "authorized_paths")); + } if (empty($paths)) { site_status::warning( t("Server Add needs configuration. Configure it now!", -- cgit v1.2.3