if (!$object->read($target, 0)) { pieError("FileReadError"); } } else { pieError("ActionInvalid"); } // Check permissions to delete the resource: $history = $object->history($object->name); if (@$_REQUEST['approve']) { // The user asked to delete the resource, no matter what. if ($GLOBALS['pie']['deny_removal'] && !pieIsSuperuser($GLOBALS['pie']['user'])) { pieError("ActionNotPermitted"); } } else { // Check for referers. if (($referers = pieRefererList($target, $context)) === false) { pieError("RefererError"); } if (count($referers)) { // There are pages linking to the target. pieError("RefererNotice"); } // Check for co-authors. foreach ($history as $stamp => $info) { if ($info['author'] == $GLOBALS['pie']['user']) { continue; } // We are trying to affect an other author's work // ... which is only suitable for admins. if (!pieIsSuperuser($GLOBALS['pie']['user'])) { pieError("AuthorDiffers", array('action' => "{$context}history"));
if (!$object->isValidName($destination)) { pieError("NewNameInvalid"); } if ($object->exists($destination)) { pieError("DestinationExists"); } // Check permissions to delete the resource: $history = $object->history($object->name); if (@$_REQUEST['approve']) { // The user asked to rename the resource, no matter what. if ($GLOBALS['pie']['deny_removal'] && !pieIsSuperuser($GLOBALS['pie']['user'])) { pieError("ActionNotPermitted"); } } else { // Check for referers. if (($referers = pieRefererList($source, $context)) === false) { pieError("RefererError"); } if (count($referers)) { // There are pages linking to the resource. pieError("RefererNotice"); } // Check for co-authors. foreach ($history as $stamp => $info) { if ($info['author'] == $GLOBALS['pie']['user']) { continue; } // We are trying to affect an other author's work // ... which is only suitable for admins. if (!pieIsSuperuser($GLOBALS['pie']['user'])) { pieError("AuthorDiffers", array('action' => "{$context}history"));