summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/server_add/controllers/admin_server_add.php5
-rw-r--r--modules/server_add/helpers/server_add.php6
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>",