@@ -24,7 +24,7 @@ |
||
| 24 | 24 | midcom::get()->metadata->set_request_metadata($this->_topic->metadata->revised, $this->_topic->guid); |
| 25 | 25 | $data['node'] = $this->_topic; |
| 26 | 26 | |
| 27 | - if ( $this->_topic->id == midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC)->id |
|
| 27 | + if ($this->_topic->id == midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC)->id |
|
| 28 | 28 | && !midcom::get()->config->get('midcom_root_component')) { |
| 29 | 29 | // if we have an ad hoc root topic, give user some options to do the initial setup |
| 30 | 30 | return new midcom_response_relocate($this->router->generate('wizard')); |
@@ -119,14 +119,14 @@ discard block |
||
| 119 | 119 | if ($parent = $object->get_parent()) { |
| 120 | 120 | // Attachments are a special case |
| 121 | 121 | if ($object instanceof midcom_db_attachment) { |
| 122 | - if ( !$parent->can_do('midgard:attachments') |
|
| 122 | + if (!$parent->can_do('midgard:attachments') |
|
| 123 | 123 | || !$parent->can_do('midgard:update')) { |
| 124 | 124 | debug_add("Failed to create attachment, update or attachments privilege on the parent " . get_class($parent) . " {$parent->guid} not granted for the current user.", |
| 125 | 125 | MIDCOM_LOG_ERROR); |
| 126 | 126 | midcom_connection::set_error(MGD_ERR_ACCESS_DENIED); |
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | - } elseif ( !$parent->can_do('midgard:create') |
|
| 129 | + } elseif (!$parent->can_do('midgard:create') |
|
| 130 | 130 | && !midcom::get()->auth->can_user_do('midgard:create', null, get_class($object))) { |
| 131 | 131 | debug_add("Failed to create object, create privilege on the parent " . get_class($parent) . " {$parent->guid} or the actual object class not granted for the current user.", |
| 132 | 132 | MIDCOM_LOG_ERROR); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // Default the owner to first group of current user |
| 241 | - if ( empty($object->metadata->owner) |
|
| 241 | + if (empty($object->metadata->owner) |
|
| 242 | 242 | && $first_group = midcom::get()->auth->user->get_first_group_guid()) { |
| 243 | 243 | $object->metadata->set('owner', $first_group); |
| 244 | 244 | } |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | */ |
| 463 | 463 | public static function get_by_guid(midcom_core_dbaobject $object, string $guid) : bool |
| 464 | 464 | { |
| 465 | - if ( !midcom::get()->auth->admin |
|
| 465 | + if (!midcom::get()->auth->admin |
|
| 466 | 466 | && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $guid, get_class($object), midcom::get()->auth->acl->get_user_id())) { |
| 467 | 467 | debug_add("Failed to load object, read privilege on the " . get_class($object) . " {$guid} not granted for the current user.", MIDCOM_LOG_ERROR); |
| 468 | 468 | return false; |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function setTargetUrl($url) |
| 29 | 29 | { |
| 30 | - if ( !str_starts_with($url, "/") |
|
| 30 | + if (!str_starts_with($url, "/") |
|
| 31 | 31 | && !preg_match('|^https?://|', $url)) { |
| 32 | 32 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) ?: '/'; |
| 33 | 33 | $url = $prefix . $url; |