@@ -32,11 +32,11 @@ |
||
32 | 32 | $object = $dm->get_storage()->get_value(); |
33 | 33 | |
34 | 34 | $document = $indexer->new_document($dm); |
35 | - if ( $config->get('enable_scheduling') |
|
35 | + if ($config->get('enable_scheduling') |
|
36 | 36 | && is_a($object, org_openpsa_products_product_dba::class)) { |
37 | 37 | // Check start/end for products |
38 | - if ( $object->start > time() |
|
39 | - || ( $object->end != 0 |
|
38 | + if ($object->start > time() |
|
39 | + || ($object->end != 0 |
|
40 | 40 | && $object->end < time())) { |
41 | 41 | // Not in market, remove from index |
42 | 42 | $indexer->delete($document->RI); |
@@ -103,7 +103,8 @@ |
||
103 | 103 | try { |
104 | 104 | midcom_db_topic::get_cached($node_guid); |
105 | 105 | $available_generators[$component] = midcom::get()->i18n->get_string($component, $component); |
106 | - } catch (midcom_error $e) { |
|
106 | + } |
|
107 | + catch (midcom_error $e) { |
|
107 | 108 | debug_add("topic for component '{$component}' not found or accessible"); |
108 | 109 | } |
109 | 110 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | public function get_url(midcom_db_article $article, $allow_external = false) |
17 | 17 | { |
18 | - if ( $allow_external |
|
18 | + if ($allow_external |
|
19 | 19 | && $this->_config->get('link_to_external_url') |
20 | 20 | && !empty($article->url)) { |
21 | 21 | return $article->url; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $qb->add_constraint('topic.guid', 'IN', $topic_guids); |
49 | 49 | |
50 | - if ( count($topic_guids) > 1 |
|
50 | + if (count($topic_guids) > 1 |
|
51 | 51 | && $list_from_folders_categories = $this->_config->get('list_from_folders_categories')) { |
52 | 52 | $list_from_folders_categories = explode(',', $list_from_folders_categories); |
53 | 53 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | // Hide the articles that have the publish time in the future and if |
65 | 65 | // the user is not administrator |
66 | - if ( $this->_config->get('enable_scheduled_publishing') |
|
66 | + if ($this->_config->get('enable_scheduled_publishing') |
|
67 | 67 | && !midcom::get()->auth->admin) { |
68 | 68 | // Show the article only if the publishing time has passed or the viewer |
69 | 69 | // is the author |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $toolbar = new midcom_helper_toolbar(); |
19 | 19 | $buttons = []; |
20 | - if ( midcom::get()->auth->user |
|
20 | + if (midcom::get()->auth->user |
|
21 | 21 | && $comment->status < net_nehmer_comments_comment::MODERATED) { |
22 | 22 | if (!$comment->can_do('net.nehmer.comments:moderation')) { |
23 | 23 | // Regular users can only report abuse |
@@ -76,7 +76,8 @@ |
||
76 | 76 | } else { |
77 | 77 | try { |
78 | 78 | $this->initialize_index_article($topic); |
79 | - } catch (midcom_error $e) { |
|
79 | + } |
|
80 | + catch (midcom_error $e) { |
|
80 | 81 | // Could not create index |
81 | 82 | $topic->delete(); |
82 | 83 | throw $e; |
@@ -61,7 +61,8 @@ discard block |
||
61 | 61 | //check if related at_entry exists |
62 | 62 | try { |
63 | 63 | $notification_entry = new midcom_services_at_entry_dba($entry); |
64 | - } catch (midcom_error $e) { |
|
64 | + } |
|
65 | + catch (midcom_error $e) { |
|
65 | 66 | //relatedto links to a non-existing at_entry - so create a new one an link to it |
66 | 67 | $notification_entry = new midcom_services_at_entry_dba(); |
67 | 68 | $notification_entry->create(); |
@@ -83,7 +84,8 @@ discard block |
||
83 | 84 | $notification_entry = new midcom_services_at_entry_dba($mc_entry->get_subkey($key, 'fromGuid')); |
84 | 85 | //check if related at_entry exists & delete it |
85 | 86 | $notification_entry->delete(); |
86 | - } catch (midcom_error $e) { |
|
87 | + } |
|
88 | + catch (midcom_error $e) { |
|
87 | 89 | $e->log(); |
88 | 90 | } |
89 | 91 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $prefix = $nap->get_node($this->_topic->id)[MIDCOM_NAV_ABSOLUTEURL]; |
35 | 35 | |
36 | 36 | $tree = new org_openpsa_widgets_tree(org_openpsa_contacts_group_dba::class, 'owner'); |
37 | - $tree->link_callback = function ($guid) use ($prefix) { |
|
37 | + $tree->link_callback = function($guid) use ($prefix) { |
|
38 | 38 | return $prefix . 'group/' . $guid . '/'; |
39 | 39 | }; |
40 | 40 | $tree->constraints[] = ['orgOpenpsaObtype', '<', org_openpsa_contacts_group_dba::MYCONTACTS]; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | $my_company_guid = $this->_config->get('owner_organization'); |
54 | 54 | |
55 | - if ( empty($my_company_guid) |
|
55 | + if (empty($my_company_guid) |
|
56 | 56 | || !mgd_is_guid($my_company_guid)) { |
57 | 57 | if (midcom::get()->auth->admin) { |
58 | 58 | midcom::get()->uimessages->add( |
@@ -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 ' . $path . ':' . $schema_name . ' extends itself'); |
70 | 70 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $max = $this->_config->get('min_password_length'); |
306 | 306 | |
307 | 307 | if ($password_length < $max) { |
308 | - if ($show_ui_message){ |
|
308 | + if ($show_ui_message) { |
|
309 | 309 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password too short'), 'error'); |
310 | 310 | } |
311 | 311 | return false; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | } |
321 | 321 | |
322 | 322 | if ($score < $this->_config->get('min_password_score')) { |
323 | - if ($show_ui_message){ |
|
323 | + if ($show_ui_message) { |
|
324 | 324 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password weak'), 'error'); |
325 | 325 | } |
326 | 326 | return false; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $account = $this->get_account(); |
171 | 171 | if (!empty($new_password)) { |
172 | 172 | //check if the new encrypted password was already used |
173 | - if ( !$this->check_password_reuse($new_password, true) |
|
173 | + if (!$this->check_password_reuse($new_password, true) |
|
174 | 174 | || !$this->check_password_strength($new_password, true)) { |
175 | 175 | $this->errstr = "password strength too low"; |
176 | 176 | return false; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $max = $this->_config->get('min_password_length'); |
330 | 330 | |
331 | 331 | if ($password_length < $max) { |
332 | - if ($show_ui_message){ |
|
332 | + if ($show_ui_message) { |
|
333 | 333 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password too short'), 'error'); |
334 | 334 | } |
335 | 335 | return false; |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | if ($score < $this->_config->get('min_password_score')) { |
347 | - if ($show_ui_message){ |
|
347 | + if ($show_ui_message) { |
|
348 | 348 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password weak'), 'error'); |
349 | 349 | } |
350 | 350 | return false; |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | for ($i = 0; $i < strlen($password); $i++) { |
366 | 366 | $repeated = true; |
367 | 367 | for ($j = 0; $j < $plen && ($j + $i + $plen) < strlen($password); $j++) { |
368 | - if ( $password[$j + $i] == $password[$j + $i + $plen] |
|
368 | + if ($password[$j + $i] == $password[$j + $i + $plen] |
|
369 | 369 | && $repeated) { |
370 | 370 | $repeated = true; |
371 | 371 | } else { |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | |
504 | 504 | public static function get_person_by_formdata($data) |
505 | 505 | { |
506 | - if ( empty($data['username']) |
|
506 | + if (empty($data['username']) |
|
507 | 507 | || empty($data['password'])) { |
508 | 508 | return false; |
509 | 509 | } |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $max_attempts = midcom_baseclasses_components_configuration::get($component, 'config')->get('max_password_attempts'); |
536 | 536 | $timeframe = midcom_baseclasses_components_configuration::get($component, 'config')->get('password_block_timeframe_min'); |
537 | 537 | |
538 | - if ( $max_attempts == 0 |
|
538 | + if ($max_attempts == 0 |
|
539 | 539 | || $timeframe == 0) { |
540 | 540 | return $stat; |
541 | 541 | } |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | * If the maximum number of attempts is reached and the oldest attempt |
558 | 558 | * on the stack is within our defined timeframe, we block the account |
559 | 559 | */ |
560 | - if ( count($attempts) >= $max_attempts |
|
560 | + if (count($attempts) >= $max_attempts |
|
561 | 561 | && $attempts[$max_attempts - 1] >= (time() - ($timeframe * 60))) { |
562 | 562 | $this->disable_account(); |
563 | 563 | $stat = false; |