@@ -71,8 +71,12 @@ |
||
71 | 71 | //if ($user->socid > 0) $socid = $user->socid; |
72 | 72 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
73 | 73 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
74 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
75 | -if (!$permissiontoread) accessforbidden(); |
|
74 | +if (empty($conf->bookcal->enabled)) { |
|
75 | + accessforbidden(); |
|
76 | +} |
|
77 | +if (!$permissiontoread) { |
|
78 | + accessforbidden(); |
|
79 | +} |
|
76 | 80 | |
77 | 81 | |
78 | 82 | /* |
@@ -99,8 +99,12 @@ |
||
99 | 99 | //if ($user->socid > 0) $socid = $user->socid; |
100 | 100 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
101 | 101 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
102 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
103 | -if (!$permissiontoread) accessforbidden(); |
|
102 | +if (empty($conf->bookcal->enabled)) { |
|
103 | + accessforbidden(); |
|
104 | +} |
|
105 | +if (!$permissiontoread) { |
|
106 | + accessforbidden(); |
|
107 | +} |
|
104 | 108 | |
105 | 109 | |
106 | 110 | /* |
@@ -66,8 +66,12 @@ |
||
66 | 66 | //if ($user->socid > 0) $socid = $user->socid; |
67 | 67 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
68 | 68 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
69 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
70 | -if (!$permissiontoread) accessforbidden(); |
|
69 | +if (empty($conf->bookcal->enabled)) { |
|
70 | + accessforbidden(); |
|
71 | +} |
|
72 | +if (!$permissiontoread) { |
|
73 | + accessforbidden(); |
|
74 | +} |
|
71 | 75 | |
72 | 76 | |
73 | 77 | /* |
@@ -143,13 +143,19 @@ |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | // Security check (enable the most restrictive one) |
146 | -if ($user->socid > 0) accessforbidden(); |
|
146 | +if ($user->socid > 0) { |
|
147 | + accessforbidden(); |
|
148 | +} |
|
147 | 149 | //if ($user->socid > 0) accessforbidden(); |
148 | 150 | //$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
149 | 151 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
150 | 152 | //restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
151 | -if (empty($conf->bookcal->enabled)) accessforbidden('Module not enabled'); |
|
152 | -if (!$permissiontoread) accessforbidden(); |
|
153 | +if (empty($conf->bookcal->enabled)) { |
|
154 | + accessforbidden('Module not enabled'); |
|
155 | +} |
|
156 | +if (!$permissiontoread) { |
|
157 | + accessforbidden(); |
|
158 | +} |
|
153 | 159 | |
154 | 160 | |
155 | 161 | /* |
@@ -71,8 +71,12 @@ |
||
71 | 71 | //if ($user->socid > 0) $socid = $user->socid; |
72 | 72 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
73 | 73 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
74 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
75 | -if (!$permissiontoread) accessforbidden(); |
|
74 | +if (empty($conf->bookcal->enabled)) { |
|
75 | + accessforbidden(); |
|
76 | +} |
|
77 | +if (!$permissiontoread) { |
|
78 | + accessforbidden(); |
|
79 | +} |
|
76 | 80 | |
77 | 81 | |
78 | 82 | /* |
@@ -91,8 +91,12 @@ |
||
91 | 91 | //if ($user->socid > 0) $socid = $user->socid; |
92 | 92 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
93 | 93 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
94 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
95 | -if (!$permissiontoread) accessforbidden(); |
|
94 | +if (empty($conf->bookcal->enabled)) { |
|
95 | + accessforbidden(); |
|
96 | +} |
|
97 | +if (!$permissiontoread) { |
|
98 | + accessforbidden(); |
|
99 | +} |
|
96 | 100 | |
97 | 101 | |
98 | 102 | /* |
@@ -98,8 +98,12 @@ discard block |
||
98 | 98 | //if ($user->socid > 0) $socid = $user->socid; |
99 | 99 | //$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
100 | 100 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
101 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
102 | -if (!$permissiontoread) accessforbidden(); |
|
101 | +if (empty($conf->bookcal->enabled)) { |
|
102 | + accessforbidden(); |
|
103 | +} |
|
104 | +if (!$permissiontoread) { |
|
105 | + accessforbidden(); |
|
106 | +} |
|
103 | 107 | |
104 | 108 | |
105 | 109 | /* |
@@ -435,9 +439,12 @@ discard block |
||
435 | 439 | |
436 | 440 | $parameters = array(); |
437 | 441 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
438 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
439 | - if (empty($reshook)) |
|
440 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
442 | + if ($reshook < 0) { |
|
443 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
444 | + } |
|
445 | + if (empty($reshook)) { |
|
446 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
447 | + } |
|
441 | 448 | } |
442 | 449 | } |
443 | 450 |
@@ -98,8 +98,12 @@ discard block |
||
98 | 98 | //if ($user->socid > 0) $socid = $user->socid; |
99 | 99 | //$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
100 | 100 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
101 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
102 | -if (!$permissiontoread) accessforbidden(); |
|
101 | +if (empty($conf->bookcal->enabled)) { |
|
102 | + accessforbidden(); |
|
103 | +} |
|
104 | +if (!$permissiontoread) { |
|
105 | + accessforbidden(); |
|
106 | +} |
|
103 | 107 | |
104 | 108 | |
105 | 109 | /* |
@@ -439,9 +443,12 @@ discard block |
||
439 | 443 | |
440 | 444 | $parameters = array(); |
441 | 445 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
442 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
443 | - if (empty($reshook)) |
|
444 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
446 | + if ($reshook < 0) { |
|
447 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
448 | + } |
|
449 | + if (empty($reshook)) { |
|
450 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
451 | + } |
|
445 | 452 | } |
446 | 453 | } |
447 | 454 |
@@ -91,8 +91,12 @@ |
||
91 | 91 | //if ($user->socid > 0) $socid = $user->socid; |
92 | 92 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
93 | 93 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
94 | -if (empty($conf->bookcal->enabled)) accessforbidden(); |
|
95 | -if (!$permissiontoread) accessforbidden(); |
|
94 | +if (empty($conf->bookcal->enabled)) { |
|
95 | + accessforbidden(); |
|
96 | +} |
|
97 | +if (!$permissiontoread) { |
|
98 | + accessforbidden(); |
|
99 | +} |
|
96 | 100 | |
97 | 101 | |
98 | 102 | /* |