Browse Source

Merge pull request #177 from willtp87/ISLANDORA-761

ISLANDORA-761 fedora item setting ownerId as user->name rather than uid
pull/179/head
Jonathan Green 12 years ago
parent
commit
40e86d1f16
  1. 14
      api/fedora_item.inc

14
api/fedora_item.inc

@ -1465,7 +1465,9 @@ RDF;
* @param string $pid if none given, getnextpid will be called.
* @param string $state The initial state, A - Active, I - Inactive, D - Deleted
* @param type $label
* @param type $owner
* @param string $owner
* Used to set an object's ownerId attribute. Defaults to current user's
* name. If we are not a Drupal user(ie. Drush) defaults to ''.
*
* @return DOMDocument
*/
@ -1479,12 +1481,12 @@ RDF;
if (empty($owner)) {
global $user;
// Default to current Drupal user.
if (!empty($user->uid)) {
$owner = $user->uid;
if (!empty($user->name)) {
$owner = $user->name;
}
// We are not inside Drupal.
else {
$owner = 'fedoraAdmin';
// We are annonamous user.
elseif ($user->uid == 0) {
$owner = 'anonymous';
}
}

Loading…
Cancel
Save