diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-09 16:03:48 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-09 16:03:48 +0000 |
commit | 5da29b883740e6c6db3e0ad9c045c080a8f8946a (patch) | |
tree | 106fd87961305f774d7d859cadb63795a145a9d2 | |
parent | 83563ac91ac336375e2d0ce64534d8ece2d8f6f3 (diff) |
Fix for ticket #135
-rw-r--r-- | modules/server_add/controllers/admin_server_add.php | 5 | ||||
-rw-r--r-- | 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. <a href=\"%url\">Configure it now!</a>", |