@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ) { |
| 80 | 80 | // Not allowed page |
| 81 | 81 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 82 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 82 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 83 | 83 | exit; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | date_default_timezone_set('UTC'); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php'; |
|
| 107 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php'; |
|
| 108 | 108 | header('Content-type: text/html; charset=utf-8'); |
| 109 | 109 | header('Cache-Control: no-cache, must-revalidate'); |
| 110 | 110 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | // About special settings |
| 366 | 366 | $dataFolderSettings = DB::queryFirstRow( |
| 367 | 367 | 'SELECT bloquer_creation, bloquer_modification, personal_folder |
| 368 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 368 | + FROM ' . prefixTable('nested_tree').' |
|
| 369 | 369 | WHERE id = %i', |
| 370 | 370 | $inputData['folderId'] |
| 371 | 371 | ); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | // Get folder complexity |
| 383 | 383 | $folderComplexity = DB::queryFirstRow( |
| 384 | 384 | 'SELECT valeur |
| 385 | - FROM ' . prefixTable('misc') . ' |
|
| 385 | + FROM ' . prefixTable('misc').' |
|
| 386 | 386 | WHERE type = %s AND intitule = %i', |
| 387 | 387 | 'complex', |
| 388 | 388 | $inputData['folderId'] |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | $itemExists = 0; |
| 408 | 408 | $newID = ''; |
| 409 | 409 | $data = DB::queryFirstRow( |
| 410 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 410 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 411 | 411 | WHERE label = %s AND inactif = %i', |
| 412 | 412 | $inputData['label'], |
| 413 | 413 | 0 |
@@ -488,8 +488,8 @@ discard block |
||
| 488 | 488 | (int) $post_folder_is_personal, |
| 489 | 489 | (int) $newID, |
| 490 | 490 | $cryptedStuff['objectKey'], |
| 491 | - true, // only for the item creator |
|
| 492 | - false, // no delete all |
|
| 491 | + true, // only for the item creator |
|
| 492 | + false, // no delete all |
|
| 493 | 493 | ); |
| 494 | 494 | |
| 495 | 495 | // update fields |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | // should we encrypt the data |
| 503 | 503 | $dataTmp = DB::queryFirstRow( |
| 504 | 504 | 'SELECT encrypted_data |
| 505 | - FROM ' . prefixTable('categories') . ' |
|
| 505 | + FROM ' . prefixTable('categories').' |
|
| 506 | 506 | WHERE id = %i', |
| 507 | 507 | $field['id'] |
| 508 | 508 | ); |
@@ -531,8 +531,8 @@ discard block |
||
| 531 | 531 | (int) $post_folder_is_personal, |
| 532 | 532 | (int) $newObjectId, |
| 533 | 533 | $cryptedStuff['objectKey'], |
| 534 | - true, // only for the item creator |
|
| 535 | - false, // no delete all |
|
| 534 | + true, // only for the item creator |
|
| 535 | + false, // no delete all |
|
| 536 | 536 | ); |
| 537 | 537 | |
| 538 | 538 | array_push( |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | ) { |
| 569 | 569 | DB::queryFirstRow( |
| 570 | 570 | 'SELECT * |
| 571 | - FROM ' . prefixTable('templates') . ' |
|
| 571 | + FROM ' . prefixTable('templates').' |
|
| 572 | 572 | WHERE item_id = %i', |
| 573 | 573 | $newID |
| 574 | 574 | ); |
@@ -637,11 +637,11 @@ discard block |
||
| 637 | 637 | ) { |
| 638 | 638 | foreach ($post_restricted_to as $userRest) { |
| 639 | 639 | if (empty($userRest) === false) { |
| 640 | - $dataTmp = DB::queryFirstRow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= %i', $userRest); |
|
| 640 | + $dataTmp = DB::queryFirstRow('SELECT login FROM '.prefixTable('users').' WHERE id= %i', $userRest); |
|
| 641 | 641 | if (empty($listOfRestricted)) { |
| 642 | 642 | $listOfRestricted = $dataTmp['login']; |
| 643 | 643 | } else { |
| 644 | - $listOfRestricted .= ';' . $dataTmp['login']; |
|
| 644 | + $listOfRestricted .= ';'.$dataTmp['login']; |
|
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | 647 | } |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | if (empty($userRest) === false) { |
| 658 | 658 | $dataTmp = DB::queryFirstRow( |
| 659 | 659 | 'SELECT login |
| 660 | - FROM ' . prefixTable('users') . ' |
|
| 660 | + FROM ' . prefixTable('users').' |
|
| 661 | 661 | WHERE id= %i', |
| 662 | 662 | $userRest |
| 663 | 663 | ); |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | if (empty($oldRestrictionList) === true) { |
| 666 | 666 | $oldRestrictionList = $dataTmp['login']; |
| 667 | 667 | } else { |
| 668 | - $oldRestrictionList .= ';' . $dataTmp['login']; |
|
| 668 | + $oldRestrictionList .= ';'.$dataTmp['login']; |
|
| 669 | 669 | } |
| 670 | 670 | } |
| 671 | 671 | } |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | if (empty($post_uploaded_file_id) === false) { |
| 729 | 729 | $rows = DB::query( |
| 730 | 730 | 'SELECT id |
| 731 | - FROM ' . prefixTable('files') . ' |
|
| 731 | + FROM ' . prefixTable('files').' |
|
| 732 | 732 | WHERE id_item = %s', |
| 733 | 733 | $post_uploaded_file_id |
| 734 | 734 | ); |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | $lang->get('email_subject_item_updated'), |
| 785 | 785 | str_replace( |
| 786 | 786 | array('#label', '#link'), |
| 787 | - array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $inputData['folderId'] . '&id=' . $newID . $lang['email_body3']), |
|
| 787 | + array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$inputData['folderId'].'&id='.$newID.$lang['email_body3']), |
|
| 788 | 788 | $lang->get('new_item_email_body') |
| 789 | 789 | ), |
| 790 | 790 | $emailAddress, |
@@ -888,11 +888,11 @@ discard block |
||
| 888 | 888 | // Prepare variables |
| 889 | 889 | $itemInfos = array(); |
| 890 | 890 | $inputData['label'] = isset($dataReceived['label']) && is_string($dataReceived['label']) ? filter_var($dataReceived['label'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) : ''; |
| 891 | - $post_url = isset($dataReceived['url'])=== true ? filter_var(htmlspecialchars_decode($dataReceived['url']), FILTER_SANITIZE_URL) : ''; |
|
| 891 | + $post_url = isset($dataReceived['url']) === true ? filter_var(htmlspecialchars_decode($dataReceived['url']), FILTER_SANITIZE_URL) : ''; |
|
| 892 | 892 | $post_password = $original_pw = isset($dataReceived['pw']) && is_string($dataReceived['pw']) ? htmlspecialchars_decode($dataReceived['pw']) : ''; |
| 893 | 893 | $post_login = isset($dataReceived['login']) && is_string($dataReceived['login']) ? filter_var(htmlspecialchars_decode($dataReceived['login']), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : ''; |
| 894 | - $post_tags = isset($dataReceived['tags'])=== true ? htmlspecialchars($dataReceived['tags']) : ''; |
|
| 895 | - $post_email = isset($dataReceived['email'])=== true ? filter_var(htmlspecialchars_decode($dataReceived['email']), FILTER_SANITIZE_EMAIL) : ''; |
|
| 894 | + $post_tags = isset($dataReceived['tags']) === true ? htmlspecialchars($dataReceived['tags']) : ''; |
|
| 895 | + $post_email = isset($dataReceived['email']) === true ? filter_var(htmlspecialchars_decode($dataReceived['email']), FILTER_SANITIZE_EMAIL) : ''; |
|
| 896 | 896 | $post_template_id = (int) filter_var($dataReceived['template_id'], FILTER_SANITIZE_NUMBER_INT); |
| 897 | 897 | $inputData['itemId'] = (int) filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT); |
| 898 | 898 | $post_anyone_can_modify = (int) filter_var($dataReceived['anyone_can_modify'], FILTER_SANITIZE_NUMBER_INT); |
@@ -923,8 +923,7 @@ discard block |
||
| 923 | 923 | $post_to_be_deleted_after_date = isset($dataReceived['to_be_deleted_after_date']) === true ? filter_var( |
| 924 | 924 | $dataReceived['to_be_deleted_after_date'], |
| 925 | 925 | FILTER_SANITIZE_FULL_SPECIAL_CHARS |
| 926 | - ) : |
|
| 927 | - ''; |
|
| 926 | + ) : ''; |
|
| 928 | 927 | $post_fields = (filter_var_array( |
| 929 | 928 | $dataReceived['fields'], |
| 930 | 929 | FILTER_SANITIZE_FULL_SPECIAL_CHARS |
@@ -984,7 +983,7 @@ discard block |
||
| 984 | 983 | // About special settings |
| 985 | 984 | $dataFolderSettings = DB::queryFirstRow( |
| 986 | 985 | 'SELECT bloquer_creation, bloquer_modification, personal_folder, title |
| 987 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 986 | + FROM ' . prefixTable('nested_tree').' |
|
| 988 | 987 | WHERE id = %i', |
| 989 | 988 | $inputData['folderId'] |
| 990 | 989 | ); |
@@ -1000,7 +999,7 @@ discard block |
||
| 1000 | 999 | // Get folder complexity |
| 1001 | 1000 | $folderComplexity = DB::queryFirstRow( |
| 1002 | 1001 | 'SELECT valeur |
| 1003 | - FROM ' . prefixTable('misc') . ' |
|
| 1002 | + FROM ' . prefixTable('misc').' |
|
| 1004 | 1003 | WHERE type = %s AND intitule = %i', |
| 1005 | 1004 | 'complex', |
| 1006 | 1005 | $inputData['folderId'] |
@@ -1045,8 +1044,8 @@ discard block |
||
| 1045 | 1044 | // Get all informations for this item |
| 1046 | 1045 | $dataItem = DB::queryFirstRow( |
| 1047 | 1046 | 'SELECT * |
| 1048 | - FROM ' . prefixTable('items') . ' as i |
|
| 1049 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 1047 | + FROM ' . prefixTable('items').' as i |
|
| 1048 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 1050 | 1049 | WHERE i.id=%i AND l.action = %s', |
| 1051 | 1050 | $inputData['itemId'], |
| 1052 | 1051 | 'at_creation' |
@@ -1095,7 +1094,7 @@ discard block |
||
| 1095 | 1094 | //db::debugmode(true); |
| 1096 | 1095 | DB::query( |
| 1097 | 1096 | 'SELECT * |
| 1098 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1097 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1099 | 1098 | WHERE object_id = %i AND user_id = %s', |
| 1100 | 1099 | $inputData['itemId'], |
| 1101 | 1100 | $session->get('user-id') |
@@ -1155,9 +1154,9 @@ discard block |
||
| 1155 | 1154 | 'SELECT i.id as id, i.label as label, i.description as description, i.pw as pw, i.url as url, i.id_tree as id_tree, i.perso as perso, i.login as login, |
| 1156 | 1155 | i.inactif as inactif, i.restricted_to as restricted_to, i.anyone_can_modify as anyone_can_modify, i.email as email, i.notification as notification, |
| 1157 | 1156 | u.login as user_login, u.email as user_email |
| 1158 | - FROM ' . prefixTable('items') . ' as i |
|
| 1159 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item) |
|
| 1160 | - INNER JOIN ' . prefixTable('users') . ' as u ON (u.id=l.id_user) |
|
| 1157 | + FROM ' . prefixTable('items').' as i |
|
| 1158 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item) |
|
| 1159 | + INNER JOIN ' . prefixTable('users').' as u ON (u.id=l.id_user) |
|
| 1161 | 1160 | WHERE i.id=%i', |
| 1162 | 1161 | $inputData['itemId'] |
| 1163 | 1162 | ); |
@@ -1165,7 +1164,7 @@ discard block |
||
| 1165 | 1164 | // Should we log a password change? |
| 1166 | 1165 | $userKey = DB::queryFirstRow( |
| 1167 | 1166 | 'SELECT share_key |
| 1168 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1167 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1169 | 1168 | WHERE user_id = %i AND object_id = %i', |
| 1170 | 1169 | $session->get('user-id'), |
| 1171 | 1170 | $inputData['itemId'] |
@@ -1229,12 +1228,12 @@ discard block |
||
| 1229 | 1228 | (int) $post_folder_is_personal, |
| 1230 | 1229 | (int) $inputData['itemId'], |
| 1231 | 1230 | $encrypted_password_key, |
| 1232 | - true, // only for the item creator |
|
| 1233 | - true, // delete all |
|
| 1231 | + true, // only for the item creator |
|
| 1232 | + true, // delete all |
|
| 1234 | 1233 | ); |
| 1235 | 1234 | |
| 1236 | 1235 | // Create a task to create sharekeys for users |
| 1237 | - if (WIP=== true) error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw); |
|
| 1236 | + if (WIP === true) error_log('createTaskForItem - new password for this item - '.$post_password." -- ".$pw); |
|
| 1238 | 1237 | $tasksToBePerformed = ['item_password']; |
| 1239 | 1238 | $encryptionTaskIsRequested = true; |
| 1240 | 1239 | } else { |
@@ -1245,7 +1244,7 @@ discard block |
||
| 1245 | 1244 | // Get list of tags |
| 1246 | 1245 | $itemTags = DB::queryFirstColumn( |
| 1247 | 1246 | 'SELECT tag |
| 1248 | - FROM ' . prefixTable('tags') . ' |
|
| 1247 | + FROM ' . prefixTable('tags').' |
|
| 1249 | 1248 | WHERE item_id = %i', |
| 1250 | 1249 | $inputData['itemId'] |
| 1251 | 1250 | ); |
@@ -1291,7 +1290,7 @@ discard block |
||
| 1291 | 1290 | $session->get('user-id'), |
| 1292 | 1291 | 'at_modification', |
| 1293 | 1292 | $session->get('user-login'), |
| 1294 | - 'at_tag : ' . implode(' ', $itemTags) . ' => ' . $post_tags |
|
| 1293 | + 'at_tag : '.implode(' ', $itemTags).' => '.$post_tags |
|
| 1295 | 1294 | ); |
| 1296 | 1295 | } |
| 1297 | 1296 | |
@@ -1331,8 +1330,8 @@ discard block |
||
| 1331 | 1330 | 'SELECT c.id AS id, c.title AS title, i.data AS data, i.data_iv AS data_iv, |
| 1332 | 1331 | i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data, |
| 1333 | 1332 | c.masked AS masked, i.id AS field_item_id |
| 1334 | - FROM ' . prefixTable('categories_items') . ' AS i |
|
| 1335 | - INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id) |
|
| 1333 | + FROM ' . prefixTable('categories_items').' AS i |
|
| 1334 | + INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id) |
|
| 1336 | 1335 | WHERE i.field_id = %i AND i.item_id = %i', |
| 1337 | 1336 | $field['id'], |
| 1338 | 1337 | $inputData['itemId'] |
@@ -1348,7 +1347,7 @@ discard block |
||
| 1348 | 1347 | // Perform new query |
| 1349 | 1348 | $dataTmpCat = DB::queryFirstRow( |
| 1350 | 1349 | 'SELECT id, title, encrypted_data, masked |
| 1351 | - FROM ' . prefixTable('categories') . ' |
|
| 1350 | + FROM ' . prefixTable('categories').' |
|
| 1352 | 1351 | WHERE id = %i', |
| 1353 | 1352 | $field['id'] |
| 1354 | 1353 | ); |
@@ -1378,8 +1377,8 @@ discard block |
||
| 1378 | 1377 | (int) $post_folder_is_personal, |
| 1379 | 1378 | (int) $newId, |
| 1380 | 1379 | $cryptedStuff['objectKey'], |
| 1381 | - true, // only for the item creator |
|
| 1382 | - true, // delete all |
|
| 1380 | + true, // only for the item creator |
|
| 1381 | + true, // delete all |
|
| 1383 | 1382 | ); |
| 1384 | 1383 | |
| 1385 | 1384 | // update value |
@@ -1429,7 +1428,7 @@ discard block |
||
| 1429 | 1428 | $session->get('user-id'), |
| 1430 | 1429 | 'at_modification', |
| 1431 | 1430 | $session->get('user-login'), |
| 1432 | - 'at_field : ' . $dataTmpCat['title'] . ' : ' . $field['value'] |
|
| 1431 | + 'at_field : '.$dataTmpCat['title'].' : '.$field['value'] |
|
| 1433 | 1432 | ); |
| 1434 | 1433 | } else { |
| 1435 | 1434 | // Case where the field already exists |
@@ -1438,7 +1437,7 @@ discard block |
||
| 1438 | 1437 | // Get user sharekey for this field |
| 1439 | 1438 | $userKey = DB::queryFirstRow( |
| 1440 | 1439 | 'SELECT share_key |
| 1441 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 1440 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 1442 | 1441 | WHERE user_id = %i AND object_id = %i', |
| 1443 | 1442 | $session->get('user-id'), |
| 1444 | 1443 | $dataTmpCat['field_item_id'] |
@@ -1477,8 +1476,8 @@ discard block |
||
| 1477 | 1476 | (int) $post_folder_is_personal, |
| 1478 | 1477 | (int) $dataTmpCat['field_item_id'], |
| 1479 | 1478 | $cryptedStuff['objectKey'], |
| 1480 | - true, // only for the item creator |
|
| 1481 | - true, // delete all |
|
| 1479 | + true, // only for the item creator |
|
| 1480 | + true, // delete all |
|
| 1482 | 1481 | ); |
| 1483 | 1482 | |
| 1484 | 1483 | if ($encryptedFieldIsChanged === false) { |
@@ -1520,7 +1519,7 @@ discard block |
||
| 1520 | 1519 | $session->get('user-id'), |
| 1521 | 1520 | 'at_modification', |
| 1522 | 1521 | $session->get('user-login'), |
| 1523 | - 'at_field : ' . $dataTmpCat['title'] . ' => ' . $oldVal |
|
| 1522 | + 'at_field : '.$dataTmpCat['title'].' => '.$oldVal |
|
| 1524 | 1523 | ); |
| 1525 | 1524 | } |
| 1526 | 1525 | } |
@@ -1574,7 +1573,7 @@ discard block |
||
| 1574 | 1573 | ) { |
| 1575 | 1574 | DB::queryFirstRow( |
| 1576 | 1575 | 'SELECT * |
| 1577 | - FROM ' . prefixTable('templates') . ' |
|
| 1576 | + FROM ' . prefixTable('templates').' |
|
| 1578 | 1577 | WHERE item_id = %i', |
| 1579 | 1578 | $inputData['itemId'] |
| 1580 | 1579 | ); |
@@ -1617,7 +1616,7 @@ discard block |
||
| 1617 | 1616 | // check if elem exists in Table. If not add it or update it. |
| 1618 | 1617 | DB::query( |
| 1619 | 1618 | 'SELECT * |
| 1620 | - FROM ' . prefixTable('automatic_del') . ' |
|
| 1619 | + FROM ' . prefixTable('automatic_del').' |
|
| 1621 | 1620 | WHERE item_id = %i', |
| 1622 | 1621 | $inputData['itemId'] |
| 1623 | 1622 | ); |
@@ -1644,7 +1643,7 @@ discard block |
||
| 1644 | 1643 | // Store updates performed |
| 1645 | 1644 | array_push( |
| 1646 | 1645 | $arrayOfChanges, |
| 1647 | - $lang->get('automatic_deletion_engaged') . ': ' . $lang->get('enabled') |
|
| 1646 | + $lang->get('automatic_deletion_engaged').': '.$lang->get('enabled') |
|
| 1648 | 1647 | ); |
| 1649 | 1648 | |
| 1650 | 1649 | // update LOG |
@@ -1687,7 +1686,7 @@ discard block |
||
| 1687 | 1686 | // Store updates performed |
| 1688 | 1687 | array_push( |
| 1689 | 1688 | $arrayOfChanges, |
| 1690 | - $lang->get('automatic_deletion_engaged') . ': ' . $lang->get('disabled') |
|
| 1689 | + $lang->get('automatic_deletion_engaged').': '.$lang->get('disabled') |
|
| 1691 | 1690 | ); |
| 1692 | 1691 | |
| 1693 | 1692 | // update LOG |
@@ -1715,7 +1714,7 @@ discard block |
||
| 1715 | 1714 | if (empty($userId) === false) { |
| 1716 | 1715 | $dataTmp = DB::queryFirstRow( |
| 1717 | 1716 | 'SELECT id, name, lastname |
| 1718 | - FROM ' . prefixTable('users') . ' |
|
| 1717 | + FROM ' . prefixTable('users').' |
|
| 1719 | 1718 | WHERE id= %i', |
| 1720 | 1719 | $userId |
| 1721 | 1720 | ); |
@@ -1723,7 +1722,7 @@ discard block |
||
| 1723 | 1722 | // Add to array |
| 1724 | 1723 | array_push( |
| 1725 | 1724 | $arrayOfUsersRestriction, |
| 1726 | - $dataTmp['name'] . ' ' . $dataTmp['lastname'] |
|
| 1725 | + $dataTmp['name'].' '.$dataTmp['lastname'] |
|
| 1727 | 1726 | ); |
| 1728 | 1727 | array_push( |
| 1729 | 1728 | $arrayOfUsersIdRestriction, |
@@ -1754,8 +1753,8 @@ discard block |
||
| 1754 | 1753 | // get values before deleting them |
| 1755 | 1754 | $rows = DB::query( |
| 1756 | 1755 | 'SELECT t.title, t.id AS id |
| 1757 | - FROM ' . prefixTable('roles_title') . ' as t |
|
| 1758 | - INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (t.id=r.role_id) |
|
| 1756 | + FROM ' . prefixTable('roles_title').' as t |
|
| 1757 | + INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (t.id=r.role_id) |
|
| 1759 | 1758 | WHERE r.item_id = %i |
| 1760 | 1759 | ORDER BY t.title ASC', |
| 1761 | 1760 | $inputData['itemId'] |
@@ -1789,7 +1788,7 @@ discard block |
||
| 1789 | 1788 | ); |
| 1790 | 1789 | $dataTmp = DB::queryFirstRow( |
| 1791 | 1790 | 'SELECT title |
| 1792 | - FROM ' . prefixTable('roles_title') . ' |
|
| 1791 | + FROM ' . prefixTable('roles_title').' |
|
| 1793 | 1792 | WHERE id = %i', |
| 1794 | 1793 | $role |
| 1795 | 1794 | ); |
@@ -1817,7 +1816,7 @@ discard block |
||
| 1817 | 1816 | // Get current status |
| 1818 | 1817 | $otpStatus = DB::queryFirstRow( |
| 1819 | 1818 | 'SELECT enabled as otp_is_enabled |
| 1820 | - FROM ' . prefixTable('items_otp') . ' |
|
| 1819 | + FROM ' . prefixTable('items_otp').' |
|
| 1821 | 1820 | WHERE item_id = %i', |
| 1822 | 1821 | $inputData['itemId'] |
| 1823 | 1822 | ); |
@@ -1848,7 +1847,7 @@ discard block |
||
| 1848 | 1847 | $session->get('user-id'), |
| 1849 | 1848 | 'at_modification', |
| 1850 | 1849 | $session->get('user-login'), |
| 1851 | - 'at_otp_status:' . ((int) $post_otp_is_enabled === 0 ? 'disabled' : 'enabled') |
|
| 1850 | + 'at_otp_status:'.((int) $post_otp_is_enabled === 0 ? 'disabled' : 'enabled') |
|
| 1852 | 1851 | ); |
| 1853 | 1852 | } elseif (DB::count() === 0 && empty($post_otp_secret) === false) { |
| 1854 | 1853 | // Create the entry in items_otp table |
@@ -1892,8 +1891,8 @@ discard block |
||
| 1892 | 1891 | $session->get('user-id'), |
| 1893 | 1892 | 'at_modification', |
| 1894 | 1893 | $session->get('user-login'), |
| 1895 | - 'at_restriction : ' . (count($diffUsersRestiction) > 0 ? |
|
| 1896 | - implode(', ', $arrayOfUsersRestriction) . (count($diffRolesRestiction) > 0 ? ', ' : '') : '') . (count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '') |
|
| 1894 | + 'at_restriction : '.(count($diffUsersRestiction) > 0 ? |
|
| 1895 | + implode(', ', $arrayOfUsersRestriction).(count($diffRolesRestiction) > 0 ? ', ' : '') : '').(count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '') |
|
| 1897 | 1896 | ); |
| 1898 | 1897 | } |
| 1899 | 1898 | |
@@ -1913,7 +1912,7 @@ discard block |
||
| 1913 | 1912 | $session->get('user-id'), |
| 1914 | 1913 | 'at_modification', |
| 1915 | 1914 | $session->get('user-login'), |
| 1916 | - 'at_label : ' . $data['label'] . ' => ' . $inputData['label'] |
|
| 1915 | + 'at_label : '.$data['label'].' => '.$inputData['label'] |
|
| 1917 | 1916 | ); |
| 1918 | 1917 | } |
| 1919 | 1918 | // LOGIN |
@@ -1932,7 +1931,7 @@ discard block |
||
| 1932 | 1931 | $session->get('user-id'), |
| 1933 | 1932 | 'at_modification', |
| 1934 | 1933 | $session->get('user-login'), |
| 1935 | - 'at_login : ' . $data['login'] . ' => ' . $post_login |
|
| 1934 | + 'at_login : '.$data['login'].' => '.$post_login |
|
| 1936 | 1935 | ); |
| 1937 | 1936 | } |
| 1938 | 1937 | |
@@ -1951,7 +1950,7 @@ discard block |
||
| 1951 | 1950 | $session->get('user-id'), |
| 1952 | 1951 | 'at_modification', |
| 1953 | 1952 | $session->get('user-login'), |
| 1954 | - 'at_email : ' . $data['email'] . ' => ' . $post_email |
|
| 1953 | + 'at_email : '.$data['email'].' => '.$post_email |
|
| 1955 | 1954 | ); |
| 1956 | 1955 | } |
| 1957 | 1956 | // URL |
@@ -1970,7 +1969,7 @@ discard block |
||
| 1970 | 1969 | $session->get('user-id'), |
| 1971 | 1970 | 'at_modification', |
| 1972 | 1971 | $session->get('user-login'), |
| 1973 | - 'at_url : ' . $data['url'] . ' => ' . $post_url |
|
| 1972 | + 'at_url : '.$data['url'].' => '.$post_url |
|
| 1974 | 1973 | ); |
| 1975 | 1974 | } |
| 1976 | 1975 | // DESCRIPTION |
@@ -1996,7 +1995,7 @@ discard block |
||
| 1996 | 1995 | // FOLDER |
| 1997 | 1996 | if ((int) $data['id_tree'] !== (int) $inputData['folderId']) { |
| 1998 | 1997 | // Get name of folders |
| 1999 | - $dataTmp = DB::query('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id IN %li', array($data['id_tree'], $inputData['folderId'])); |
|
| 1998 | + $dataTmp = DB::query('SELECT title FROM '.prefixTable('nested_tree').' WHERE id IN %li', array($data['id_tree'], $inputData['folderId'])); |
|
| 2000 | 1999 | |
| 2001 | 2000 | // Store updates performed |
| 2002 | 2001 | array_push( |
@@ -2012,7 +2011,7 @@ discard block |
||
| 2012 | 2011 | $session->get('user-id'), |
| 2013 | 2012 | 'at_modification', |
| 2014 | 2013 | $session->get('user-login'), |
| 2015 | - 'at_category : ' . $dataTmp[0]['title'] . ' => ' . $dataTmp[1]['title'] |
|
| 2014 | + 'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title'] |
|
| 2016 | 2015 | ); |
| 2017 | 2016 | } |
| 2018 | 2017 | // ANYONE_CAN_MODIFY |
@@ -2020,7 +2019,7 @@ discard block |
||
| 2020 | 2019 | // Store updates performed |
| 2021 | 2020 | array_push( |
| 2022 | 2021 | $arrayOfChanges, |
| 2023 | - $lang->get('at_anyoneconmodify') . ': ' . ((int) $post_anyone_can_modify === 0 ? $lang->get('disabled') : $lang->get('enabled')) |
|
| 2022 | + $lang->get('at_anyoneconmodify').': '.((int) $post_anyone_can_modify === 0 ? $lang->get('disabled') : $lang->get('enabled')) |
|
| 2024 | 2023 | ); |
| 2025 | 2024 | |
| 2026 | 2025 | // Log |
@@ -2031,15 +2030,15 @@ discard block |
||
| 2031 | 2030 | $session->get('user-id'), |
| 2032 | 2031 | 'at_modification', |
| 2033 | 2032 | $session->get('user-login'), |
| 2034 | - 'at_anyoneconmodify : ' . ((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled') |
|
| 2033 | + 'at_anyoneconmodify : '.((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled') |
|
| 2035 | 2034 | ); |
| 2036 | 2035 | } |
| 2037 | 2036 | |
| 2038 | 2037 | // Reload new values |
| 2039 | 2038 | $dataItem = DB::queryFirstRow( |
| 2040 | 2039 | 'SELECT * |
| 2041 | - FROM ' . prefixTable('items') . ' as i |
|
| 2042 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 2040 | + FROM ' . prefixTable('items').' as i |
|
| 2041 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 2043 | 2042 | WHERE i.id = %i AND l.action = %s', |
| 2044 | 2043 | $inputData['itemId'], |
| 2045 | 2044 | 'at_creation' |
@@ -2048,8 +2047,8 @@ discard block |
||
| 2048 | 2047 | $history = ''; |
| 2049 | 2048 | $rows = DB::query( |
| 2050 | 2049 | 'SELECT l.date as date, l.action as action, l.raison as raison, u.login as login |
| 2051 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 2052 | - LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 2050 | + FROM ' . prefixTable('log_items').' as l |
|
| 2051 | + LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 2053 | 2052 | WHERE l.action <> %s AND id_item=%s', |
| 2054 | 2053 | 'at_shown', |
| 2055 | 2054 | $inputData['itemId'] |
@@ -2058,14 +2057,14 @@ discard block |
||
| 2058 | 2057 | if ($record['raison'] === NULL) continue; |
| 2059 | 2058 | $reason = explode(':', $record['raison']); |
| 2060 | 2059 | if (count($reason) > 0) { |
| 2061 | - $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' |
|
| 2062 | - . $record['login'] . ' - ' . $lang->get($record['action']) . ' - ' |
|
| 2063 | - . (empty($record['raison']) === false ? (count($reason) > 1 ? $lang->get(trim($reason[0])) . ' : ' . $reason[1] |
|
| 2060 | + $sentence = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - ' |
|
| 2061 | + . $record['login'].' - '.$lang->get($record['action']).' - ' |
|
| 2062 | + . (empty($record['raison']) === false ? (count($reason) > 1 ? $lang->get(trim($reason[0])).' : '.$reason[1] |
|
| 2064 | 2063 | : $lang->get(trim($reason[0]))) : ''); |
| 2065 | 2064 | if (empty($history)) { |
| 2066 | 2065 | $history = $sentence; |
| 2067 | 2066 | } else { |
| 2068 | - $history .= '<br />' . $sentence; |
|
| 2067 | + $history .= '<br />'.$sentence; |
|
| 2069 | 2068 | } |
| 2070 | 2069 | } |
| 2071 | 2070 | } |
@@ -2203,7 +2202,7 @@ discard block |
||
| 2203 | 2202 | ) { |
| 2204 | 2203 | // load the original record into an array |
| 2205 | 2204 | $originalRecord = DB::queryFirstRow( |
| 2206 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 2205 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 2207 | 2206 | WHERE id = %i', |
| 2208 | 2207 | $inputData['itemId'] |
| 2209 | 2208 | ); |
@@ -2222,7 +2221,7 @@ discard block |
||
| 2222 | 2221 | |
| 2223 | 2222 | // Load the destination folder record into an array |
| 2224 | 2223 | $dataDestination = DB::queryFirstRow( |
| 2225 | - 'SELECT personal_folder FROM ' . prefixTable('nested_tree') . ' |
|
| 2224 | + 'SELECT personal_folder FROM '.prefixTable('nested_tree').' |
|
| 2226 | 2225 | WHERE id = %i', |
| 2227 | 2226 | $post_dest_id |
| 2228 | 2227 | ); |
@@ -2230,7 +2229,7 @@ discard block |
||
| 2230 | 2229 | // Get the ITEM object key for the user |
| 2231 | 2230 | $userKey = DB::queryFirstRow( |
| 2232 | 2231 | 'SELECT share_key |
| 2233 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2232 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2234 | 2233 | WHERE user_id = %i AND object_id = %i', |
| 2235 | 2234 | $session->get('user-id'), |
| 2236 | 2235 | $inputData['itemId'] |
@@ -2307,8 +2306,8 @@ discard block |
||
| 2307 | 2306 | // Manage Custom Fields |
| 2308 | 2307 | $rows = DB::query( |
| 2309 | 2308 | 'SELECT ci.id AS id, ci.data AS data, ci.field_id AS field_id, c.encrypted_data AS encrypted_data |
| 2310 | - FROM ' . prefixTable('categories_items') . ' AS ci |
|
| 2311 | - INNER JOIN ' . prefixTable('categories') . ' AS c ON (c.id = ci.field_id) |
|
| 2309 | + FROM ' . prefixTable('categories_items').' AS ci |
|
| 2310 | + INNER JOIN ' . prefixTable('categories').' AS c ON (c.id = ci.field_id) |
|
| 2312 | 2311 | WHERE ci.item_id = %i', |
| 2313 | 2312 | $inputData['itemId'] |
| 2314 | 2313 | ); |
@@ -2320,7 +2319,7 @@ discard block |
||
| 2320 | 2319 | // Get user key |
| 2321 | 2320 | $userKey = DB::queryFirstRow( |
| 2322 | 2321 | 'SELECT share_key |
| 2323 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 2322 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 2324 | 2323 | WHERE user_id = %i AND object_id = %i', |
| 2325 | 2324 | $session->get('user-id'), |
| 2326 | 2325 | $field['id'] |
@@ -2387,15 +2386,15 @@ discard block |
||
| 2387 | 2386 | $rows = DB::query( |
| 2388 | 2387 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension, |
| 2389 | 2388 | f.size AS size, f.type AS type, s.share_key AS share_key |
| 2390 | - FROM ' . prefixTable('files') . ' AS f |
|
| 2391 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 2389 | + FROM ' . prefixTable('files').' AS f |
|
| 2390 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 2392 | 2391 | WHERE s.user_id = %i AND f.id_item = %i', |
| 2393 | 2392 | $session->get('user-id'), |
| 2394 | 2393 | $inputData['itemId'] |
| 2395 | 2394 | ); |
| 2396 | 2395 | foreach ($rows as $record) { |
| 2397 | 2396 | // Check if file still exists |
| 2398 | - if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($record['file'])) === true) { |
|
| 2397 | + if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($record['file'])) === true) { |
|
| 2399 | 2398 | // Step1 - decrypt the file |
| 2400 | 2399 | // deepcode ignore PT: path is sanitized inside decryptFile() |
| 2401 | 2400 | $fileContent = decryptFile( |
@@ -2406,8 +2405,8 @@ discard block |
||
| 2406 | 2405 | |
| 2407 | 2406 | // Step2 - create file |
| 2408 | 2407 | // deepcode ignore InsecureHash: md5 is used jonly for file name in order to get a hashed value in database |
| 2409 | - $newFileName = md5(time() . '_' . $record['id']) . '.' . $record['extension']; |
|
| 2410 | - $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab'); |
|
| 2408 | + $newFileName = md5(time().'_'.$record['id']).'.'.$record['extension']; |
|
| 2409 | + $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab'); |
|
| 2411 | 2410 | if ($outstream === false) { |
| 2412 | 2411 | echo prepareExchangedData( |
| 2413 | 2412 | array( |
@@ -2480,7 +2479,7 @@ discard block |
||
| 2480 | 2479 | |
| 2481 | 2480 | // ------------------------- |
| 2482 | 2481 | // Add specific restrictions |
| 2483 | - $rows = DB::query('SELECT * FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', $inputData['itemId']); |
|
| 2482 | + $rows = DB::query('SELECT * FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', $inputData['itemId']); |
|
| 2484 | 2483 | foreach ($rows as $record) { |
| 2485 | 2484 | DB::insert( |
| 2486 | 2485 | prefixTable('restriction_to_roles'), |
@@ -2492,7 +2491,7 @@ discard block |
||
| 2492 | 2491 | } |
| 2493 | 2492 | |
| 2494 | 2493 | // Add Tags |
| 2495 | - $rows = DB::query('SELECT * FROM ' . prefixTable('tags') . ' WHERE item_id = %i', $inputData['itemId']); |
|
| 2494 | + $rows = DB::query('SELECT * FROM '.prefixTable('tags').' WHERE item_id = %i', $inputData['itemId']); |
|
| 2496 | 2495 | foreach ($rows as $record) { |
| 2497 | 2496 | DB::insert( |
| 2498 | 2497 | prefixTable('tags'), |
@@ -2594,7 +2593,7 @@ discard block |
||
| 2594 | 2593 | // then we can show it |
| 2595 | 2594 | $item_deleted = DB::queryFirstRow( |
| 2596 | 2595 | 'SELECT * |
| 2597 | - FROM ' . prefixTable('log_items') . ' |
|
| 2596 | + FROM ' . prefixTable('log_items').' |
|
| 2598 | 2597 | WHERE id_item = %i AND action = %s |
| 2599 | 2598 | ORDER BY date DESC |
| 2600 | 2599 | LIMIT 0, 1', |
@@ -2605,7 +2604,7 @@ discard block |
||
| 2605 | 2604 | |
| 2606 | 2605 | $item_restored = DB::queryFirstRow( |
| 2607 | 2606 | 'SELECT * |
| 2608 | - FROM ' . prefixTable('log_items') . ' |
|
| 2607 | + FROM ' . prefixTable('log_items').' |
|
| 2609 | 2608 | WHERE id_item = %i AND action = %s |
| 2610 | 2609 | ORDER BY date DESC |
| 2611 | 2610 | LIMIT 0, 1', |
@@ -2629,8 +2628,8 @@ discard block |
||
| 2629 | 2628 | // Get all informations for this item |
| 2630 | 2629 | $dataItem = DB::queryFirstRow( |
| 2631 | 2630 | 'SELECT * |
| 2632 | - FROM ' . prefixTable('items') . ' as i |
|
| 2633 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 2631 | + FROM ' . prefixTable('items').' as i |
|
| 2632 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 2634 | 2633 | WHERE i.id = %i AND l.action = %s', |
| 2635 | 2634 | $inputData['id'], |
| 2636 | 2635 | 'at_creation' |
@@ -2639,7 +2638,7 @@ discard block |
||
| 2639 | 2638 | // Notification |
| 2640 | 2639 | DB::queryFirstRow( |
| 2641 | 2640 | 'SELECT * |
| 2642 | - FROM ' . prefixTable('notification') . ' |
|
| 2641 | + FROM ' . prefixTable('notification').' |
|
| 2643 | 2642 | WHERE item_id = %i AND user_id = %i', |
| 2644 | 2643 | $inputData['id'], |
| 2645 | 2644 | $session->get('user-id') |
@@ -2658,7 +2657,7 @@ discard block |
||
| 2658 | 2657 | |
| 2659 | 2658 | // manage case of API user |
| 2660 | 2659 | if ($dataItem['id_user'] === API_USER_ID) { |
| 2661 | - $arrData['author'] = 'API [' . $dataItem['description'] . ']'; |
|
| 2660 | + $arrData['author'] = 'API ['.$dataItem['description'].']'; |
|
| 2662 | 2661 | $arrData['id_user'] = API_USER_ID; |
| 2663 | 2662 | $arrData['author_email'] = ''; |
| 2664 | 2663 | $arrData['notification_status'] = false; |
@@ -2668,7 +2667,7 @@ discard block |
||
| 2668 | 2667 | $tags = array(); |
| 2669 | 2668 | $rows = DB::query( |
| 2670 | 2669 | 'SELECT tag |
| 2671 | - FROM ' . prefixTable('tags') . ' |
|
| 2670 | + FROM ' . prefixTable('tags').' |
|
| 2672 | 2671 | WHERE item_id = %i', |
| 2673 | 2672 | $inputData['id'] |
| 2674 | 2673 | ); |
@@ -2693,7 +2692,7 @@ discard block |
||
| 2693 | 2692 | // Check if user has a role that is accepted |
| 2694 | 2693 | $rows_tmp = DB::query( |
| 2695 | 2694 | 'SELECT role_id |
| 2696 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 2695 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 2697 | 2696 | WHERE item_id=%i', |
| 2698 | 2697 | $inputData['id'] |
| 2699 | 2698 | ); |
@@ -2707,7 +2706,7 @@ discard block |
||
| 2707 | 2706 | // Get the object key for the user |
| 2708 | 2707 | $userKey = DB::queryFirstRow( |
| 2709 | 2708 | 'SELECT share_key |
| 2710 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2709 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2711 | 2710 | WHERE user_id = %i AND object_id = %i', |
| 2712 | 2711 | $session->get('user-id'), |
| 2713 | 2712 | $inputData['id'] |
@@ -2804,8 +2803,8 @@ discard block |
||
| 2804 | 2803 | // Add restriction if item is restricted to roles |
| 2805 | 2804 | $rows = DB::query( |
| 2806 | 2805 | 'SELECT t.title, t.id |
| 2807 | - FROM ' . prefixTable('roles_title') . ' AS t |
|
| 2808 | - INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (t.id=r.role_id) |
|
| 2806 | + FROM ' . prefixTable('roles_title').' AS t |
|
| 2807 | + INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (t.id=r.role_id) |
|
| 2809 | 2808 | WHERE r.item_id = %i |
| 2810 | 2809 | ORDER BY t.title ASC', |
| 2811 | 2810 | $inputData['id'] |
@@ -2821,8 +2820,8 @@ discard block |
||
| 2821 | 2820 | $tmp = array(); |
| 2822 | 2821 | $rows = DB::query( |
| 2823 | 2822 | 'SELECT k.label, k.id |
| 2824 | - FROM ' . prefixTable('kb_items') . ' as i |
|
| 2825 | - INNER JOIN ' . prefixTable('kb') . ' as k ON (i.kb_id=k.id) |
|
| 2823 | + FROM ' . prefixTable('kb_items').' as i |
|
| 2824 | + INNER JOIN ' . prefixTable('kb').' as k ON (i.kb_id=k.id) |
|
| 2826 | 2825 | WHERE i.item_id = %i |
| 2827 | 2826 | ORDER BY k.label ASC', |
| 2828 | 2827 | $inputData['id'] |
@@ -2905,7 +2904,7 @@ discard block |
||
| 2905 | 2904 | $arrCatList = array(); |
| 2906 | 2905 | $rows_tmp = DB::query( |
| 2907 | 2906 | 'SELECT id_category |
| 2908 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2907 | + FROM ' . prefixTable('categories_folders').' |
|
| 2909 | 2908 | WHERE id_folder=%i', |
| 2910 | 2909 | $inputData['folderId'] |
| 2911 | 2910 | ); |
@@ -2920,8 +2919,8 @@ discard block |
||
| 2920 | 2919 | 'SELECT i.id AS id, i.field_id AS field_id, i.data AS data, i.item_id AS item_id, |
| 2921 | 2920 | i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data, c.parent_id AS parent_id, |
| 2922 | 2921 | c.type as field_type, c.masked AS field_masked, c.role_visibility AS role_visibility |
| 2923 | - FROM ' . prefixTable('categories_items') . ' AS i |
|
| 2924 | - INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id) |
|
| 2922 | + FROM ' . prefixTable('categories_items').' AS i |
|
| 2923 | + INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id) |
|
| 2925 | 2924 | WHERE i.item_id=%i AND c.parent_id IN %ls', |
| 2926 | 2925 | $inputData['id'], |
| 2927 | 2926 | $arrCatList |
@@ -2932,7 +2931,7 @@ discard block |
||
| 2932 | 2931 | //db::debugmode(true); |
| 2933 | 2932 | $userKey = DB::queryFirstRow( |
| 2934 | 2933 | 'SELECT share_key |
| 2935 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 2934 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 2936 | 2935 | WHERE user_id = %i AND object_id = %i', |
| 2937 | 2936 | $session->get('user-id'), |
| 2938 | 2937 | $row['id'] |
@@ -2950,7 +2949,7 @@ discard block |
||
| 2950 | 2949 | } else if (DB::count() === 0 && (int) $row['encrypted_data'] === 0) { |
| 2951 | 2950 | // Data is not encrypted in DB |
| 2952 | 2951 | $fieldText = [ |
| 2953 | - 'string' => $row['data'],//#3945 - isBase64($row['data']) === true ? base64_decode($row['data']) : |
|
| 2952 | + 'string' => $row['data'], //#3945 - isBase64($row['data']) === true ? base64_decode($row['data']) : |
|
| 2954 | 2953 | 'encrypted' => false, |
| 2955 | 2954 | 'error' => false, |
| 2956 | 2955 | ]; |
@@ -2995,7 +2994,7 @@ discard block |
||
| 2995 | 2994 | if (isset($SETTINGS['item_creation_templates']) && (int) $SETTINGS['item_creation_templates'] === 1) { |
| 2996 | 2995 | $rows_tmp = DB::queryFirstRow( |
| 2997 | 2996 | 'SELECT category_id |
| 2998 | - FROM ' . prefixTable('templates') . ' |
|
| 2997 | + FROM ' . prefixTable('templates').' |
|
| 2999 | 2998 | WHERE item_id = %i', |
| 3000 | 2999 | $inputData['id'] |
| 3001 | 3000 | ); |
@@ -3012,7 +3011,7 @@ discard block |
||
| 3012 | 3011 | // Evaluate if item is ready for all users |
| 3013 | 3012 | $rows_tmp = DB::queryFirstRow( |
| 3014 | 3013 | 'SELECT finished_at |
| 3015 | - FROM ' . prefixTable('background_tasks') . ' |
|
| 3014 | + FROM ' . prefixTable('background_tasks').' |
|
| 3016 | 3015 | WHERE item_id = %i', |
| 3017 | 3016 | $inputData['id'] |
| 3018 | 3017 | ); |
@@ -3029,7 +3028,7 @@ discard block |
||
| 3029 | 3028 | // Is the Item to be deleted? |
| 3030 | 3029 | $dataDelete = DB::queryFirstRow( |
| 3031 | 3030 | 'SELECT * |
| 3032 | - FROM ' . prefixTable('automatic_del') . ' |
|
| 3031 | + FROM ' . prefixTable('automatic_del').' |
|
| 3033 | 3032 | WHERE item_id = %i', |
| 3034 | 3033 | $inputData['id'] |
| 3035 | 3034 | ); |
@@ -3110,14 +3109,14 @@ discard block |
||
| 3110 | 3109 | if (empty($userRest) === false) { |
| 3111 | 3110 | $dataTmp = DB::queryFirstRow( |
| 3112 | 3111 | 'SELECT login |
| 3113 | - FROM ' . prefixTable('users') . ' |
|
| 3112 | + FROM ' . prefixTable('users').' |
|
| 3114 | 3113 | WHERE id= %i', |
| 3115 | 3114 | $userRest |
| 3116 | 3115 | ); |
| 3117 | 3116 | if (empty($listOfRestricted)) { |
| 3118 | 3117 | $listOfRestricted = $dataTmp['login']; |
| 3119 | 3118 | } else { |
| 3120 | - $listOfRestricted .= ';' . $dataTmp['login']; |
|
| 3119 | + $listOfRestricted .= ';'.$dataTmp['login']; |
|
| 3121 | 3120 | } |
| 3122 | 3121 | } |
| 3123 | 3122 | } |
@@ -3191,9 +3190,9 @@ discard block |
||
| 3191 | 3190 | // Load item data |
| 3192 | 3191 | $dataItem = DB::queryFirstRow( |
| 3193 | 3192 | 'SELECT i.*, n.title AS folder_title, o.enabled AS otp_for_item_enabled, o.phone_number AS otp_phone_number, o.secret AS otp_secret |
| 3194 | - FROM ' . prefixTable('items') . ' AS i |
|
| 3195 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id) |
|
| 3196 | - LEFT JOIN ' . prefixTable('items_otp') . ' AS o ON (o.item_id = i.id) |
|
| 3193 | + FROM ' . prefixTable('items').' AS i |
|
| 3194 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id) |
|
| 3195 | + LEFT JOIN ' . prefixTable('items_otp').' AS o ON (o.item_id = i.id) |
|
| 3197 | 3196 | WHERE i.id = %i', |
| 3198 | 3197 | $inputData['id'] |
| 3199 | 3198 | ); |
@@ -3215,7 +3214,7 @@ discard block |
||
| 3215 | 3214 | // Check if user has a role that is accepted |
| 3216 | 3215 | $rows_tmp = DB::query( |
| 3217 | 3216 | 'SELECT role_id |
| 3218 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 3217 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 3219 | 3218 | WHERE item_id=%i', |
| 3220 | 3219 | $inputData['id'] |
| 3221 | 3220 | ); |
@@ -3247,12 +3246,12 @@ discard block |
||
| 3247 | 3246 | // launch query |
| 3248 | 3247 | $rows = DB::query( |
| 3249 | 3248 | 'SELECT id, name, file, extension, size |
| 3250 | - FROM ' . prefixTable('files') . ' |
|
| 3249 | + FROM ' . prefixTable('files').' |
|
| 3251 | 3250 | WHERE id_item = %i AND confirmed = 1', |
| 3252 | 3251 | $inputData['id'] |
| 3253 | 3252 | ); |
| 3254 | 3253 | foreach ($rows as $record) { |
| 3255 | - $filename = basename($record['name'], '.' . $record['extension']); |
|
| 3254 | + $filename = basename($record['name'], '.'.$record['extension']); |
|
| 3256 | 3255 | $filename = isBase64($filename) === true ? base64_decode($filename) : $filename; |
| 3257 | 3256 | |
| 3258 | 3257 | array_push( |
@@ -3265,7 +3264,7 @@ discard block |
||
| 3265 | 3264 | 'is_image' => in_array(strtolower($record['extension']), TP_IMAGE_FILE_EXT) === true ? 1 : 0, |
| 3266 | 3265 | 'id' => $record['id'], |
| 3267 | 3266 | 'key' => $session->get('user-key_tmp'), |
| 3268 | - 'internalFilename' => basename($record['name'], '.' . $record['extension']), |
|
| 3267 | + 'internalFilename' => basename($record['name'], '.'.$record['extension']), |
|
| 3269 | 3268 | ) |
| 3270 | 3269 | ); |
| 3271 | 3270 | } |
@@ -3303,7 +3302,7 @@ discard block |
||
| 3303 | 3302 | array( |
| 3304 | 3303 | 'latest_items' => implode(';', $session->get('user-latest_items')), |
| 3305 | 3304 | ), |
| 3306 | - 'id=' . $session->get('user-id') |
|
| 3305 | + 'id='.$session->get('user-id') |
|
| 3307 | 3306 | ); |
| 3308 | 3307 | } |
| 3309 | 3308 | |
@@ -3312,8 +3311,8 @@ discard block |
||
| 3312 | 3311 | $listOptionsForRoles = array(); |
| 3313 | 3312 | $rows = DB::query( |
| 3314 | 3313 | 'SELECT r.role_id AS role_id, t.title AS title |
| 3315 | - FROM ' . prefixTable('roles_values') . ' AS r |
|
| 3316 | - INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id) |
|
| 3314 | + FROM ' . prefixTable('roles_values').' AS r |
|
| 3315 | + INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id) |
|
| 3317 | 3316 | WHERE r.folder_id = %i', |
| 3318 | 3317 | $dataItem['id_tree'] |
| 3319 | 3318 | ); |
@@ -3327,9 +3326,9 @@ discard block |
||
| 3327 | 3326 | ); |
| 3328 | 3327 | $rows2 = DB::query( |
| 3329 | 3328 | 'SELECT id, login, fonction_id, email, name, lastname |
| 3330 | - FROM ' . prefixTable('users') . ' |
|
| 3329 | + FROM ' . prefixTable('users').' |
|
| 3331 | 3330 | WHERE fonction_id LIKE %s', |
| 3332 | - '%' . $record['role_id'] . '%' |
|
| 3331 | + '%'.$record['role_id'].'%' |
|
| 3333 | 3332 | ); |
| 3334 | 3333 | foreach ($rows2 as $record2) { |
| 3335 | 3334 | foreach (explode(';', $record2['fonction_id']) as $role) { |
@@ -3342,7 +3341,7 @@ discard block |
||
| 3342 | 3341 | array( |
| 3343 | 3342 | 'id' => (int) $record2['id'], |
| 3344 | 3343 | 'login' => $record2['login'], |
| 3345 | - 'name' => $record2['name'] . ' ' . $record2['lastname'], |
|
| 3344 | + 'name' => $record2['name'].' '.$record2['lastname'], |
|
| 3346 | 3345 | 'email' => $record2['email'], |
| 3347 | 3346 | ) |
| 3348 | 3347 | ); |
@@ -3361,16 +3360,16 @@ discard block |
||
| 3361 | 3360 | $path = ''; |
| 3362 | 3361 | foreach ($arbo as $elem) { |
| 3363 | 3362 | if (empty($path) === true) { |
| 3364 | - $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' '; |
|
| 3363 | + $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
|
| 3365 | 3364 | } else { |
| 3366 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 3365 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 3367 | 3366 | } |
| 3368 | 3367 | } |
| 3369 | 3368 | // Build text to show user |
| 3370 | 3369 | if (empty($path) === true) { |
| 3371 | 3370 | $path = addslashes($dataItem['label']); |
| 3372 | 3371 | } else { |
| 3373 | - $path = addslashes($dataItem['label']) . ' (' . $path . ')'; |
|
| 3372 | + $path = addslashes($dataItem['label']).' ('.$path.')'; |
|
| 3374 | 3373 | } |
| 3375 | 3374 | |
| 3376 | 3375 | // Add Admins to notification list if expected |
@@ -3393,7 +3392,7 @@ discard block |
||
| 3393 | 3392 | array( |
| 3394 | 3393 | addslashes($session->get('user-login')), |
| 3395 | 3394 | $path, |
| 3396 | - $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $dataItem['id'], |
|
| 3395 | + $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$dataItem['id'], |
|
| 3397 | 3396 | ), |
| 3398 | 3397 | $lang->get('email_on_open_notification_mail') |
| 3399 | 3398 | ), |
@@ -3403,7 +3402,7 @@ discard block |
||
| 3403 | 3402 | } |
| 3404 | 3403 | |
| 3405 | 3404 | // has this item a change proposal |
| 3406 | - DB::query('SELECT * FROM ' . prefixTable('items_change') . ' WHERE item_id = %i', $inputData['id']); |
|
| 3405 | + DB::query('SELECT * FROM '.prefixTable('items_change').' WHERE item_id = %i', $inputData['id']); |
|
| 3407 | 3406 | $returnArray['has_change_proposal'] = DB::count(); |
| 3408 | 3407 | |
| 3409 | 3408 | // Setting |
@@ -3414,7 +3413,7 @@ discard block |
||
| 3414 | 3413 | if (isset($SETTINGS['otv_is_enabled']) === true && (int) $SETTINGS['otv_is_enabled'] === 1) { |
| 3415 | 3414 | DB::query( |
| 3416 | 3415 | 'SELECT * |
| 3417 | - FROM ' . prefixTable('otv') . ' |
|
| 3416 | + FROM ' . prefixTable('otv').' |
|
| 3418 | 3417 | WHERE item_id = %i |
| 3419 | 3418 | AND time_limit > %i', |
| 3420 | 3419 | $inputData['id'], |
@@ -3513,7 +3512,7 @@ discard block |
||
| 3513 | 3512 | // Load item data |
| 3514 | 3513 | $data = DB::queryFirstRow( |
| 3515 | 3514 | 'SELECT id_tree, id, label |
| 3516 | - FROM ' . prefixTable('items') . ' |
|
| 3515 | + FROM ' . prefixTable('items').' |
|
| 3517 | 3516 | WHERE id = %i OR item_key = %s', |
| 3518 | 3517 | $inputData['itemId'], |
| 3519 | 3518 | $inputData['itemKey'] |
@@ -3604,7 +3603,7 @@ discard block |
||
| 3604 | 3603 | // Load item data |
| 3605 | 3604 | $dataItem = DB::queryFirstRow( |
| 3606 | 3605 | 'SELECT secret, enabled |
| 3607 | - FROM ' . prefixTable('items_otp') . ' |
|
| 3606 | + FROM ' . prefixTable('items_otp').' |
|
| 3608 | 3607 | WHERE item_id = %i', |
| 3609 | 3608 | $inputData['id'] |
| 3610 | 3609 | ); |
@@ -3686,13 +3685,13 @@ discard block |
||
| 3686 | 3685 | |
| 3687 | 3686 | // Check if user is allowed to access this folder |
| 3688 | 3687 | if (!in_array($inputData['folderId'], $session->get('user-accessible_folders'))) { |
| 3689 | - echo '[{"error" : "' . $lang->get('error_not_allowed_to') . '"}]'; |
|
| 3688 | + echo '[{"error" : "'.$lang->get('error_not_allowed_to').'"}]'; |
|
| 3690 | 3689 | break; |
| 3691 | 3690 | } |
| 3692 | 3691 | |
| 3693 | 3692 | // Check if title doesn't contains html codes |
| 3694 | 3693 | if (preg_match_all('|<[^>]+>(.*)</[^>]+>|U', $title, $out)) { |
| 3695 | - echo '[ { "error" : "' . $lang->get('error_html_codes') . '" } ]'; |
|
| 3694 | + echo '[ { "error" : "'.$lang->get('error_html_codes').'" } ]'; |
|
| 3696 | 3695 | break; |
| 3697 | 3696 | } |
| 3698 | 3697 | // check that title is not numeric |
@@ -3703,9 +3702,9 @@ discard block |
||
| 3703 | 3702 | |
| 3704 | 3703 | // Check if duplicate folders name are allowed |
| 3705 | 3704 | if (isset($SETTINGS['duplicate_folder']) && $SETTINGS['duplicate_folder'] === '0') { |
| 3706 | - $data = DB::queryFirstRow('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', $title); |
|
| 3705 | + $data = DB::queryFirstRow('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE title = %s', $title); |
|
| 3707 | 3706 | if (empty($data['id']) === false && $dataReceived['folder'] !== $data['id']) { |
| 3708 | - echo '[ { "error" : "' . $lang->get('error_group_exist') . '" } ]'; |
|
| 3707 | + echo '[ { "error" : "'.$lang->get('error_group_exist').'" } ]'; |
|
| 3709 | 3708 | break; |
| 3710 | 3709 | } |
| 3711 | 3710 | } |
@@ -3713,7 +3712,7 @@ discard block |
||
| 3713 | 3712 | // query on folder |
| 3714 | 3713 | $data = DB::queryFirstRow( |
| 3715 | 3714 | 'SELECT parent_id, personal_folder |
| 3716 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 3715 | + FROM ' . prefixTable('nested_tree').' |
|
| 3717 | 3716 | WHERE id = %i', |
| 3718 | 3717 | $inputData['folderId'] |
| 3719 | 3718 | ); |
@@ -3723,20 +3722,20 @@ discard block |
||
| 3723 | 3722 | if ($session->get('user-admin') !== 1 && $session->get('user-manager') !== 1 && $data['personal_folder'] === '0') { |
| 3724 | 3723 | $data = DB::queryFirstRow( |
| 3725 | 3724 | 'SELECT valeur |
| 3726 | - FROM ' . prefixTable('misc') . ' |
|
| 3725 | + FROM ' . prefixTable('misc').' |
|
| 3727 | 3726 | WHERE intitule = %i AND type = %s', |
| 3728 | 3727 | $data['parent_id'], |
| 3729 | 3728 | 'complex' |
| 3730 | 3729 | ); |
| 3731 | 3730 | if (intval($dataReceived['complexity']) < intval($data['valeur'])) { |
| 3732 | - echo '[ { "error" : "' . $lang->get('error_folder_complexity_lower_than_top_folder') . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]"} ]'; |
|
| 3731 | + echo '[ { "error" : "'.$lang->get('error_folder_complexity_lower_than_top_folder').' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]"} ]'; |
|
| 3733 | 3732 | break; |
| 3734 | 3733 | } |
| 3735 | 3734 | } |
| 3736 | 3735 | |
| 3737 | 3736 | // update Folders table |
| 3738 | 3737 | $tmp = DB::queryFirstRow( |
| 3739 | - 'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 3738 | + 'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
| 3740 | 3739 | $dataReceived['folder'] |
| 3741 | 3740 | ); |
| 3742 | 3741 | if ($tmp['parent_id'] !== 0 || $tmp['title'] !== $session->get('user-id') || $tmp['personal_folder'] !== 1) { |
@@ -3850,7 +3849,7 @@ discard block |
||
| 3850 | 3849 | $uniqueLoadData['path'] = $arr_arbo; |
| 3851 | 3850 | |
| 3852 | 3851 | // store last folder accessed in cookie |
| 3853 | - $arr_cookie_options = array ( |
|
| 3852 | + $arr_cookie_options = array( |
|
| 3854 | 3853 | 'expires' => time() + TP_ONE_DAY_SECONDS * 5, |
| 3855 | 3854 | 'path' => '/', |
| 3856 | 3855 | 'secure' => true, |
@@ -3865,7 +3864,7 @@ discard block |
||
| 3865 | 3864 | foreach ($session->get('user-roles_array') as $role) { |
| 3866 | 3865 | $roleQ = DB::queryFirstRow( |
| 3867 | 3866 | 'SELECT allow_pw_change |
| 3868 | - FROM ' . prefixTable('roles_title') . ' |
|
| 3867 | + FROM ' . prefixTable('roles_title').' |
|
| 3869 | 3868 | WHERE id = %i', |
| 3870 | 3869 | $role |
| 3871 | 3870 | ); |
@@ -3896,11 +3895,11 @@ discard block |
||
| 3896 | 3895 | |
| 3897 | 3896 | foreach ($session->get('user-roles_array') as $role) { |
| 3898 | 3897 | $access = DB::queryFirstRow( |
| 3899 | - 'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i', |
|
| 3898 | + 'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i', |
|
| 3900 | 3899 | $role, |
| 3901 | 3900 | $inputData['id'] |
| 3902 | 3901 | ); |
| 3903 | - if (DB::count()>0) { |
|
| 3902 | + if (DB::count() > 0) { |
|
| 3904 | 3903 | if ($access['type'] === 'R') { |
| 3905 | 3904 | array_push($arrTmp, 10); |
| 3906 | 3905 | } elseif ($access['type'] === 'W') { |
@@ -3965,7 +3964,7 @@ discard block |
||
| 3965 | 3964 | } else { |
| 3966 | 3965 | DB::query( |
| 3967 | 3966 | 'SELECT * |
| 3968 | - FROM ' . prefixTable('items') . ' |
|
| 3967 | + FROM ' . prefixTable('items').' |
|
| 3969 | 3968 | WHERE inactif = %i', |
| 3970 | 3969 | 0 |
| 3971 | 3970 | ); |
@@ -3975,7 +3974,7 @@ discard block |
||
| 3975 | 3974 | |
| 3976 | 3975 | // Get folder complexity |
| 3977 | 3976 | $folderComplexity = DB::queryFirstRow( |
| 3978 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %i', |
|
| 3977 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %i', |
|
| 3979 | 3978 | 'complex', |
| 3980 | 3979 | $inputData['id'] |
| 3981 | 3980 | ); |
@@ -3987,7 +3986,7 @@ discard block |
||
| 3987 | 3986 | if (isset($SETTINGS['item_extra_fields']) && (int) $SETTINGS['item_extra_fields'] === 1) { |
| 3988 | 3987 | $folderRow = DB::query( |
| 3989 | 3988 | 'SELECT id_category |
| 3990 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 3989 | + FROM ' . prefixTable('categories_folders').' |
|
| 3991 | 3990 | WHERE id_folder = %i', |
| 3992 | 3991 | $inputData['id'] |
| 3993 | 3992 | ); |
@@ -4102,15 +4101,15 @@ discard block |
||
| 4102 | 4101 | // List all ITEMS |
| 4103 | 4102 | if ($folderIsPf === false) { |
| 4104 | 4103 | $where->add('i.inactif=%i', 0); |
| 4105 | - $sql_e='(SELECT date FROM ' . prefixTable('log_items') |
|
| 4104 | + $sql_e = '(SELECT date FROM '.prefixTable('log_items') |
|
| 4106 | 4105 | . " WHERE action = 'at_creation' AND id_item=i.id " |
| 4107 | - . 'union all SELECT date FROM '. prefixTable('log_items') |
|
| 4106 | + . 'union all SELECT date FROM '.prefixTable('log_items') |
|
| 4108 | 4107 | . " WHERE action = 'at_modification' AND raison = 'at_pw' |
| 4109 | 4108 | AND id_item=i.id ORDER BY date DESC LIMIT 1)"; |
| 4110 | 4109 | $where->add('l.date=%l', $sql_e); |
| 4111 | 4110 | |
| 4112 | - $query_limit = ' LIMIT ' . |
|
| 4113 | - $start . ',' . |
|
| 4111 | + $query_limit = ' LIMIT '. |
|
| 4112 | + $start.','. |
|
| 4114 | 4113 | $post_nb_items_to_display_once; |
| 4115 | 4114 | //db::debugmode(true); |
| 4116 | 4115 | $rows = DB::query( |
@@ -4122,9 +4121,9 @@ discard block |
||
| 4122 | 4121 | l.id_user AS log_user, |
| 4123 | 4122 | i.url AS link, |
| 4124 | 4123 | i.email AS email |
| 4125 | - FROM ' . prefixTable('items') . ' AS i |
|
| 4126 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id) |
|
| 4127 | - INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item) |
|
| 4124 | + FROM ' . prefixTable('items').' AS i |
|
| 4125 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id) |
|
| 4126 | + INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item) |
|
| 4128 | 4127 | WHERE %l |
| 4129 | 4128 | GROUP BY i.id, l.date, l.id_user, l.action |
| 4130 | 4129 | ORDER BY i.label ASC, l.date DESC' . $query_limit, |
@@ -4144,9 +4143,9 @@ discard block |
||
| 4144 | 4143 | l.id_user AS log_user, |
| 4145 | 4144 | i.url AS link, |
| 4146 | 4145 | i.email AS email |
| 4147 | - FROM ' . prefixTable('items') . ' AS i |
|
| 4148 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id) |
|
| 4149 | - INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item) |
|
| 4146 | + FROM ' . prefixTable('items').' AS i |
|
| 4147 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id) |
|
| 4148 | + INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item) |
|
| 4150 | 4149 | WHERE %l |
| 4151 | 4150 | GROUP BY i.id, l.date, l.id_user, l.action |
| 4152 | 4151 | ORDER BY i.label ASC, l.date DESC', |
@@ -4177,7 +4176,7 @@ discard block |
||
| 4177 | 4176 | $item_is_restricted_to_role = false; |
| 4178 | 4177 | DB::queryFirstRow( |
| 4179 | 4178 | 'SELECT role_id |
| 4180 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 4179 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 4181 | 4180 | WHERE item_id = %i', |
| 4182 | 4181 | $record['id'] |
| 4183 | 4182 | ); |
@@ -4189,7 +4188,7 @@ discard block |
||
| 4189 | 4188 | $user_is_included_in_role = false; |
| 4190 | 4189 | DB::query( |
| 4191 | 4190 | 'SELECT role_id |
| 4192 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 4191 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 4193 | 4192 | WHERE item_id = %i AND role_id IN %ls', |
| 4194 | 4193 | $record['id'], |
| 4195 | 4194 | $session->get('user-roles_array') |
@@ -4399,9 +4398,9 @@ discard block |
||
| 4399 | 4398 | if ((int) $start === 0) { |
| 4400 | 4399 | DB::query( |
| 4401 | 4400 | 'SELECT i.id |
| 4402 | - FROM ' . prefixTable('items') . ' as i |
|
| 4403 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 4404 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 4401 | + FROM ' . prefixTable('items').' as i |
|
| 4402 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 4403 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 4405 | 4404 | WHERE %l |
| 4406 | 4405 | ORDER BY i.label ASC, l.date DESC', |
| 4407 | 4406 | $where |
@@ -4466,8 +4465,8 @@ discard block |
||
| 4466 | 4465 | $dataItem = DB::queryFirstRow( |
| 4467 | 4466 | 'SELECT i.pw AS pw, s.share_key AS share_key, i.id AS id, |
| 4468 | 4467 | i.label AS label, i.id_tree AS id_tree |
| 4469 | - FROM ' . prefixTable('items') . ' AS i |
|
| 4470 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 4468 | + FROM ' . prefixTable('items').' AS i |
|
| 4469 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 4471 | 4470 | WHERE user_id = %i AND (i.item_key = %s OR i.id = %i)', |
| 4472 | 4471 | $session->get('user-id'), |
| 4473 | 4472 | $inputData['itemKey'] ?? '', |
@@ -4576,7 +4575,7 @@ discard block |
||
| 4576 | 4575 | // do query on this folder |
| 4577 | 4576 | $data_this_folder = DB::queryFirstRow( |
| 4578 | 4577 | 'SELECT id, personal_folder, title |
| 4579 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 4578 | + FROM ' . prefixTable('nested_tree').' |
|
| 4580 | 4579 | WHERE id = %s', |
| 4581 | 4580 | $inputData['folderId'] |
| 4582 | 4581 | ); |
@@ -4616,8 +4615,8 @@ discard block |
||
| 4616 | 4615 | $visibilite = ''; |
| 4617 | 4616 | $data = DB::queryFirstRow( |
| 4618 | 4617 | 'SELECT m.valeur, n.personal_folder |
| 4619 | - FROM ' . prefixTable('misc') . ' AS m |
|
| 4620 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (m.intitule = n.id) |
|
| 4618 | + FROM ' . prefixTable('misc').' AS m |
|
| 4619 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (m.intitule = n.id) |
|
| 4621 | 4620 | WHERE type=%s AND intitule = %s', |
| 4622 | 4621 | 'complex', |
| 4623 | 4622 | $inputData['folderId'] |
@@ -4630,8 +4629,8 @@ discard block |
||
| 4630 | 4629 | // Prepare Item actual visibility (what Users/Roles can see it) |
| 4631 | 4630 | $rows = DB::query( |
| 4632 | 4631 | 'SELECT t.title |
| 4633 | - FROM ' . prefixTable('roles_values') . ' as v |
|
| 4634 | - INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id) |
|
| 4632 | + FROM ' . prefixTable('roles_values').' as v |
|
| 4633 | + INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id) |
|
| 4635 | 4634 | WHERE v.folder_id = %i |
| 4636 | 4635 | GROUP BY title', |
| 4637 | 4636 | $inputData['folderId'] |
@@ -4640,7 +4639,7 @@ discard block |
||
| 4640 | 4639 | if (empty($visibilite)) { |
| 4641 | 4640 | $visibilite = $record['title']; |
| 4642 | 4641 | } else { |
| 4643 | - $visibilite .= ' - ' . $record['title']; |
|
| 4642 | + $visibilite .= ' - '.$record['title']; |
|
| 4644 | 4643 | } |
| 4645 | 4644 | } |
| 4646 | 4645 | } else { |
@@ -4650,14 +4649,14 @@ discard block |
||
| 4650 | 4649 | // do new query to know if current folder is pf |
| 4651 | 4650 | $data_pf = DB::queryFirstRow( |
| 4652 | 4651 | 'SELECT personal_folder |
| 4653 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 4652 | + FROM ' . prefixTable('nested_tree').' |
|
| 4654 | 4653 | WHERE id = %s', |
| 4655 | 4654 | $inputData['folderId'] |
| 4656 | 4655 | ); |
| 4657 | 4656 | |
| 4658 | 4657 | $folder_is_personal = $data_pf !== null ? (int) $data_pf['personal_folder'] : 0; |
| 4659 | 4658 | |
| 4660 | - $visibilite = $session->get('user-name') . ' ' . $session->get('user-lastname') . ' (' . $session->get('user-login') . ')'; |
|
| 4659 | + $visibilite = $session->get('user-name').' '.$session->get('user-lastname').' ('.$session->get('user-login').')'; |
|
| 4661 | 4660 | } |
| 4662 | 4661 | |
| 4663 | 4662 | recupDroitCreationSansComplexite($inputData['folderId']); |
@@ -4667,8 +4666,8 @@ discard block |
||
| 4667 | 4666 | $listOptionsForRoles = array(); |
| 4668 | 4667 | $rows = DB::query( |
| 4669 | 4668 | 'SELECT r.role_id AS role_id, t.title AS title |
| 4670 | - FROM ' . prefixTable('roles_values') . ' AS r |
|
| 4671 | - INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id) |
|
| 4669 | + FROM ' . prefixTable('roles_values').' AS r |
|
| 4670 | + INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id) |
|
| 4672 | 4671 | WHERE r.folder_id = %i', |
| 4673 | 4672 | $inputData['folderId'] |
| 4674 | 4673 | ); |
@@ -4682,7 +4681,7 @@ discard block |
||
| 4682 | 4681 | ); |
| 4683 | 4682 | $rows2 = DB::query( |
| 4684 | 4683 | 'SELECT id, login, fonction_id, email, name, lastname |
| 4685 | - FROM ' . prefixTable('users') . ' |
|
| 4684 | + FROM ' . prefixTable('users').' |
|
| 4686 | 4685 | WHERE admin = 0 AND fonction_id is not null' |
| 4687 | 4686 | ); |
| 4688 | 4687 | foreach ($rows2 as $record2) { |
@@ -4696,7 +4695,7 @@ discard block |
||
| 4696 | 4695 | array( |
| 4697 | 4696 | 'id' => $record2['id'], |
| 4698 | 4697 | 'login' => $record2['login'], |
| 4699 | - 'name' => $record2['name'] . ' ' . $record2['lastname'], |
|
| 4698 | + 'name' => $record2['name'].' '.$record2['lastname'], |
|
| 4700 | 4699 | 'email' => $record2['email'], |
| 4701 | 4700 | ) |
| 4702 | 4701 | ); |
@@ -4713,13 +4712,13 @@ discard block |
||
| 4713 | 4712 | //db::debugmode(true); |
| 4714 | 4713 | $access = DB::queryFirstRow( |
| 4715 | 4714 | 'SELECT type |
| 4716 | - FROM ' . prefixTable('roles_values') . ' |
|
| 4715 | + FROM ' . prefixTable('roles_values').' |
|
| 4717 | 4716 | WHERE role_id = %i AND folder_id = %i', |
| 4718 | 4717 | $role, |
| 4719 | 4718 | $inputData['folderId'] |
| 4720 | 4719 | ); |
| 4721 | 4720 | //db::debugmode(false); |
| 4722 | - if (DB::count()>0) { |
|
| 4721 | + if (DB::count() > 0) { |
|
| 4723 | 4722 | if ($access['type'] === 'R') { |
| 4724 | 4723 | array_push($arrTmp, 10); |
| 4725 | 4724 | } elseif ($access['type'] === 'W') { |
@@ -4747,7 +4746,7 @@ discard block |
||
| 4747 | 4746 | // Check if personal folder is owned by user |
| 4748 | 4747 | $folder = DB::queryFirstRow( |
| 4749 | 4748 | 'SELECT id |
| 4750 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 4749 | + FROM ' . prefixTable('nested_tree').' |
|
| 4751 | 4750 | WHERE title = %s', |
| 4752 | 4751 | $session->get('user-id'), |
| 4753 | 4752 | ); |
@@ -4852,7 +4851,7 @@ discard block |
||
| 4852 | 4851 | // Get some info before deleting |
| 4853 | 4852 | $data = DB::queryFirstRow( |
| 4854 | 4853 | 'SELECT name, id_item, file |
| 4855 | - FROM ' . prefixTable('files') . ' |
|
| 4854 | + FROM ' . prefixTable('files').' |
|
| 4856 | 4855 | WHERE id = %i', |
| 4857 | 4856 | $fileId |
| 4858 | 4857 | ); |
@@ -4860,7 +4859,7 @@ discard block |
||
| 4860 | 4859 | // Load item data |
| 4861 | 4860 | $data_item = DB::queryFirstRow( |
| 4862 | 4861 | 'SELECT id_tree |
| 4863 | - FROM ' . prefixTable('items') . ' |
|
| 4862 | + FROM ' . prefixTable('items').' |
|
| 4864 | 4863 | WHERE id = %i', |
| 4865 | 4864 | $data['id_item'] |
| 4866 | 4865 | ); |
@@ -4890,7 +4889,7 @@ discard block |
||
| 4890 | 4889 | $session->get('user-id'), |
| 4891 | 4890 | 'at_modification', |
| 4892 | 4891 | $session->get('user-login'), |
| 4893 | - 'at_del_file : ' . $data['name'] |
|
| 4892 | + 'at_del_file : '.$data['name'] |
|
| 4894 | 4893 | ); |
| 4895 | 4894 | |
| 4896 | 4895 | // DElete sharekeys |
@@ -4901,7 +4900,7 @@ discard block |
||
| 4901 | 4900 | ); |
| 4902 | 4901 | |
| 4903 | 4902 | // Delete file from server |
| 4904 | - $fileToDelete = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($data['file']); |
|
| 4903 | + $fileToDelete = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($data['file']); |
|
| 4905 | 4904 | $fileToDelete = realpath($fileToDelete); |
| 4906 | 4905 | if ($fileToDelete && strpos($fileToDelete, $SETTINGS['path_to_upload_folder']) === 0) { |
| 4907 | 4906 | fileDelete($fileToDelete, $SETTINGS); |
@@ -4955,7 +4954,7 @@ discard block |
||
| 4955 | 4954 | // Update SESSION with this new favourite |
| 4956 | 4955 | $data = DB::queryFirstRow( |
| 4957 | 4956 | 'SELECT label,id_tree |
| 4958 | - FROM ' . prefixTable('items') . ' |
|
| 4957 | + FROM ' . prefixTable('items').' |
|
| 4959 | 4958 | WHERE id = %i', |
| 4960 | 4959 | $inputData['itemId'] |
| 4961 | 4960 | ); |
@@ -4964,7 +4963,7 @@ discard block |
||
| 4964 | 4963 | [ |
| 4965 | 4964 | $inputData['itemId'] => [ |
| 4966 | 4965 | 'label' => $data['label'], |
| 4967 | - 'url' => 'index.php?page=items&group=' . $data['id_tree'] . '&id=' . $inputData['itemId'], |
|
| 4966 | + 'url' => 'index.php?page=items&group='.$data['id_tree'].'&id='.$inputData['itemId'], |
|
| 4968 | 4967 | ], |
| 4969 | 4968 | ], |
| 4970 | 4969 | 'add' |
@@ -5033,8 +5032,8 @@ discard block |
||
| 5033 | 5032 | // get data about item |
| 5034 | 5033 | $dataSource = DB::queryFirstRow( |
| 5035 | 5034 | 'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label |
| 5036 | - FROM ' . prefixTable('items') . ' as i |
|
| 5037 | - INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id) |
|
| 5035 | + FROM ' . prefixTable('items').' as i |
|
| 5036 | + INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id) |
|
| 5038 | 5037 | WHERE i.id=%i', |
| 5039 | 5038 | $inputData['itemId'] |
| 5040 | 5039 | ); |
@@ -5078,7 +5077,7 @@ discard block |
||
| 5078 | 5077 | // get data about new folder |
| 5079 | 5078 | $dataDestination = DB::queryFirstRow( |
| 5080 | 5079 | 'SELECT personal_folder, title |
| 5081 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 5080 | + FROM ' . prefixTable('nested_tree').' |
|
| 5082 | 5081 | WHERE id = %i', |
| 5083 | 5082 | $inputData['folderId'] |
| 5084 | 5083 | ); |
@@ -5131,7 +5130,7 @@ discard block |
||
| 5131 | 5130 | // Get fields for this Item |
| 5132 | 5131 | $rows = DB::query( |
| 5133 | 5132 | 'SELECT id |
| 5134 | - FROM ' . prefixTable('categories_items') . ' |
|
| 5133 | + FROM ' . prefixTable('categories_items').' |
|
| 5135 | 5134 | WHERE item_id = %i', |
| 5136 | 5135 | $inputData['itemId'] |
| 5137 | 5136 | ); |
@@ -5148,7 +5147,7 @@ discard block |
||
| 5148 | 5147 | // Get FILES for this Item |
| 5149 | 5148 | $rows = DB::query( |
| 5150 | 5149 | 'SELECT id |
| 5151 | - FROM ' . prefixTable('files') . ' |
|
| 5150 | + FROM ' . prefixTable('files').' |
|
| 5152 | 5151 | WHERE id_item = %i', |
| 5153 | 5152 | $inputData['itemId'] |
| 5154 | 5153 | ); |
@@ -5195,7 +5194,7 @@ discard block |
||
| 5195 | 5194 | // Get the ITEM object key for the user |
| 5196 | 5195 | $userKey = DB::queryFirstRow( |
| 5197 | 5196 | 'SELECT share_key |
| 5198 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 5197 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 5199 | 5198 | WHERE user_id = %i AND object_id = %i', |
| 5200 | 5199 | $session->get('user-id'), |
| 5201 | 5200 | $inputData['itemId'] |
@@ -5206,7 +5205,7 @@ discard block |
||
| 5206 | 5205 | // This is a public object |
| 5207 | 5206 | $users = DB::query( |
| 5208 | 5207 | 'SELECT id, public_key |
| 5209 | - FROM ' . prefixTable('users') . ' |
|
| 5208 | + FROM ' . prefixTable('users').' |
|
| 5210 | 5209 | WHERE id NOT IN %li |
| 5211 | 5210 | AND public_key != ""', |
| 5212 | 5211 | $tpUsersIDs |
@@ -5229,14 +5228,14 @@ discard block |
||
| 5229 | 5228 | // Get fields for this Item |
| 5230 | 5229 | $rows = DB::query( |
| 5231 | 5230 | 'SELECT id |
| 5232 | - FROM ' . prefixTable('categories_items') . ' |
|
| 5231 | + FROM ' . prefixTable('categories_items').' |
|
| 5233 | 5232 | WHERE item_id = %i', |
| 5234 | 5233 | $inputData['itemId'] |
| 5235 | 5234 | ); |
| 5236 | 5235 | foreach ($rows as $field) { |
| 5237 | 5236 | $userKey = DB::queryFirstRow( |
| 5238 | 5237 | 'SELECT share_key |
| 5239 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 5238 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 5240 | 5239 | WHERE user_id = %i AND object_id = %i', |
| 5241 | 5240 | $session->get('user-id'), |
| 5242 | 5241 | $field['id'] |
@@ -5247,7 +5246,7 @@ discard block |
||
| 5247 | 5246 | // This is a public object |
| 5248 | 5247 | $users = DB::query( |
| 5249 | 5248 | 'SELECT id, public_key |
| 5250 | - FROM ' . prefixTable('users') . ' |
|
| 5249 | + FROM ' . prefixTable('users').' |
|
| 5251 | 5250 | WHERE id NOT IN %li |
| 5252 | 5251 | AND public_key != ""', |
| 5253 | 5252 | $tpUsersIDs |
@@ -5270,14 +5269,14 @@ discard block |
||
| 5270 | 5269 | // Get FILES for this Item |
| 5271 | 5270 | $rows = DB::query( |
| 5272 | 5271 | 'SELECT id |
| 5273 | - FROM ' . prefixTable('files') . ' |
|
| 5272 | + FROM ' . prefixTable('files').' |
|
| 5274 | 5273 | WHERE id_item = %i', |
| 5275 | 5274 | $inputData['itemId'] |
| 5276 | 5275 | ); |
| 5277 | 5276 | foreach ($rows as $attachment) { |
| 5278 | 5277 | $userKey = DB::queryFirstRow( |
| 5279 | 5278 | 'SELECT share_key |
| 5280 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 5279 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 5281 | 5280 | WHERE user_id = %i AND object_id = %i', |
| 5282 | 5281 | $session->get('user-id'), |
| 5283 | 5282 | $attachment['id'] |
@@ -5288,7 +5287,7 @@ discard block |
||
| 5288 | 5287 | // This is a public object |
| 5289 | 5288 | $users = DB::query( |
| 5290 | 5289 | 'SELECT id, public_key |
| 5291 | - FROM ' . prefixTable('users') . ' |
|
| 5290 | + FROM ' . prefixTable('users').' |
|
| 5292 | 5291 | WHERE id NOT IN %li |
| 5293 | 5292 | AND public_key != ""', |
| 5294 | 5293 | $tpUsersIDs |
@@ -5329,7 +5328,7 @@ discard block |
||
| 5329 | 5328 | $session->get('user-id'), |
| 5330 | 5329 | 'at_modification', |
| 5331 | 5330 | $session->get('user-login'), |
| 5332 | - 'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title'] |
|
| 5331 | + 'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title'] |
|
| 5333 | 5332 | ); |
| 5334 | 5333 | |
| 5335 | 5334 | // Update cache table |
@@ -5388,8 +5387,8 @@ discard block |
||
| 5388 | 5387 | // get data about item |
| 5389 | 5388 | $dataSource = DB::queryFirstRow( |
| 5390 | 5389 | 'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label |
| 5391 | - FROM ' . prefixTable('items') . ' as i |
|
| 5392 | - INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id) |
|
| 5390 | + FROM ' . prefixTable('items').' as i |
|
| 5391 | + INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id) |
|
| 5393 | 5392 | WHERE i.id=%i', |
| 5394 | 5393 | $item_id |
| 5395 | 5394 | ); |
@@ -5411,7 +5410,7 @@ discard block |
||
| 5411 | 5410 | |
| 5412 | 5411 | // get data about new folder |
| 5413 | 5412 | $dataDestination = DB::queryFirstRow( |
| 5414 | - 'SELECT personal_folder, title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 5413 | + 'SELECT personal_folder, title FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
| 5415 | 5414 | $inputData['folderId'] |
| 5416 | 5415 | ); |
| 5417 | 5416 | |
@@ -5453,7 +5452,7 @@ discard block |
||
| 5453 | 5452 | // Get fields for this Item |
| 5454 | 5453 | $rows = DB::query( |
| 5455 | 5454 | 'SELECT id |
| 5456 | - FROM ' . prefixTable('categories_items') . ' |
|
| 5455 | + FROM ' . prefixTable('categories_items').' |
|
| 5457 | 5456 | WHERE item_id = %i', |
| 5458 | 5457 | $item_id |
| 5459 | 5458 | ); |
@@ -5470,7 +5469,7 @@ discard block |
||
| 5470 | 5469 | // Get FILES for this Item |
| 5471 | 5470 | $rows = DB::query( |
| 5472 | 5471 | 'SELECT id |
| 5473 | - FROM ' . prefixTable('files') . ' |
|
| 5472 | + FROM ' . prefixTable('files').' |
|
| 5474 | 5473 | WHERE id_item = %i', |
| 5475 | 5474 | $item_id |
| 5476 | 5475 | ); |
@@ -5525,7 +5524,7 @@ discard block |
||
| 5525 | 5524 | // Get the ITEM object key for the user |
| 5526 | 5525 | $userKey = DB::queryFirstRow( |
| 5527 | 5526 | 'SELECT share_key |
| 5528 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 5527 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 5529 | 5528 | WHERE user_id = %i AND object_id = %i', |
| 5530 | 5529 | $session->get('user-id'), |
| 5531 | 5530 | $item_id |
@@ -5536,7 +5535,7 @@ discard block |
||
| 5536 | 5535 | // This is a public object |
| 5537 | 5536 | $users = DB::query( |
| 5538 | 5537 | 'SELECT id, public_key |
| 5539 | - FROM ' . prefixTable('users') . ' |
|
| 5538 | + FROM ' . prefixTable('users').' |
|
| 5540 | 5539 | WHERE id NOT IN %li |
| 5541 | 5540 | AND public_key != ""', |
| 5542 | 5541 | $tpUsersIDs |
@@ -5559,14 +5558,14 @@ discard block |
||
| 5559 | 5558 | // Get fields for this Item |
| 5560 | 5559 | $rows = DB::query( |
| 5561 | 5560 | 'SELECT id |
| 5562 | - FROM ' . prefixTable('categories_items') . ' |
|
| 5561 | + FROM ' . prefixTable('categories_items').' |
|
| 5563 | 5562 | WHERE item_id = %i', |
| 5564 | 5563 | $item_id |
| 5565 | 5564 | ); |
| 5566 | 5565 | foreach ($rows as $field) { |
| 5567 | 5566 | $userKey = DB::queryFirstRow( |
| 5568 | 5567 | 'SELECT share_key |
| 5569 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 5568 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 5570 | 5569 | WHERE user_id = %i AND object_id = %i', |
| 5571 | 5570 | $session->get('user-id'), |
| 5572 | 5571 | $field['id'] |
@@ -5577,7 +5576,7 @@ discard block |
||
| 5577 | 5576 | // This is a public object |
| 5578 | 5577 | $users = DB::query( |
| 5579 | 5578 | 'SELECT id, public_key |
| 5580 | - FROM ' . prefixTable('users') . ' |
|
| 5579 | + FROM ' . prefixTable('users').' |
|
| 5581 | 5580 | WHERE id NOT IN %li |
| 5582 | 5581 | AND public_key != ""', |
| 5583 | 5582 | $tpUsersIDs |
@@ -5601,14 +5600,14 @@ discard block |
||
| 5601 | 5600 | // Get FILES for this Item |
| 5602 | 5601 | $rows = DB::query( |
| 5603 | 5602 | 'SELECT id |
| 5604 | - FROM ' . prefixTable('files') . ' |
|
| 5603 | + FROM ' . prefixTable('files').' |
|
| 5605 | 5604 | WHERE id_item = %i', |
| 5606 | 5605 | $item_id |
| 5607 | 5606 | ); |
| 5608 | 5607 | foreach ($rows as $attachment) { |
| 5609 | 5608 | $userKey = DB::queryFirstRow( |
| 5610 | 5609 | 'SELECT share_key |
| 5611 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 5610 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 5612 | 5611 | WHERE user_id = %i AND object_id = %i', |
| 5613 | 5612 | $session->get('user-id'), |
| 5614 | 5613 | $attachment['id'] |
@@ -5619,7 +5618,7 @@ discard block |
||
| 5619 | 5618 | // This is a public object |
| 5620 | 5619 | $users = DB::query( |
| 5621 | 5620 | 'SELECT id, public_key |
| 5622 | - FROM ' . prefixTable('users') . ' |
|
| 5621 | + FROM ' . prefixTable('users').' |
|
| 5623 | 5622 | WHERE id NOT IN %li |
| 5624 | 5623 | AND public_key != ""', |
| 5625 | 5624 | $tpUsersIDs |
@@ -5659,13 +5658,13 @@ discard block |
||
| 5659 | 5658 | $session->get('user-id'), |
| 5660 | 5659 | 'at_modification', |
| 5661 | 5660 | $session->get('user-login'), |
| 5662 | - 'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title'] |
|
| 5661 | + 'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title'] |
|
| 5663 | 5662 | ); |
| 5664 | 5663 | } |
| 5665 | 5664 | } |
| 5666 | 5665 | |
| 5667 | 5666 | // reload cache table |
| 5668 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 5667 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 5669 | 5668 | updateCacheTable('reload', null); |
| 5670 | 5669 | |
| 5671 | 5670 | echo (string) prepareExchangedData( |
@@ -5729,7 +5728,7 @@ discard block |
||
| 5729 | 5728 | // get info |
| 5730 | 5729 | $dataSource = DB::queryFirstRow( |
| 5731 | 5730 | 'SELECT label, id_tree |
| 5732 | - FROM ' . prefixTable('items') . ' |
|
| 5731 | + FROM ' . prefixTable('items').' |
|
| 5733 | 5732 | WHERE id=%i', |
| 5734 | 5733 | $item_id |
| 5735 | 5734 | ); |
@@ -5830,14 +5829,14 @@ discard block |
||
| 5830 | 5829 | // Variables |
| 5831 | 5830 | $dataAuthor = DB::queryFirstRow( |
| 5832 | 5831 | 'SELECT email,login |
| 5833 | - FROM ' . prefixTable('users') . ' |
|
| 5832 | + FROM ' . prefixTable('users').' |
|
| 5834 | 5833 | WHERE id = %i', |
| 5835 | 5834 | $post_content[1] |
| 5836 | 5835 | ); |
| 5837 | 5836 | |
| 5838 | 5837 | $dataItem = DB::queryFirstRow( |
| 5839 | 5838 | 'SELECT label, id_tree |
| 5840 | - FROM ' . prefixTable('items') . ' |
|
| 5839 | + FROM ' . prefixTable('items').' |
|
| 5841 | 5840 | WHERE id = %i', |
| 5842 | 5841 | $post_content[0] |
| 5843 | 5842 | ); |
@@ -5854,7 +5853,7 @@ discard block |
||
| 5854 | 5853 | $lang->get('email_request_access_subject'), |
| 5855 | 5854 | str_replace( |
| 5856 | 5855 | array('#tp_item_author#', '#tp_user#', '#tp_item#'), |
| 5857 | - array(' ' . addslashes($dataAuthor['login']), addslashes($session->get('user-login')), $path), |
|
| 5856 | + array(' '.addslashes($dataAuthor['login']), addslashes($session->get('user-login')), $path), |
|
| 5858 | 5857 | $lang->get('email_request_access_mail') |
| 5859 | 5858 | ), |
| 5860 | 5859 | $dataAuthor['email'], |
@@ -5863,7 +5862,7 @@ discard block |
||
| 5863 | 5862 | } elseif ($inputData['cat'] === 'share_this_item') { |
| 5864 | 5863 | $dataItem = DB::queryFirstRow( |
| 5865 | 5864 | 'SELECT label,id_tree |
| 5866 | - FROM ' . prefixTable('items') . ' |
|
| 5865 | + FROM ' . prefixTable('items').' |
|
| 5867 | 5866 | WHERE id= %i', |
| 5868 | 5867 | $inputData['id'] |
| 5869 | 5868 | ); |
@@ -5886,7 +5885,7 @@ discard block |
||
| 5886 | 5885 | ), |
| 5887 | 5886 | array( |
| 5888 | 5887 | empty($SETTINGS['email_server_url']) === false ? |
| 5889 | - $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $inputData['id'] : $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $inputData['id'], |
|
| 5888 | + $SETTINGS['email_server_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$inputData['id'] : $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$inputData['id'], |
|
| 5890 | 5889 | addslashes($session->get('user-login')), |
| 5891 | 5890 | addslashes($path), |
| 5892 | 5891 | ), |
@@ -5935,8 +5934,8 @@ discard block |
||
| 5935 | 5934 | // Get all informations for this item |
| 5936 | 5935 | $dataItem = DB::queryFirstRow( |
| 5937 | 5936 | 'SELECT * |
| 5938 | - FROM ' . prefixTable('items') . ' as i |
|
| 5939 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 5937 | + FROM ' . prefixTable('items').' as i |
|
| 5938 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 5940 | 5939 | WHERE i.id=%i AND l.action = %s', |
| 5941 | 5940 | $item_id, |
| 5942 | 5941 | 'at_creation' |
@@ -5965,18 +5964,18 @@ discard block |
||
| 5965 | 5964 | $session->get('user-login'), |
| 5966 | 5965 | htmlspecialchars_decode($label, ENT_QUOTES), |
| 5967 | 5966 | null, |
| 5968 | - (string) dateToStamp($date.' '.$time, $SETTINGS['date_format'] . ' ' . $SETTINGS['time_format']) |
|
| 5967 | + (string) dateToStamp($date.' '.$time, $SETTINGS['date_format'].' '.$SETTINGS['time_format']) |
|
| 5969 | 5968 | ); |
| 5970 | 5969 | // Prepare new line |
| 5971 | 5970 | $data = DB::queryFirstRow( |
| 5972 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i ORDER BY date DESC', |
|
| 5971 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i ORDER BY date DESC', |
|
| 5973 | 5972 | $item_id |
| 5974 | 5973 | ); |
| 5975 | - $historic = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']) . ' - ' . $session->get('user-login') . ' - ' . $lang->get($data['action']) . ' - ' . $data['raison']; |
|
| 5974 | + $historic = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']).' - '.$session->get('user-login').' - '.$lang->get($data['action']).' - '.$data['raison']; |
|
| 5976 | 5975 | // send back |
| 5977 | 5976 | $data = array( |
| 5978 | 5977 | 'error' => '', |
| 5979 | - 'new_line' => '<br>' . addslashes($historic), |
|
| 5978 | + 'new_line' => '<br>'.addslashes($historic), |
|
| 5980 | 5979 | ); |
| 5981 | 5980 | echo (string) prepareExchangedData( |
| 5982 | 5981 | $data, |
@@ -6051,8 +6050,8 @@ discard block |
||
| 6051 | 6050 | // Should we log a password change? |
| 6052 | 6051 | $itemQ = DB::queryFirstRow( |
| 6053 | 6052 | 'SELECT s.share_key, i.pw |
| 6054 | - FROM ' . prefixTable('items') . ' AS i |
|
| 6055 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (i.id = s.object_id) |
|
| 6053 | + FROM ' . prefixTable('items').' AS i |
|
| 6054 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (i.id = s.object_id) |
|
| 6056 | 6055 | WHERE s.user_id = %i AND s.object_id = %i', |
| 6057 | 6056 | $session->get('user-id'), |
| 6058 | 6057 | $dataReceived['id'] |
@@ -6107,7 +6106,7 @@ discard block |
||
| 6107 | 6106 | if (isset($SETTINGS['otv_expiration_period']) === false) { |
| 6108 | 6107 | $SETTINGS['otv_expiration_period'] = 7; |
| 6109 | 6108 | } |
| 6110 | - $url = $SETTINGS['cpassman_url'] . '/index.php?' . http_build_query($otv_session); |
|
| 6109 | + $url = $SETTINGS['cpassman_url'].'/index.php?'.http_build_query($otv_session); |
|
| 6111 | 6110 | |
| 6112 | 6111 | echo json_encode( |
| 6113 | 6112 | array( |
@@ -6138,7 +6137,7 @@ discard block |
||
| 6138 | 6137 | // get parameters from original link |
| 6139 | 6138 | $url = $dataReceived['original_link']; |
| 6140 | 6139 | $parts = parse_url($url); |
| 6141 | - if(isset($parts['query'])){ |
|
| 6140 | + if (isset($parts['query'])) { |
|
| 6142 | 6141 | parse_str($parts['query'], $orignal_link_parameters); |
| 6143 | 6142 | } else { |
| 6144 | 6143 | $orignal_link_parameters = array(); |
@@ -6169,13 +6168,13 @@ discard block |
||
| 6169 | 6168 | $domain_scheme = parse_url($SETTINGS['cpassman_url'], PHP_URL_SCHEME); |
| 6170 | 6169 | $domain_host = parse_url($SETTINGS['cpassman_url'], PHP_URL_HOST); |
| 6171 | 6170 | if (str_contains($domain_host, 'www.') === true) { |
| 6172 | - $domain_host = (string) $SETTINGS['otv_subdomain'] . '.' . substr($domain_host, 4); |
|
| 6171 | + $domain_host = (string) $SETTINGS['otv_subdomain'].'.'.substr($domain_host, 4); |
|
| 6173 | 6172 | } else { |
| 6174 | - $domain_host = (string) $SETTINGS['otv_subdomain'] . '.' . $domain_host; |
|
| 6173 | + $domain_host = (string) $SETTINGS['otv_subdomain'].'.'.$domain_host; |
|
| 6175 | 6174 | } |
| 6176 | - $url = $domain_scheme.'://'.$domain_host . '/index.php?'.http_build_query($otv_session); |
|
| 6175 | + $url = $domain_scheme.'://'.$domain_host.'/index.php?'.http_build_query($otv_session); |
|
| 6177 | 6176 | } else { |
| 6178 | - $url = $SETTINGS['cpassman_url'] . '/index.php?'.http_build_query($otv_session); |
|
| 6177 | + $url = $SETTINGS['cpassman_url'].'/index.php?'.http_build_query($otv_session); |
|
| 6179 | 6178 | } |
| 6180 | 6179 | |
| 6181 | 6180 | echo (string) prepareExchangedData( |
@@ -6210,8 +6209,8 @@ discard block |
||
| 6210 | 6209 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, |
| 6211 | 6210 | f.extension AS extension, f.type AS type, |
| 6212 | 6211 | s.share_key AS share_key |
| 6213 | - FROM ' . prefixTable('files') . ' AS f |
|
| 6214 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 6212 | + FROM ' . prefixTable('files').' AS f |
|
| 6213 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 6215 | 6214 | WHERE s.user_id = %i AND s.object_id = %i', |
| 6216 | 6215 | $session->get('user-id'), |
| 6217 | 6216 | $inputData['id'] |
@@ -6232,7 +6231,7 @@ discard block |
||
| 6232 | 6231 | //$fileName = basename($file_info['name'], '.'.$file_info['extension']); |
| 6233 | 6232 | |
| 6234 | 6233 | // prepare image info |
| 6235 | - $post_title = basename($file_info['name'], '.' . $file_info['extension']); |
|
| 6234 | + $post_title = basename($file_info['name'], '.'.$file_info['extension']); |
|
| 6236 | 6235 | $post_title = isBase64($post_title) === true ? base64_decode($post_title) : $post_title; |
| 6237 | 6236 | |
| 6238 | 6237 | // Get image content |
@@ -6259,7 +6258,7 @@ discard block |
||
| 6259 | 6258 | echo (string) prepareExchangedData( |
| 6260 | 6259 | array( |
| 6261 | 6260 | 'error' => false, |
| 6262 | - 'filename' => $post_title . '.' . $file_info['extension'], |
|
| 6261 | + 'filename' => $post_title.'.'.$file_info['extension'], |
|
| 6263 | 6262 | 'file_type' => $file_info['type'], |
| 6264 | 6263 | 'file_content' => $fileContent, |
| 6265 | 6264 | ), |
@@ -6373,7 +6372,7 @@ discard block |
||
| 6373 | 6372 | $arbo = $tree->getPath($folder->id, false); |
| 6374 | 6373 | $path = ''; |
| 6375 | 6374 | foreach ($arbo as $elem) { |
| 6376 | - $path = (empty($path) ? '' : $path . ' / ') . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 6375 | + $path = (empty($path) ? '' : $path.' / ').htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 6377 | 6376 | } |
| 6378 | 6377 | |
| 6379 | 6378 | // Build array |
@@ -6442,7 +6441,7 @@ discard block |
||
| 6442 | 6441 | if (is_array($foldersArray) === true && $inputData['data'] !== '[null]') { |
| 6443 | 6442 | $rows = DB::query( |
| 6444 | 6443 | 'SELECT id, categories |
| 6445 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 6444 | + FROM ' . prefixTable('nested_tree').' |
|
| 6446 | 6445 | WHERE id IN (%l)', |
| 6447 | 6446 | implode(',', $foldersArray) |
| 6448 | 6447 | ); |
@@ -6484,7 +6483,7 @@ discard block |
||
| 6484 | 6483 | // get item info |
| 6485 | 6484 | $dataItem = DB::queryFirstRow( |
| 6486 | 6485 | 'SELECT * |
| 6487 | - FROM ' . prefixTable('items') . ' |
|
| 6486 | + FROM ' . prefixTable('items').' |
|
| 6488 | 6487 | WHERE id=%i', |
| 6489 | 6488 | $inputData['itemId'] |
| 6490 | 6489 | ); |
@@ -6496,8 +6495,8 @@ discard block |
||
| 6496 | 6495 | 'SELECT l.date as date, l.action as action, l.raison as raison, |
| 6497 | 6496 | u.login as login, u.avatar_thumb as avatar_thumb, u.name as name, u.lastname as lastname, |
| 6498 | 6497 | l.old_value as old_value |
| 6499 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 6500 | - INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 6498 | + FROM ' . prefixTable('log_items').' as l |
|
| 6499 | + INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 6501 | 6500 | WHERE id_item=%i AND l.action NOT IN (%l) |
| 6502 | 6501 | ORDER BY date DESC', |
| 6503 | 6502 | $inputData['itemId'], |
@@ -6512,18 +6511,18 @@ discard block |
||
| 6512 | 6511 | |
| 6513 | 6512 | // imported via API |
| 6514 | 6513 | if (empty($record['login']) === true) { |
| 6515 | - $record['login'] = $lang->get('imported_via_api') . ' [' . $record['raison'] . ']'; |
|
| 6514 | + $record['login'] = $lang->get('imported_via_api').' ['.$record['raison'].']'; |
|
| 6516 | 6515 | } |
| 6517 | 6516 | |
| 6518 | 6517 | // Prepare avatar |
| 6519 | 6518 | if (isset($record['avatar_thumb']) && empty($record['avatar_thumb']) === false) { |
| 6520 | - if (file_exists($SETTINGS['cpassman_dir'] . '/includes/avatars/' . $record['avatar_thumb'])) { |
|
| 6521 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $record['avatar_thumb']; |
|
| 6519 | + if (file_exists($SETTINGS['cpassman_dir'].'/includes/avatars/'.$record['avatar_thumb'])) { |
|
| 6520 | + $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$record['avatar_thumb']; |
|
| 6522 | 6521 | } else { |
| 6523 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg'; |
|
| 6522 | + $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg'; |
|
| 6524 | 6523 | } |
| 6525 | 6524 | } else { |
| 6526 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg'; |
|
| 6525 | + $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg'; |
|
| 6527 | 6526 | } |
| 6528 | 6527 | |
| 6529 | 6528 | // Prepare action |
@@ -6543,7 +6542,7 @@ discard block |
||
| 6543 | 6542 | $previous_passwords, |
| 6544 | 6543 | [ |
| 6545 | 6544 | 'password' => htmlentities($previous_pwd['string']), |
| 6546 | - 'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']), |
|
| 6545 | + 'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']), |
|
| 6547 | 6546 | ] |
| 6548 | 6547 | ); |
| 6549 | 6548 | } |
@@ -6556,19 +6555,19 @@ discard block |
||
| 6556 | 6555 | $action = $lang->get($reason[0]); |
| 6557 | 6556 | if ($reason[0] === 'at_moved') { |
| 6558 | 6557 | $tmp = explode(' -> ', $reason[1]); |
| 6559 | - $detail = $lang->get('from') . ' <span class="font-weight-light">' . $tmp[0] . '</span> ' . $lang->get('to') . ' <span class="font-weight-light">' . $tmp[1] . ' </span>'; |
|
| 6558 | + $detail = $lang->get('from').' <span class="font-weight-light">'.$tmp[0].'</span> '.$lang->get('to').' <span class="font-weight-light">'.$tmp[1].' </span>'; |
|
| 6560 | 6559 | } elseif ($reason[0] === 'at_field') { |
| 6561 | 6560 | $tmp = explode(' => ', $reason[1]); |
| 6562 | 6561 | if (count($tmp) > 1) { |
| 6563 | - $detail = '<b>' . trim($tmp[0]) . '</b> | ' . $lang->get('previous_value') . |
|
| 6564 | - ': <span class="font-weight-light">' . trim($tmp[1]) . '</span>'; |
|
| 6562 | + $detail = '<b>'.trim($tmp[0]).'</b> | '.$lang->get('previous_value'). |
|
| 6563 | + ': <span class="font-weight-light">'.trim($tmp[1]).'</span>'; |
|
| 6565 | 6564 | } else { |
| 6566 | 6565 | $detail = trim($reason[1]); |
| 6567 | 6566 | } |
| 6568 | 6567 | } elseif (in_array($reason[0], array('at_restriction', 'at_email', 'at_login', 'at_label', 'at_url', 'at_tag')) === true) { |
| 6569 | 6568 | $tmp = explode(' => ', $reason[1]); |
| 6570 | 6569 | $detail = empty(trim($tmp[0])) === true ? |
| 6571 | - $lang->get('no_previous_value') : $lang->get('previous_value') . ': <span class="font-weight-light">' . $tmp[0] . ' </span>'; |
|
| 6570 | + $lang->get('no_previous_value') : $lang->get('previous_value').': <span class="font-weight-light">'.$tmp[0].' </span>'; |
|
| 6572 | 6571 | } elseif ($reason[0] === 'at_automatic_del') { |
| 6573 | 6572 | $detail = $lang->get($reason[1]); |
| 6574 | 6573 | } elseif ($reason[0] === 'at_anyoneconmodify' || $reason[0] === 'at_otp_status') { |
@@ -6577,7 +6576,7 @@ discard block |
||
| 6577 | 6576 | $tmp = explode(':', $reason[1]); |
| 6578 | 6577 | $tmp = explode('.', $tmp[0]); |
| 6579 | 6578 | $detail = isBase64($tmp[0]) === true ? |
| 6580 | - base64_decode($tmp[0]) . '.' . $tmp[1] : $tmp[0]; |
|
| 6579 | + base64_decode($tmp[0]).'.'.$tmp[1] : $tmp[0]; |
|
| 6581 | 6580 | } elseif ($reason[0] === 'at_import') { |
| 6582 | 6581 | $detail = ''; |
| 6583 | 6582 | } elseif (in_array($reason[0], array('csv', 'pdf')) === true) { |
@@ -6596,8 +6595,8 @@ discard block |
||
| 6596 | 6595 | array( |
| 6597 | 6596 | 'avatar' => $avatar, |
| 6598 | 6597 | 'login' => $record['login'], |
| 6599 | - 'name' => $record['name'] . ' ' . $record['lastname'], |
|
| 6600 | - 'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']), |
|
| 6598 | + 'name' => $record['name'].' '.$record['lastname'], |
|
| 6599 | + 'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']), |
|
| 6601 | 6600 | 'action' => $action, |
| 6602 | 6601 | 'detail' => $detail, |
| 6603 | 6602 | ) |
@@ -6685,11 +6684,11 @@ discard block |
||
| 6685 | 6684 | |
| 6686 | 6685 | // get some info to add to the notification email |
| 6687 | 6686 | $resp_user = DB::queryFirstRow( |
| 6688 | - 'SELECT login FROM ' . prefixTable('users') . ' WHERE id = %i', |
|
| 6687 | + 'SELECT login FROM '.prefixTable('users').' WHERE id = %i', |
|
| 6689 | 6688 | $session->get('user-id') |
| 6690 | 6689 | ); |
| 6691 | 6690 | $resp_folder = DB::queryFirstRow( |
| 6692 | - 'SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 6691 | + 'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
| 6693 | 6692 | $folder |
| 6694 | 6693 | ); |
| 6695 | 6694 | |
@@ -6698,7 +6697,7 @@ discard block |
||
| 6698 | 6697 | $emailService = new EmailService(); |
| 6699 | 6698 | $rows = DB::query( |
| 6700 | 6699 | 'SELECT email |
| 6701 | - FROM ' . prefixTable('users') . ' |
|
| 6700 | + FROM ' . prefixTable('users').' |
|
| 6702 | 6701 | WHERE `gestionnaire` = %i AND `email` IS NOT NULL', |
| 6703 | 6702 | 1 |
| 6704 | 6703 | ); |
@@ -6744,7 +6743,7 @@ discard block |
||
| 6744 | 6743 | // Send email |
| 6745 | 6744 | $dataItem = DB::queryFirstRow( |
| 6746 | 6745 | 'SELECT label, id_tree |
| 6747 | - FROM ' . prefixTable('items') . ' |
|
| 6746 | + FROM ' . prefixTable('items').' |
|
| 6748 | 6747 | WHERE id = %i', |
| 6749 | 6748 | $inputData['itemId'] |
| 6750 | 6749 | ); |
@@ -6798,7 +6797,7 @@ discard block |
||
| 6798 | 6797 | |
| 6799 | 6798 | DB::query( |
| 6800 | 6799 | 'SELECT * |
| 6801 | - FROM ' . prefixTable('notification') . ' |
|
| 6800 | + FROM ' . prefixTable('notification').' |
|
| 6802 | 6801 | WHERE item_id = %i AND user_id = %i', |
| 6803 | 6802 | $inputData['itemId'], |
| 6804 | 6803 | $session->get('user-id') |
@@ -6870,7 +6869,7 @@ discard block |
||
| 6870 | 6869 | // And related logs |
| 6871 | 6870 | $rows = DB::query( |
| 6872 | 6871 | 'SELECT id, file AS filename |
| 6873 | - FROM ' . prefixTable('files') . ' |
|
| 6872 | + FROM ' . prefixTable('files').' |
|
| 6874 | 6873 | WHERE id_item = %i AND confirmed = %i', |
| 6875 | 6874 | $inputData['itemId'], |
| 6876 | 6875 | 0 |
@@ -6884,12 +6883,12 @@ discard block |
||
| 6884 | 6883 | ); |
| 6885 | 6884 | |
| 6886 | 6885 | // Delete file on server |
| 6887 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file['filename'])); |
|
| 6886 | + unlink($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file['filename'])); |
|
| 6888 | 6887 | |
| 6889 | 6888 | // Delete related logs |
| 6890 | 6889 | $logFile = DB::query( |
| 6891 | 6890 | 'SELECT increment_id, raison |
| 6892 | - FROM ' . prefixTable('log_items') . ' |
|
| 6891 | + FROM ' . prefixTable('log_items').' |
|
| 6893 | 6892 | WHERE id_item = %i AND id_user = %i AND action = %s AND raison LIKE "at_add_file :%"', |
| 6894 | 6893 | $inputData['itemId'], |
| 6895 | 6894 | $session->get('user-id'), |
@@ -6948,7 +6947,7 @@ discard block |
||
| 6948 | 6947 | // Confirm attachments |
| 6949 | 6948 | $rows = DB::query( |
| 6950 | 6949 | 'SELECT id, file AS filename |
| 6951 | - FROM ' . prefixTable('files') . ' |
|
| 6950 | + FROM ' . prefixTable('files').' |
|
| 6952 | 6951 | WHERE id_item = %i AND confirmed = %i', |
| 6953 | 6952 | $inputData['itemId'], |
| 6954 | 6953 | 0 |
@@ -7034,15 +7033,15 @@ discard block |
||
| 7034 | 7033 | case 'autocomplete_tags': |
| 7035 | 7034 | // Get a list off all existing TAGS |
| 7036 | 7035 | $listOfTags = ''; |
| 7037 | - $rows = DB::query('SELECT tag FROM ' . prefixTable('tags') . ' WHERE tag LIKE %ss GROUP BY tag', $inputData['getTerm']); |
|
| 7036 | + $rows = DB::query('SELECT tag FROM '.prefixTable('tags').' WHERE tag LIKE %ss GROUP BY tag', $inputData['getTerm']); |
|
| 7038 | 7037 | foreach ($rows as $record) { |
| 7039 | 7038 | if (empty($listOfTags)) { |
| 7040 | - $listOfTags = '"' . $record['tag'] . '"'; |
|
| 7039 | + $listOfTags = '"'.$record['tag'].'"'; |
|
| 7041 | 7040 | } else { |
| 7042 | - $listOfTags .= ', "' . $record['tag'] . '"'; |
|
| 7041 | + $listOfTags .= ', "'.$record['tag'].'"'; |
|
| 7043 | 7042 | } |
| 7044 | 7043 | } |
| 7045 | - echo '[' . $listOfTags . ']'; |
|
| 7044 | + echo '['.$listOfTags.']'; |
|
| 7046 | 7045 | break; |
| 7047 | 7046 | } |
| 7048 | 7047 | } |
@@ -7058,7 +7057,7 @@ discard block |
||
| 7058 | 7057 | { |
| 7059 | 7058 | $data = DB::queryFirstRow( |
| 7060 | 7059 | 'SELECT bloquer_creation, bloquer_modification, personal_folder |
| 7061 | - FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 7060 | + FROM ' . prefixTable('nested_tree').' WHERE id = %i', |
|
| 7062 | 7061 | $groupe |
| 7063 | 7062 | ); |
| 7064 | 7063 | // Check if it's in a personal folder. If yes, then force complexity overhead. |
@@ -7169,7 +7168,7 @@ discard block |
||
| 7169 | 7168 | $now = time(); |
| 7170 | 7169 | $editionLocks = DB::query( |
| 7171 | 7170 | 'SELECT timestamp, user_id, increment_id |
| 7172 | - FROM ' . prefixTable('items_edition') . ' |
|
| 7171 | + FROM ' . prefixTable('items_edition').' |
|
| 7173 | 7172 | WHERE item_id = %i |
| 7174 | 7173 | ORDER BY increment_id DESC', |
| 7175 | 7174 | $itemId |
@@ -7211,7 +7210,7 @@ discard block |
||
| 7211 | 7210 | |
| 7212 | 7211 | // Delete related background tasks if any |
| 7213 | 7212 | $task = DB::queryFirstRow( |
| 7214 | - 'SELECT increment_id FROM ' . prefixTable('background_tasks') . ' |
|
| 7213 | + 'SELECT increment_id FROM '.prefixTable('background_tasks').' |
|
| 7215 | 7214 | WHERE item_id = %i AND finished_at = ""', |
| 7216 | 7215 | $itemId |
| 7217 | 7216 | ); |
@@ -7224,7 +7223,7 @@ discard block |
||
| 7224 | 7223 | // Check if encryption process is still running |
| 7225 | 7224 | DB::queryFirstRow( |
| 7226 | 7225 | 'SELECT JSON_EXTRACT(arguments, "$.all_users_except_id") AS all_users_except_id |
| 7227 | - FROM ' . prefixTable('background_tasks') . ' |
|
| 7226 | + FROM ' . prefixTable('background_tasks').' |
|
| 7228 | 7227 | WHERE item_id = %i AND finished_at = "" |
| 7229 | 7228 | ORDER BY increment_id DESC', |
| 7230 | 7229 | $itemId |
@@ -7282,7 +7281,7 @@ discard block |
||
| 7282 | 7281 | { |
| 7283 | 7282 | // Check if there's an ongoing background encryption process for the item |
| 7284 | 7283 | $ongoingProcess = DB::queryFirstRow( |
| 7285 | - 'SELECT 1 FROM ' . prefixTable('background_tasks') . ' WHERE item_id = %i AND finished_at = "" LIMIT 1', |
|
| 7284 | + 'SELECT 1 FROM '.prefixTable('background_tasks').' WHERE item_id = %i AND finished_at = "" LIMIT 1', |
|
| 7286 | 7285 | $itemId |
| 7287 | 7286 | ); |
| 7288 | 7287 | |
@@ -7300,7 +7299,7 @@ discard block |
||
| 7300 | 7299 | function getUserVisibleFolders(int $userId): array |
| 7301 | 7300 | { |
| 7302 | 7301 | // Query to retrieve visible folders for the user |
| 7303 | - $data = DB::queryFirstRow('SELECT visible_folders FROM ' . prefixTable('cache_tree') . ' WHERE user_id = %i', $userId); |
|
| 7302 | + $data = DB::queryFirstRow('SELECT visible_folders FROM '.prefixTable('cache_tree').' WHERE user_id = %i', $userId); |
|
| 7304 | 7303 | |
| 7305 | 7304 | // Decode JSON data into an array; return an empty array if the data is invalid |
| 7306 | 7305 | return json_decode($data['visible_folders'], true) ?? []; |
@@ -7324,7 +7323,7 @@ discard block |
||
| 7324 | 7323 | |
| 7325 | 7324 | // Query the access rights for the given roles and folder |
| 7326 | 7325 | $accessTypes = DB::queryFirstColumn( |
| 7327 | - 'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id IN %ls AND folder_id = %i', |
|
| 7326 | + 'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id IN %ls AND folder_id = %i', |
|
| 7328 | 7327 | $roles, |
| 7329 | 7328 | $treeId |
| 7330 | 7329 | ); |