@@ -3,7 +3,7 @@ |
||
3 | 3 | $title = $this->data['midcom_services_auth_access_denied_title']; |
4 | 4 | $login_warning = $this->data['midcom_services_auth_access_denied_login_warning']; |
5 | 5 | |
6 | -midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.services.auth/style.css'); |
|
6 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
7 | 7 | ?> |
8 | 8 | <!DOCTYPE html> |
9 | 9 | <html lang="<?php echo midcom::get()->i18n->get_current_language(); ?>"> |
@@ -2,7 +2,7 @@ |
||
2 | 2 | $title = $this->data['midcom_services_auth_show_login_page_title']; |
3 | 3 | $login_warning = $this->data['midcom_services_auth_show_login_page_login_warning']; |
4 | 4 | |
5 | -midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.services.auth/style.css'); |
|
5 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
6 | 6 | ?> |
7 | 7 | <!DOCTYPE html> |
8 | 8 | <html lang="<?php echo midcom::get()->i18n->get_current_language(); ?>"> |
@@ -474,7 +474,7 @@ |
||
474 | 474 | { |
475 | 475 | return |
476 | 476 | ( |
477 | - $this->string_exists($string, $this->_language) |
|
477 | + $this->string_exists($string, $this->_language) |
|
478 | 478 | || $this->string_exists($string, $this->_fallback_language) |
479 | 479 | ); |
480 | 480 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | self::$_localedb[$this->_library] = []; |
150 | 150 | } |
151 | 151 | |
152 | - $this->_stringdb =& self::$_localedb[$this->_library]; |
|
152 | + $this->_stringdb = & self::$_localedb[$this->_library]; |
|
153 | 153 | |
154 | 154 | $this->set_language(midcom::get()->i18n->get_current_language()); |
155 | 155 | $this->set_charset(midcom::get()->i18n->get_current_charset()); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $data = $this->parse_data(file($filename), $lang, $filename); |
186 | 186 | |
187 | 187 | // get site-specific l10n |
188 | - $component_locale = midcom_helper_misc::get_snippet_content_graceful("conf:/" . $this->_component_name . '/l10n/'. $this->database . '.' . $lang . '.txt'); |
|
188 | + $component_locale = midcom_helper_misc::get_snippet_content_graceful("conf:/" . $this->_component_name . '/l10n/' . $this->database . '.' . $lang . '.txt'); |
|
189 | 189 | if (!empty($component_locale)) { |
190 | 190 | $data = array_merge($data, $this->parse_data(explode("\n", $component_locale), $lang, $component_locale)); |
191 | 191 | } |
@@ -58,7 +58,6 @@ |
||
58 | 58 | * @property string $revisor The person that modified the object, read-only. |
59 | 59 | * @property integer $approved The time of approval of the object, or 0 if not approved. Set automatically through approve/unapprove. |
60 | 60 | * @property string $approver The person that approved/unapproved the object. Set automatically through approve/unapprove. |
61 | - |
|
62 | 61 | * @package midcom.helper |
63 | 62 | */ |
64 | 63 | class midcom_helper_metadata |
@@ -658,7 +658,8 @@ |
||
658 | 658 | && mgd_is_guid($guid)) { |
659 | 659 | try { |
660 | 660 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
661 | - } catch (midcom_error $e) { |
|
661 | + } |
|
662 | + catch (midcom_error $e) { |
|
662 | 663 | debug_add("Failed to create a metadata instance for the GUID {$guid}: " . $e->getMessage(), MIDCOM_LOG_WARN); |
663 | 664 | debug_print_r("Source was:", $source); |
664 | 665 |
@@ -515,11 +515,11 @@ discard block |
||
515 | 515 | } |
516 | 516 | |
517 | 517 | $now = time(); |
518 | - if ( $this->get('schedulestart') |
|
518 | + if ($this->get('schedulestart') |
|
519 | 519 | && $this->get('schedulestart') > $now) { |
520 | 520 | return false; |
521 | 521 | } |
522 | - if ( $this->get('scheduleend') |
|
522 | + if ($this->get('scheduleend') |
|
523 | 523 | && $this->get('scheduleend') < $now) { |
524 | 524 | return false; |
525 | 525 | } |
@@ -537,9 +537,9 @@ discard block |
||
537 | 537 | public function is_object_visible_onsite() |
538 | 538 | { |
539 | 539 | return |
540 | - ( ( midcom::get()->config->get('show_hidden_objects') |
|
540 | + ((midcom::get()->config->get('show_hidden_objects') |
|
541 | 541 | || $this->is_visible()) |
542 | - && ( midcom::get()->config->get('show_unapproved_objects') |
|
542 | + && (midcom::get()->config->get('show_unapproved_objects') |
|
543 | 543 | || $this->is_approved()) |
544 | 544 | ); |
545 | 545 | } |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | $object = $source; |
627 | 627 | $guid = $source->guid; |
628 | 628 | } elseif (is_array($source)) { |
629 | - if ( !array_key_exists(MIDCOM_NAV_GUID, $source) |
|
629 | + if (!array_key_exists(MIDCOM_NAV_GUID, $source) |
|
630 | 630 | || is_null($source[MIDCOM_NAV_GUID])) { |
631 | 631 | debug_print_r('We got an invalid input, cannot return metadata:', $source); |
632 | 632 | return false; |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | $guid = $source; |
638 | 638 | } |
639 | 639 | |
640 | - if ( is_null($object) |
|
640 | + if (is_null($object) |
|
641 | 641 | && mgd_is_guid($guid)) { |
642 | 642 | try { |
643 | 643 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | } |
673 | 673 | |
674 | 674 | // Lock was created by the user, return "not locked" |
675 | - if ( !empty(midcom::get()->auth->user->guid) |
|
675 | + if (!empty(midcom::get()->auth->user->guid) |
|
676 | 676 | && $this->get('locker') === midcom::get()->auth->user->guid) { |
677 | 677 | return false; |
678 | 678 | } |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | { |
691 | 691 | midcom::get()->auth->require_do('midgard:update', $this->__object); |
692 | 692 | |
693 | - if ( is_object($this->__object) |
|
693 | + if (is_object($this->__object) |
|
694 | 694 | && $this->__object->lock()) { |
695 | 695 | $this->_cache = []; |
696 | 696 | return true; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | */ |
708 | 708 | public function can_unlock() |
709 | 709 | { |
710 | - return ( $this->__object->can_do('midcom:unlock') |
|
710 | + return ($this->__object->can_do('midcom:unlock') |
|
711 | 711 | || midcom::get()->auth->can_user_do('midcom:unlock', null, 'midcom_services_auth', 'midcom')); |
712 | 712 | } |
713 | 713 | |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | */ |
719 | 719 | public function unlock() |
720 | 720 | { |
721 | - if ( $this->can_unlock() |
|
721 | + if ($this->can_unlock() |
|
722 | 722 | && is_object($this->__object) |
723 | 723 | && $this->__object->unlock()) { |
724 | 724 | $this->_cache = []; |
@@ -407,7 +407,7 @@ |
||
407 | 407 | |
408 | 408 | $parent = $parent->get_parent_group(); |
409 | 409 | } |
410 | - */ |
|
410 | + */ |
|
411 | 411 | $this->_inheritance_chains[$id] = $inheritance_chain; |
412 | 412 | } |
413 | 413 | } |
@@ -180,7 +180,8 @@ discard block |
||
180 | 180 | } |
181 | 181 | try { |
182 | 182 | $this->_storage = new $person_class($id); |
183 | - } catch (midgard_error_exception $e) { |
|
183 | + } |
|
184 | + catch (midgard_error_exception $e) { |
|
184 | 185 | debug_add("Failed to retrieve the person ID {$id}: " . $e->getMessage(), MIDCOM_LOG_INFO); |
185 | 186 | throw new midcom_error_midgard($e, $id); |
186 | 187 | } |
@@ -228,7 +229,8 @@ discard block |
||
228 | 229 | if (mgd_is_guid($id)) { |
229 | 230 | try { |
230 | 231 | return new $person_class($id); |
231 | - } catch (midgard_error_exception $e) { |
|
232 | + } |
|
233 | + catch (midgard_error_exception $e) { |
|
232 | 234 | debug_add("Failed to retrieve the person GUID {$id}: " . $e->getMessage(), MIDCOM_LOG_INFO); |
233 | 235 | throw new midcom_error_midgard($e, $id); |
234 | 236 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | private function _load_from_string($id, $person_class) |
214 | 214 | { |
215 | 215 | // Don't even try with the magic assignees |
216 | - if ( 'ANONYMOUS' === $id |
|
216 | + if ('ANONYMOUS' === $id |
|
217 | 217 | || 'EVERYONE' === $id |
218 | 218 | || 'USERS' === $id |
219 | 219 | || 'OWNER' === $id |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $this->_inheritance_chains = []; |
361 | 361 | |
362 | 362 | foreach ($this->_direct_groups as $id => $group) { |
363 | - $this->_all_groups[$id] =& $this->_direct_groups[$id]; |
|
363 | + $this->_all_groups[$id] = & $this->_direct_groups[$id]; |
|
364 | 364 | $inheritance_chain = [$group->id]; |
365 | 365 | /** |
366 | 366 | * FIXME: Parent group members should inherit permissions from |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | } |
490 | 490 | // We scan through our groups looking for a midgard group with the right name |
491 | 491 | foreach ($this->_all_groups as $group_object) { |
492 | - if ( midcom::get()->dbfactory->is_a($group_object, 'midcom_core_group') |
|
492 | + if (midcom::get()->dbfactory->is_a($group_object, 'midcom_core_group') |
|
493 | 493 | && $group_object->get_storage()->name == $group) { |
494 | 494 | return true; |
495 | 495 | } |
@@ -42,5 +42,5 @@ |
||
42 | 42 | return $document; |
43 | 43 | } |
44 | 44 | |
45 | - abstract public function prepare_document(midcom_services_indexer_document &$document, datamanager $dm); |
|
45 | + abstract public function prepare_document(midcom_services_indexer_document & $document, datamanager $dm); |
|
46 | 46 | } |
@@ -166,7 +166,7 @@ |
||
166 | 166 | } |
167 | 167 | } |
168 | 168 | // Only display the requested user as participant |
169 | - $event->participants[$data['person']->id] = true; |
|
169 | + $event->participants[$data['person']->id] = true; |
|
170 | 170 | // Always force busy in this view |
171 | 171 | $event->busy = true; |
172 | 172 | $encoder->add_event($event); |
@@ -183,17 +183,17 @@ |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
186 | - * Inserts a link detector to the given HTML source. All outgoing |
|
187 | - * HTTP links in the source HTML are replaced with the given |
|
188 | - * link detector address so that the token "URL" is replaced with |
|
189 | - * encoded form of the original link. It is expected that the link detector |
|
190 | - * address points to a script that records the passed link and |
|
191 | - * forwards the client to the real link target. |
|
192 | - * |
|
193 | - * @param string $html the HTML source |
|
194 | - * @param string $address the link detector address |
|
195 | - * @return HTML source with the link detector |
|
196 | - */ |
|
186 | + * Inserts a link detector to the given HTML source. All outgoing |
|
187 | + * HTTP links in the source HTML are replaced with the given |
|
188 | + * link detector address so that the token "URL" is replaced with |
|
189 | + * encoded form of the original link. It is expected that the link detector |
|
190 | + * address points to a script that records the passed link and |
|
191 | + * forwards the client to the real link target. |
|
192 | + * |
|
193 | + * @param string $html the HTML source |
|
194 | + * @param string $address the link detector address |
|
195 | + * @return HTML source with the link detector |
|
196 | + */ |
|
197 | 197 | private function _insert_link_detector($html, $address) |
198 | 198 | { |
199 | 199 | $address = addslashes($address); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | //Check for bounce detector usage |
35 | 35 | if (!empty($config['bounce_detector_address'])) { |
36 | 36 | //Force bouncer as backend if default specified |
37 | - if ( empty($config['mail_send_backend']) |
|
37 | + if (empty($config['mail_send_backend']) |
|
38 | 38 | || $config['mail_send_backend'] == 'try_default') { |
39 | 39 | $config['mail_send_backend'] = 'bouncer'; |
40 | 40 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | //Set some List-xxx headers to avoid auto-replies and in general to be a good netizen |
93 | 93 | $mail->headers['List-Id'] = "<{$this->_message->guid}@{$_SERVER['SERVER_NAME']}>"; |
94 | - $mail->headers['List-Unsubscribe'] = '<' . $member->get_unsubscribe_url() . '>'; |
|
94 | + $mail->headers['List-Unsubscribe'] = '<' . $member->get_unsubscribe_url() . '>'; |
|
95 | 95 | |
96 | 96 | debug_add('mail->from: ' . $mail->from . ', mail->to: ' . $mail->to . ', mail->subject: ' . $mail->subject); |
97 | 97 | switch ($this->_message->orgOpenpsaObtype) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $address = addslashes($address); |
180 | 180 | return preg_replace_callback( |
181 | 181 | '/href="(http:\/\/.*?)"/i', |
182 | - function ($match) use ($address) { |
|
182 | + function($match) use ($address) { |
|
183 | 183 | return 'href="' . str_replace("URL", rawurlencode($match[1]), $address) . '"'; |
184 | 184 | }, |
185 | 185 | $html); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -midcom::get()->head->add_stylesheet( MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
2 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
3 | 3 | $title = 'About Midgard'; |
4 | 4 | midcom::get()->auth->require_valid_user(); |
5 | 5 | ?> |