@@ -1045,7 +1045,9 @@ discard block |
||
| 1045 | 1045 | $session->get('user-id') |
| 1046 | 1046 | ); |
| 1047 | 1047 | if (DB::count() === 0) { |
| 1048 | - if (LOG_TO_SERVER === true) error_log('TEAMPASS | user '.$session->get('user-id').' has no sharekey for item '.$inputData['itemId']); |
|
| 1048 | + if (LOG_TO_SERVER === true) { |
|
| 1049 | + error_log('TEAMPASS | user '.$session->get('user-id').' has no sharekey for item '.$inputData['itemId']); |
|
| 1050 | + } |
|
| 1049 | 1051 | echo (string) prepareExchangedData( |
| 1050 | 1052 | array( |
| 1051 | 1053 | 'error' => true, |
@@ -1164,7 +1166,9 @@ discard block |
||
| 1164 | 1166 | ); |
| 1165 | 1167 | |
| 1166 | 1168 | // Create a task to create sharekeys for users |
| 1167 | - if (WIP=== true) error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw); |
|
| 1169 | + if (WIP=== true) { |
|
| 1170 | + error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw); |
|
| 1171 | + } |
|
| 1168 | 1172 | $tasksToBePerformed = ['item_password']; |
| 1169 | 1173 | /*createTaskForItem( |
| 1170 | 1174 | 'item_update_create_keys', |
@@ -1489,7 +1493,9 @@ discard block |
||
| 1489 | 1493 | |
| 1490 | 1494 | // create a task for all fields updated |
| 1491 | 1495 | if ($encryptionTaskIsRequested === true) { |
| 1492 | - if (WIP === true) error_log('createTaskForItem - '.print_r($tasksToBePerformed, true)); |
|
| 1496 | + if (WIP === true) { |
|
| 1497 | + error_log('createTaskForItem - '.print_r($tasksToBePerformed, true)); |
|
| 1498 | + } |
|
| 1493 | 1499 | createTaskForItem( |
| 1494 | 1500 | 'item_update_create_keys', |
| 1495 | 1501 | $tasksToBePerformed, |
@@ -1996,7 +2002,9 @@ discard block |
||
| 1996 | 2002 | $inputData['itemId'] |
| 1997 | 2003 | ); |
| 1998 | 2004 | foreach ($rows as $record) { |
| 1999 | - if ($record['raison'] === NULL) continue; |
|
| 2005 | + if ($record['raison'] === NULL) { |
|
| 2006 | + continue; |
|
| 2007 | + } |
|
| 2000 | 2008 | $reason = explode(':', $record['raison']); |
| 2001 | 2009 | if (count($reason) > 0) { |
| 2002 | 2010 | $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' |
@@ -4586,7 +4594,9 @@ discard block |
||
| 4586 | 4594 | $inputData['itemId'] |
| 4587 | 4595 | ); |
| 4588 | 4596 | |
| 4589 | - if (WIP === true) error_log('Existing edition locks: '.DB::count()); |
|
| 4597 | + if (WIP === true) { |
|
| 4598 | + error_log('Existing edition locks: '.DB::count()); |
|
| 4599 | + } |
|
| 4590 | 4600 | |
| 4591 | 4601 | // Check if item has no edition lock |
| 4592 | 4602 | if ((int) DB::count() > 0 ) { |
@@ -4599,7 +4609,9 @@ discard block |
||
| 4599 | 4609 | } else { |
| 4600 | 4610 | $delay = EDITION_LOCK_PERIOD; // One day delay |
| 4601 | 4611 | } |
| 4602 | - if (WIP === true) error_log('delay: ' . $delay); |
|
| 4612 | + if (WIP === true) { |
|
| 4613 | + error_log('delay: ' . $delay); |
|
| 4614 | + } |
|
| 4603 | 4615 | |
| 4604 | 4616 | // We remove old edition locks if delay is expired meaning more than 1 day long |
| 4605 | 4617 | if (round(abs(time() - $dataTmp['timestamp']),0) > $delay) { |
@@ -4607,7 +4619,9 @@ discard block |
||
| 4607 | 4619 | // In this case, delete edition lock and possible ongoing processes |
| 4608 | 4620 | // and continue editing this time |
| 4609 | 4621 | // We coonsidere if the most recent item is still locked then all other locks can be removed |
| 4610 | - if (WIP === true) error_log('Delay is expired, removing old locks'); |
|
| 4622 | + if (WIP === true) { |
|
| 4623 | + error_log('Delay is expired, removing old locks'); |
|
| 4624 | + } |
|
| 4611 | 4625 | foreach ($dataItemEditionLocks as $itemEditionLock) { |
| 4612 | 4626 | // delete lock |
| 4613 | 4627 | DB::delete( |