Browse Source

resolved conflicts

pull/63/head
Alan Stanley 13 years ago
parent
commit
b1cb2bb308
  1. 3
      CollectionClass.inc
  2. 14
      ObjectHelper.inc
  3. 34
      SecurityClass.inc
  4. 9
      api/fedora_item.inc
  5. 2
      fedora_repository.info
  6. 2
      plugins/fedora_imageapi.info

3
CollectionClass.inc

@ -519,7 +519,8 @@ class CollectionClass {
$show_batch_tab = FALSE;
$policy = CollectionPolicy::loadFromCollection($this->pid, TRUE);
if ($policy) {
if(!empty($policy)){
$content_models = $policy->getContentModels();
}
if (count($content_models) == 1 && $content_models[0]->pid == "islandora:collectionCModel") {

14
ObjectHelper.inc

@ -935,18 +935,22 @@ class ObjectHelper {
or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject)
and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0>
order by $title';
order by $title desc';
$query_string = htmlentities(urlencode($query_string));
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string;
$result = preg_split('/[\r\n]+/', do_curl($url));
array_shift($result); // throw away first line
$matches = str_getcsv(join("\n", $result));
if ($matches !== FALSE) {
if (count($matches) >= 2) {
$parent = preg_replace('/^info:fedora\//', '', $matches[0]);
if (0 == strlen($matches[1])) {
$matches[1] = "Unlabeled Object";
}
$breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid);
if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) {
$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository');
@ -956,6 +960,10 @@ class ObjectHelper {
$this->getBreadcrumbs($parent, $breadcrumbs, $level - 1);
}
}
else {
$breadcrumbs[] = l("Path Calculation Error", 'fedora/repository/' . $pid);
}
}
}

34
SecurityClass.inc

@ -34,7 +34,6 @@ class SecurityClass {
$objectHelper = new ObjectHelper();
// get the childsecurity policy from the collection.
$policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE);
if ($policyStream == NULL) {
// no child policy stream so collection is wide open to anyone to ingest, that has the permission ingest in Drupal.
// maybe we should return FALSE here?? would be more secure.
@ -79,34 +78,19 @@ class SecurityClass {
}
$xml->registerXPathNamespace('default', 'urn:oasis:names:tc:xacml:1.0:policy');
$conditions = $xml->xpath("//default:Condition");
foreach ($conditions as $condition) {
$designator = $condition->Apply->SubjectAttributeDesignator;
if (empty($designator)) {//$disignator may be wrapped by an or
$designator = $condition->Apply->Apply->SubjectAttributeDesignator;
}
$attributeId = strip_tags($designator['AttributeId']);
$roles = $xml->xpath('//default:SubjectAttributeDesignator[@AttributeId="fedoraRole"]/../default:Apply/default:AttributeValue');
$users = $xml->xpath('//default:SubjectAttributeDesignator[@AttributeId="urn:fedora:names:fedora:2.1:subject:loginId"]/../default:Apply/default:AttributeValue');
if ($attributeId == "fedoraRole") {
foreach ($condition->Apply->Apply->AttributeValue as $attributeValue) {
$allowedRoles[] = strip_tags($attributeValue->asXML());
}
foreach ($condition->Apply->Apply->Apply->AttributeValue as $attributeValue) {
$allowedRoles[] = strip_tags($attributeValue->asXML());
}
}
if ($attributeId == "urn:fedora:names:fedora:2.1:subject:loginId") {
foreach ($condition->Apply->Apply->AttributeValue as $attributeValue) {
$allowedUsers[] = strip_tags($attributeValue->asXML());
}
foreach ($condition->Apply->Apply->Apply->AttributeValue as $attributeValue) {
$allowedUsers[] = strip_tags($attributeValue->asXML());
}
}
foreach($roles as $role) {
$allowedRoles[] = (string)$role;
}
foreach($users as $user) {
$allowedUsers[] = (string)$user;
}
$usersAndRoles['users'] = $allowedUsers;
$usersAndRoles['roles'] = $allowedRoles;
return $usersAndRoles;
}

9
api/fedora_item.inc

@ -43,7 +43,7 @@ class Fedora_Item {
}
$raw_objprofile = $this->soap_call('getObjectProfile', array('pid' => $this->pid, 'asOfDateTime' => ""));
if (!empty($raw_objprofile)) {
$this->objectProfile = $raw_objprofile->objectProfile;
$this->datastreams = $this->get_datastreams_list_as_array();
@ -297,18 +297,17 @@ class Fedora_Item {
$i++;
$url = variable_get('fedora_base_url', 'http://localhost:8080/fedora');
if ($cursor == 0) {
$url .= "/objects?query=$field~$pattern&pid=TRUE&title=TRUE&resultFormat=xml&maxResults=$max_results";
$url .= "/objects?query=$field~$pattern&pid=true&title=TRUE&resultFormat=xml&maxResults=$max_results";
}
else {
$url .= "/objects?pid=TRUE&title=TRUEsessionToken=$session_token&resultFormat=xml&maxResults=$max_results";
$url .= "/objects?pid=true&title=true&sessionToken=$session_token&resultFormat=xml&maxResults=$max_results";
}
if (count($resultFields) > 0) {
$url .= '&' . join('=TRUE&', $resultFields) . '=TRUE';
$url .= '&' . join('=true&', $resultFields) . '=true';
}
$resultxml = do_curl($url);
libxml_use_internal_errors(TRUE);
$resultelements = simplexml_load_string($resultxml);
if ($resultelements === FALSE) {

2
fedora_repository.info

@ -5,5 +5,5 @@ dependencies[] = tabs
dependencies[] = islandora_content_model_forms
description = Shows a list of items in a fedora collection.
package = Islandora
version = 11.2.0
version = 11.3beta1
core = 6.x

2
plugins/fedora_imageapi.info

@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface
package = Islandora Dependencies
dependencies[] = fedora_repository
dependencies[] = imageapi
version = 11.2.0
version = 11.3beta1
core = 6.x

Loading…
Cancel
Save