Commit b16f6e5c72b0519de84b010fabe86f9d5485c9e0
1 parent
55fc9ac7
corrected lookups and bugs resulting from folder structure
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@520 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
8 additions
and
7 deletions
lib/documentmanagement/DocumentBrowser.inc
| ... | ... | @@ -35,13 +35,13 @@ class DocumentBrowser { |
| 35 | 35 | // no folder specified, so depending on the users groups, resolve to the right folderID |
| 36 | 36 | if ($folderID == -1) { |
| 37 | 37 | // no folder specified, so start at the root for this users organisation |
| 38 | - | |
| 38 | + | |
| 39 | 39 | // TODO: check that all these lookup calls succeed? |
| 40 | 40 | |
| 41 | 41 | // lookup this users groups |
| 42 | 42 | $groupIDs = lookupGroupIDs($_SESSION["userID"]); |
| 43 | 43 | $default->log->debug("DocumentBrowser::browseByFolder: groupIDs=" . arrayToString($groupIDs)); |
| 44 | - | |
| 44 | + /* | |
| 45 | 45 | // look up this users unit |
| 46 | 46 | // FIXME: what if the user belongs to multiple units? |
| 47 | 47 | $unitID = lookupField($default->owl_groups_units_table, "unit_id", "group_id", $groupIDs[0]); |
| ... | ... | @@ -60,10 +60,11 @@ class DocumentBrowser { |
| 60 | 60 | // lookup the id of the root folder |
| 61 | 61 | $folderID = lookupID($default->owl_folders_table, "name", $rootFolderName); |
| 62 | 62 | $default->log->debug("DocumentBrowser::browseByFolder: root folderID=$folderID, root folder name=$rootFolderName"); |
| 63 | - | |
| 63 | + */ | |
| 64 | 64 | // if this is a system administrator, start her at the root folder |
| 65 | 65 | // TODO: add to default->sysadmin_group |
| 66 | 66 | if ($this->checkGroup("System Administrators", $groupIDs)) { |
| 67 | + $folderID = lookupID($default->owl_folders_table, "parent_id", 0); | |
| 67 | 68 | //$folderQuery = "SELECT * FROM $default->owl_folders_table WHERE name='$rootFolderName'"; |
| 68 | 69 | //$results["folders"][] = & Folder::get($folderID); |
| 69 | 70 | $default->log->info("DocumentBrowser::browseByFolder looked up org root folderID=$folderID; org root foldername=$rootFolderName"); |
| ... | ... | @@ -75,7 +76,7 @@ class DocumentBrowser { |
| 75 | 76 | |
| 76 | 77 | $default->log->debug("DocumentBrowser::browseByFolder: unitName=$unitName"); |
| 77 | 78 | |
| 78 | - $unitRootFolderName = $unitName . " Document Root"; | |
| 79 | + $unitRootFolderName = $unitName;// . " Root Folder"; | |
| 79 | 80 | |
| 80 | 81 | // lookup descendant folders with the appropriate unit set |
| 81 | 82 | //$folderQuery = "SELECT from $default->owl_folders_table " . |
| ... | ... | @@ -93,7 +94,7 @@ class DocumentBrowser { |
| 93 | 94 | $default->log->debug("DocumentBrowser::browseByFolder: folderID=$folderID"); |
| 94 | 95 | |
| 95 | 96 | // check if the user has access to this folder |
| 96 | - if (Permission::userHasFolderReadPermission($folderID)) { | |
| 97 | + //if (Permission::userHasFolderReadPermission($folderID)) { | |
| 97 | 98 | // get the folder |
| 98 | 99 | $results["folders"][] = & Folder::get($folderID); |
| 99 | 100 | $default->log->debug("DocumentBrowser::browseByFolder: results=" . arrayToString($results)); |
| ... | ... | @@ -129,12 +130,12 @@ class DocumentBrowser { |
| 129 | 130 | } |
| 130 | 131 | |
| 131 | 132 | return $results; |
| 132 | - | |
| 133 | + /* | |
| 133 | 134 | } else { |
| 134 | 135 | // permission to view this folder denied |
| 135 | 136 | $_SESSION["errorMessage"] = "you do not have permission to view this folder (" . $_SESSION["errorMessage"] . ")"; |
| 136 | 137 | return false; |
| 137 | - } | |
| 138 | + }*/ | |
| 138 | 139 | } |
| 139 | 140 | |
| 140 | 141 | /** | ... | ... |