From 1a5fe42b555d51d22bde1521100a31d2b434486b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 2 Jul 2009 17:54:48 -0700 Subject: Temporary version add() that just dumps out the values for now. --- modules/server_add/controllers/server_add.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'modules/server_add/controllers') diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 45ec0a2e..2204b338 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -81,6 +81,29 @@ class Server_Add_Controller extends Controller { print $tree; } + public function add() { + if (!user::active()->admin) { + access::forbidden(); + } + access::verify_csrf(); + + $authorized_paths = unserialize(module::get_var("server_add", "authorized_paths")); + + // The paths we receive are full pathnames. Convert that into a tree structure to save space + // in our task. + foreach (Input::instance()->post("path") as $path) { + if (is_dir($path)) { + $dirs[$path] = array(); + } else if (is_file($path)) { + $dir = dirname($path); + $file = basename($path); + $dirs[$dir][] = $file; + } + } + + Kohana::log("alert",print_r($dirs,1)); + } + /* ================================================================================ */ function start($id) { -- cgit v1.2.3