summaryrefslogtreecommitdiff
path: root/modules/server_add/controllers/server_add.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/server_add/controllers/server_add.php')
-rw-r--r--modules/server_add/controllers/server_add.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php
index 71688605..2afa93a7 100644
--- a/modules/server_add/controllers/server_add.php
+++ b/modules/server_add/controllers/server_add.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -95,7 +95,7 @@ class Server_Add_Controller extends Admin_Controller {
if (server_add::is_valid_path($path)) {
$entry = ORM::factory("server_add_entry");
$entry->path = $path;
- $entry->is_directory = 1;
+ $entry->is_directory = intval(is_dir($path));
$entry->parent_id = null;
$entry->task_id = $task->id;
$entry->save();
@@ -162,14 +162,9 @@ class Server_Add_Controller extends Admin_Controller {
->find();
if ($entry->loaded()) {
- // Ignore the staging directories as directories to be imported.
- if (!empty($paths[$entry->path])) {
- $entry->delete();
- }
-
$child_paths = glob(preg_quote($entry->path) . "/*");
if (!$child_paths) {
- $child_paths = glob("$path/*");
+ $child_paths = glob("{$entry->path}/*");
}
foreach ($child_paths as $child_path) {
if (!is_dir($child_path)) {