@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | echo '<p>' . $data['l10n']->get('last login') . ': ' . $formatter->datetime($lastlogin) . "</p>\n"; |
12 | 12 | } |
13 | 13 | |
14 | - if ( $data['person']->guid == midcom::get()->auth->user->guid |
|
14 | + if ($data['person']->guid == midcom::get()->auth->user->guid |
|
15 | 15 | || midcom::get()->auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) { |
16 | 16 | $workflow = new midcom\workflow\datamanager; |
17 | 17 | echo '<ul class="area_toolbar">'; |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | 'object' => $data['person'], |
21 | 21 | 'label' => $data['l10n']->get('account') |
22 | 22 | ]); |
23 | - echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]). '" ' . $workflow->render_attributes() . '" class="button">'; |
|
23 | + echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]) . '" ' . $workflow->render_attributes() . '" class="button">'; |
|
24 | 24 | echo '<span class="toolbar_label">' . $data['l10n_midcom']->get('delete') . '</span></a></li>'; |
25 | - if ( midcom::get()->config->get('auth_allow_trusted') === true |
|
25 | + if (midcom::get()->config->get('auth_allow_trusted') === true |
|
26 | 26 | && $data['person']->can_do('org.openpsa.user:su')) { |
27 | 27 | echo '<li><a class="button" href="' . $data['router']->generate('account_su', ['guid' => $data['person']->guid]) . '">' . $data['l10n']->get('switch to user') . "</a></li>\n"; |
28 | 28 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | } else { |
32 | 32 | echo '<p><span class="metadata">' . $data['l10n']->get("no account") . '</span></p>'; |
33 | - if ( $data['person']->guid == midcom::get()->auth->user->guid |
|
33 | + if ($data['person']->guid == midcom::get()->auth->user->guid |
|
34 | 34 | || midcom::get()->auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) { |
35 | 35 | $workflow = new midcom\workflow\datamanager; |
36 | 36 | echo '<ul class="area_toolbar">'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $this->add_breadcrumb('', $person->get_label()); |
25 | 25 | |
26 | 26 | $auth = midcom::get()->auth; |
27 | - if ( $person->guid == midcom::get()->auth->user->guid |
|
27 | + if ($person->guid == midcom::get()->auth->user->guid |
|
28 | 28 | || $auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) { |
29 | 29 | $buttons = []; |
30 | 30 | $workflow = $this->get_workflow('datamanager'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $delete_workflow = $this->get_workflow('delete', ['object' => $person]); |
38 | 38 | $buttons[] = $delete_workflow->get_button($this->router->generate('user_delete', ['guid' => $person->guid])); |
39 | 39 | } |
40 | - if ( midcom_connection::is_user($person) |
|
40 | + if (midcom_connection::is_user($person) |
|
41 | 41 | && $person->can_do('midgard:privileges')) { |
42 | 42 | $buttons[] = $workflow->get_button($this->router->generate('user_privileges', ['guid' => $person->guid]), [ |
43 | 43 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("permissions"), |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $invoices_url = $siteconfig->get_node_full_url('org.openpsa.invoices'); |
106 | 106 | $user_url = $siteconfig->get_node_full_url('org.openpsa.user'); |
107 | 107 | |
108 | - if ( $invoices_url |
|
108 | + if ($invoices_url |
|
109 | 109 | && midcom::get()->auth->can_user_do('midgard:create', null, org_openpsa_invoices_invoice_dba::class) |
110 | 110 | && $this->_contact->can_do('midgard:update')) { |
111 | 111 | $buttons[] = $workflow->get_button($invoices_url . "billingdata/" . $this->_contact->guid . '/', [ |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | ]); |
115 | 115 | } |
116 | 116 | |
117 | - if ( $user_url |
|
118 | - && ( midcom::get()->auth->user->guid == $this->_contact->guid |
|
117 | + if ($user_url |
|
118 | + && (midcom::get()->auth->user->guid == $this->_contact->guid |
|
119 | 119 | || midcom::get()->auth->can_user_do('org.openpsa.user:access', null, org_openpsa_user_interface::class))) { |
120 | 120 | $buttons[] = [ |
121 | 121 | MIDCOM_TOOLBAR_URL => $user_url . "view/{$this->_contact->guid}/", |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | protected function match(string $property, array $data1, array $data2) : bool |
115 | 115 | { |
116 | - if ( !empty($data1[$property]) |
|
116 | + if (!empty($data1[$property]) |
|
117 | 117 | && $data1[$property] == $data2[$property]) { |
118 | 118 | return true; |
119 | 119 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | continue; |
196 | 196 | } |
197 | 197 | |
198 | - if ( $obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid) |
|
198 | + if ($obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid) |
|
199 | 199 | || $obj2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj1->guid)) { |
200 | 200 | // Not-duplicate parameter found, returning zero probability |
201 | 201 | continue; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | // if user's lastname is part of the email address, check to see if the difference is only in the domain part |
43 | 43 | $email1 = preg_replace('/@.+/', '', $person1['email']); |
44 | 44 | $email2 = preg_replace('/@.+/', '', $person2['email']); |
45 | - if ( str_contains($email1, $person1['lastname']) |
|
45 | + if (str_contains($email1, $person1['lastname']) |
|
46 | 46 | && $email1 == $email2) { |
47 | 47 | $p += 0.5; |
48 | 48 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function load_next() |
61 | 61 | { |
62 | - $i =& $this->_request_data['loop_i']; |
|
62 | + $i = & $this->_request_data['loop_i']; |
|
63 | 63 | while ($i < 100) { |
64 | 64 | debug_add("Loop iteration {$i}"); |
65 | 65 | $qb = new midgard_query_builder('midgard_parameter'); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | // Make sure we actually have enough rights to do this |
90 | - if ( !$object1->can_do('midgard:update') |
|
90 | + if (!$object1->can_do('midgard:update') |
|
91 | 91 | || !$object1->can_do('midgard:delete') |
92 | 92 | || !$object2->can_do('midgard:update') |
93 | 93 | || !$object2->can_do('midgard:delete')) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | // Extra sanity check (in case of semi-successful not-duplicate mark) |
99 | - if ( $object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
99 | + if ($object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
100 | 100 | || $object2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object1->guid)) { |
101 | 101 | debug_add("It seems these two (#{$object1->id} and #{$object2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN); |
102 | 102 | $i++; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if ($keep == 'both') { |
129 | 129 | $option1->require_do('midgard:update'); |
130 | 130 | $option2->require_do('midgard:update'); |
131 | - if ( $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
131 | + if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
132 | 132 | && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) { |
133 | 133 | // Clear the possible duplicate parameters |
134 | 134 | $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid); |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | } |
147 | 147 | } else { |
148 | 148 | if ($keep == $option1->guid) { |
149 | - $object1 =& $option1; |
|
150 | - $object2 =& $option2; |
|
149 | + $object1 = & $option1; |
|
150 | + $object2 = & $option2; |
|
151 | 151 | } elseif ($keep == $option2->guid) { |
152 | - $object1 =& $option2; |
|
153 | - $object2 =& $option1; |
|
152 | + $object1 = & $option2; |
|
153 | + $object2 = & $option1; |
|
154 | 154 | } else { |
155 | 155 | throw new midcom_error('Something weird happened (basically we got bogus data)'); |
156 | 156 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | if ($path === '') { |
66 | 66 | // Infinite loop, set an UI message and stop executing |
67 | - if ( !isset($schema['extends']['name']) |
|
67 | + if (!isset($schema['extends']['name']) |
|
68 | 68 | || $schema['extends']['name'] === $schema_name) { |
69 | 69 | throw new midcom_error('schema ' . $schema_name . ' extends itself'); |
70 | 70 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | private function _process_category_constraint(org_openpsa_qbpager $qb) |
77 | 77 | { |
78 | - if ( !in_array($this->category, $this->_request_data['categories']) |
|
78 | + if (!in_array($this->category, $this->_request_data['categories']) |
|
79 | 79 | && !$this->_config->get('categories_custom_enable')) { |
80 | 80 | throw new midcom_error('Custom categories are not allowed'); |
81 | 81 | // TODO: Check here if there are actually items in this cat? |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | midcom::get()->head->set_pagetitle($this->_request_data['page_title']); |
89 | 89 | |
90 | 90 | // Activate correct leaf |
91 | - if ( $this->_config->get('show_navigation_pseudo_leaves') |
|
91 | + if ($this->_config->get('show_navigation_pseudo_leaves') |
|
92 | 92 | && in_array($this->category, $this->_request_data['categories'])) { |
93 | 93 | $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->category); |
94 | 94 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | if ($handler_id == 'feed-category-rss2') { |
53 | 53 | // This is not a predefined category from configuration, check if site maintainer allows us to show it |
54 | - if ( !in_array($args[0], $data['categories']) |
|
54 | + if (!in_array($args[0], $data['categories']) |
|
55 | 55 | && !$this->_config->get('categories_custom_enable')) { |
56 | 56 | throw new midcom_error('Custom category support is disabled'); |
57 | 57 | } |