summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-03 21:43:59 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-03 21:43:59 +0000
commitf58bbe0610cea5406324d0f1b2e3a3b925a89645 (patch)
treefce6beec1aecc1e37baf33160dd971641b0113c5 /modules
parent9775cb69e2e3b8c3e2891ac22d01278c380912e8 (diff)
Improve the comment about why we skip the first path.
Change to use access::required
Diffstat (limited to 'modules')
-rw-r--r--modules/local_import/controllers/local_import.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/local_import/controllers/local_import.php b/modules/local_import/controllers/local_import.php
index 8a3762ae..d5a1662a 100644
--- a/modules/local_import/controllers/local_import.php
+++ b/modules/local_import/controllers/local_import.php
@@ -22,7 +22,7 @@ class Local_Import_Controller extends Controller {
$paths = unserialize(module::get_var("local_import", "authorized_paths"));
$item = ORM::factory("item", $id);
- access::can("local_import", $item);
+ access::required("local_import", $item);
$view = new View("local_import_tree_dialog.html");
$view->action = url::site("local_import/add_photo/$id");
@@ -57,7 +57,7 @@ class Local_Import_Controller extends Controller {
access::verify_csrf();
$parent = ORM::factory("item", $id);
- access::can("local_import", $item);
+ access::required("local_import", $parent);
if (!$parent->is_album() && !$parent->loaded ) {
throw new Exception("@todo BAD_ALBUM");
}
@@ -66,7 +66,8 @@ class Local_Import_Controller extends Controller {
batch::operation("add", $parent);
$source_path = $path[0];
- for ($i = 1; $i < count($path); $i++) { // skip the first path
+ // The first path corresponds to the source directory so we can just skip it.
+ for ($i = 1; $i < count($path); $i++) {
$source_path .= "/$path[$i]";
$pathinfo = pathinfo($source_path);
set_time_limit(30);