Rev 1292 | Rev 1295 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1292 | Rev 1294 | ||
---|---|---|---|
Line 476... | Line 476... | ||
476 | // TODO: Check if any identifiers have been actually changed, |
476 | // TODO: Check if any identifiers have been actually changed, |
477 | // and log it to OID($id), OID($parent), ... (see above) |
477 | // and log it to OID($id), OID($parent), ... (see above) |
478 | } |
478 | } |
479 | 479 | ||
480 | if (isset($params['confidential'])) { |
480 | if (isset($params['confidential'])) { |
481 | $confidential = $params['confidential'] == 'true'; |
481 | $confidential = oidplus_is_true($params['confidential']); |
482 | OIDplus::db()->query("UPDATE ###objects SET confidential = ? WHERE id = ?", array($confidential, $id)); |
482 | OIDplus::db()->query("UPDATE ###objects SET confidential = ? WHERE id = ?", array($confidential, $id)); |
483 | OIDplusObject::resetObjectInformationCache(); |
483 | OIDplusObject::resetObjectInformationCache(); |
484 | } |
484 | } |
485 | 485 | ||
486 | if (isset($params['comment'])) { |
486 | if (isset($params['comment'])) { |
Line 580... | Line 580... | ||
580 | } |
580 | } |
581 | } |
581 | } |
582 | 582 | ||
583 | // Determine absolute OID name |
583 | // Determine absolute OID name |
584 | // Note: At addString() and parse(), the syntax of the ID will be checked |
584 | // Note: At addString() and parse(), the syntax of the ID will be checked |
585 | $is_absolute = isset($params['id_fully_qualified']) && $params['id_fully_qualified'] == 'true';; |
585 | if (oidplus_is_true($params['id_fully_qualified'] ?? false)) { |
586 | if ($is_absolute) { |
- | |
587 | // For REST API, the ID is absolute (because this is what is in the URL). We need to verify that ID and Parent matches. |
586 | // For REST API, the ID is absolute (because this is what is in the URL). We need to verify that ID and Parent matches. |
588 | $id = $params['id']; |
587 | $id = $params['id']; |
589 | $obj = OIDplusObject::parse($id); |
588 | $obj = OIDplusObject::parse($id); |
590 | $objParentTest = !$obj ? null : $obj->getParent(); |
589 | $objParentTest = !$obj ? null : $obj->getParent(); |
591 | if (!$objParentTest || !$objParentTest->equals($objParent)) throw new OIDplusException(_L('Cannot verify that %1 has parent %2', $obj->nodeId(), $objParent->nodeId())); |
590 | if (!$objParentTest || !$objParentTest->equals($objParent)) throw new OIDplusException(_L('Cannot verify that %1 has parent %2', $obj->nodeId(), $objParent->nodeId())); |
Line 645... | Line 644... | ||
645 | } |
644 | } |
646 | if (!empty($ra_email)) { |
645 | if (!empty($ra_email)) { |
647 | OIDplus::logger()->log("V2:[INFO]RA(%2)", "Gained ownership of newly created object '%1'", $id, $ra_email); |
646 | OIDplus::logger()->log("V2:[INFO]RA(%2)", "Gained ownership of newly created object '%1'", $id, $ra_email); |
648 | } |
647 | } |
649 | 648 | ||
650 | $confidential = isset($params['confidential']) && $params['confidential'] == 'true'; |
649 | $confidential = oidplus_is_true($params['confidential'] ?? false); |
651 | $comment = $params['comment'] ?? ''; |
650 | $comment = $params['comment'] ?? ''; |
652 | $title = $params['title'] ?? ''; // This is very special (only useable in REST API): The superior RA can set the title during creation, even if they lose their ownership by delegating afterwards! |
651 | $title = $params['title'] ?? ''; // This is very special (only useable in REST API): The superior RA can set the title during creation, even if they lose their ownership by delegating afterwards! |
653 | $description = $params['description'] ?? ''; // This is very special (only useable in REST API): The superior RA can set the title during creation, even if they lose their ownership by delegating afterwards! |
652 | $description = $params['description'] ?? ''; // This is very special (only useable in REST API): The superior RA can set the title during creation, even if they lose their ownership by delegating afterwards! |
654 | 653 | ||
655 | if (strlen($id) > OIDplus::baseConfig()->getValue('LIMITS_MAX_ID_LENGTH')) { |
654 | if (strlen($id) > OIDplus::baseConfig()->getValue('LIMITS_MAX_ID_LENGTH')) { |