summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-07-02 17:54:48 -0700
committerBharat Mediratta <bharat@menalto.com>2009-07-02 17:54:48 -0700
commit1a5fe42b555d51d22bde1521100a31d2b434486b (patch)
treea5471107611d27006a512da2b787aa49f9cded8d
parent9eee3b07a8abb1cd798372a20725290130ec183f (diff)
Temporary version add() that just dumps out the values for now.
-rw-r--r--modules/server_add/controllers/server_add.php23
1 files changed, 23 insertions, 0 deletions
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) {