@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ) { |
| 68 | 68 | // Not allowed page |
| 69 | 69 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 70 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 70 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 71 | 71 | exit; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | ); |
| 449 | 449 | |
| 450 | 450 | // add new role to user |
| 451 | - $tmp = $data_tmp['fonction_id'] . (substr($data_tmp['fonction_id'], -1) == ';' ? $role_id : ';' . $role_id); |
|
| 451 | + $tmp = $data_tmp['fonction_id'].(substr($data_tmp['fonction_id'], -1) == ';' ? $role_id : ';'.$role_id); |
|
| 452 | 452 | $session->set('user-roles', str_replace(';;', ';', $tmp)); |
| 453 | 453 | |
| 454 | 454 | // store in DB |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | $session->get('user-id') |
| 462 | 462 | ); |
| 463 | 463 | $session->set('user-roles_array', explode(';', $session->get('user-roles'))); |
| 464 | - error_log('user-roles_array 3: ' . print_r(explode(';', $session->get('user-roles')), true)); |
|
| 464 | + error_log('user-roles_array 3: '.print_r(explode(';', $session->get('user-roles')), true)); |
|
| 465 | 465 | |
| 466 | 466 | $return['new_role_id'] = $role_id; |
| 467 | 467 | } |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | $groupsData = $openLdapExtra->getADGroups($ldapConnection, $SETTINGS); |
| 722 | 722 | break; |
| 723 | 723 | default: |
| 724 | - throw new Exception("Unsupported LDAP type: " . $SETTINGS['ldap_type']); |
|
| 724 | + throw new Exception("Unsupported LDAP type: ".$SETTINGS['ldap_type']); |
|
| 725 | 725 | } |
| 726 | 726 | } catch (Exception $e) { |
| 727 | 727 | echo prepareExchangedData(array( |
@@ -734,12 +734,12 @@ discard block |
||
| 734 | 734 | // Check the type of LDAP and perform actions based on that |
| 735 | 735 | if ($groupsData['error']) { |
| 736 | 736 | // Handle error |
| 737 | - error_log("Error: " . print_r($groupsData['message'], true)); |
|
| 737 | + error_log("Error: ".print_r($groupsData['message'], true)); |
|
| 738 | 738 | } else { |
| 739 | 739 | // Handle successful retrieval of groups |
| 740 | 740 | // exists in Teampass |
| 741 | 741 | //error_log("Error: " . print_r($groupsData['userGroups'], true)); |
| 742 | - foreach($groupsData['userGroups'] as $key => $group) { |
|
| 742 | + foreach ($groupsData['userGroups'] as $key => $group) { |
|
| 743 | 743 | $role_detail = DB::queryfirstrow( |
| 744 | 744 | 'SELECT a.increment_id as increment_id, a.role_id as role_id, r.title as title |
| 745 | 745 | FROM '.prefixTable('ldap_groups_roles').' AS a |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | |
| 765 | 765 | // Get all groups in Teampass |
| 766 | 766 | $teampassRoles = array(); |
| 767 | - $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title')); |
|
| 767 | + $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title')); |
|
| 768 | 768 | foreach ($rows as $record) { |
| 769 | 769 | array_push( |
| 770 | 770 | $teampassRoles, |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ) { |
| 69 | 69 | // Not allowed page |
| 70 | 70 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 71 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 71 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 72 | 72 | exit; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $lexer = new Lexer($config); |
| 157 | 157 | $config->setIgnoreHeaderLine('true'); |
| 158 | 158 | $interpreter = new Interpreter(); |
| 159 | - $interpreter->addObserver(function (array $row) use (&$valuesToImport) { |
|
| 159 | + $interpreter->addObserver(function(array $row) use (&$valuesToImport) { |
|
| 160 | 160 | $valuesToImport[] = array( |
| 161 | 161 | 'Label' => $row[0], |
| 162 | 162 | 'Login' => $row[1], |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | { |
| 498 | 498 | // Manage entries |
| 499 | 499 | if (isset($array['Entry']) === true) { |
| 500 | - foreach($array['Entry'] as $key => $value) { |
|
| 500 | + foreach ($array['Entry'] as $key => $value) { |
|
| 501 | 501 | if (isset($value['String']) === true) { |
| 502 | 502 | $itemDefinition = []; |
| 503 | 503 | $c = count($value['String']); |
@@ -532,13 +532,13 @@ discard block |
||
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | // Manage GROUPS |
| 535 | - if (isset($array['Group']) === true && is_array($array['Group'])=== true) { |
|
| 535 | + if (isset($array['Group']) === true && is_array($array['Group']) === true) { |
|
| 536 | 536 | $currentFolderId = $previousFolder; |
| 537 | 537 | if (isset($array['Group']['UUID']) === true) { |
| 538 | 538 | // build expect array format |
| 539 | 539 | $array['Group'] = [$array['Group']]; |
| 540 | 540 | } |
| 541 | - foreach($array['Group'] as $key => $value){ |
|
| 541 | + foreach ($array['Group'] as $key => $value) { |
|
| 542 | 542 | // Add this new folder |
| 543 | 543 | array_push( |
| 544 | 544 | $newItemsToAdd['folders'], |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | ]; |
| 632 | 632 | $startPathLevel = 1; |
| 633 | 633 | |
| 634 | - foreach($post_folders as $folder) { |
|
| 634 | + foreach ($post_folders as $folder) { |
|
| 635 | 635 | // get parent id |
| 636 | 636 | $parentId = $arrFolders[$folder['parentFolderId']]; |
| 637 | 637 | |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | ]; |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | -spl_autoload_register(function ($class) { |
|
| 939 | +spl_autoload_register(function($class) { |
|
| 940 | 940 | $prefix = 'League\\Csv\\'; |
| 941 | 941 | $base_dir = __DIR__.'/src/'; |
| 942 | 942 | $len = strlen($prefix); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | ) { |
| 71 | 71 | // Not allowed page |
| 72 | 72 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 73 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 73 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 74 | 74 | exit; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -228,22 +228,20 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | // Get some infos about user |
| 230 | 230 | $userDisplayInfos = |
| 231 | - (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '') |
|
| 231 | + (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '') |
|
| 232 | 232 | . |
| 233 | 233 | ((int) $record['last_connexion'] > 0 ? '<i class=\"far fa-clock infotip text-info ml-2\" title=\"'.$lang->get('index_last_seen').": ". |
| 234 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '') |
|
| 234 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '') |
|
| 235 | 235 | . |
| 236 | 236 | ((int) $record['user_ip'] > 0 ? '<i class=\"fas fa-street-view infotip text-info ml-1\" title=\"'.$lang->get('ip').": ".($record['user_ip']).'\"></i>' : '') |
| 237 | 237 | . |
| 238 | 238 | ($record['auth_type'] === 'ldap' ? '<i class=\"far fa-address-book infotip text-warning ml-1\" title=\"'.$lang->get('managed_through_ad').'\"></i>' : '') |
| 239 | 239 | . |
| 240 | 240 | ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && ((int) $SETTINGS['duo'] === 1 || (int) $SETTINGS['google_authentication'] === 1)) ? |
| 241 | - ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : |
|
| 242 | - '' |
|
| 241 | + ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : '' |
|
| 243 | 242 | ). |
| 244 | 243 | ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && is_null($record['keys_recovery_time']) === true) ? |
| 245 | - '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : |
|
| 246 | - '' |
|
| 244 | + '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : '' |
|
| 247 | 245 | ); |
| 248 | 246 | |
| 249 | 247 | $sOutput .= '["<span data-id=\"'.$record['id'].'\" data-fullname=\"'. |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | ) { |
| 70 | 70 | // Not allowed page |
| 71 | 71 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 72 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 72 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 73 | 73 | exit; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $arrFolders = array(); |
| 121 | 121 | $rows = DB::query( |
| 122 | 122 | 'SELECT valeur, intitule |
| 123 | - FROM ' . prefixTable('misc') . ' |
|
| 123 | + FROM ' . prefixTable('misc').' |
|
| 124 | 124 | WHERE type = %s', |
| 125 | 125 | 'folder_deleted' |
| 126 | 126 | ); |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | 'SELECT u.login as login, u.name as name, u.lastname as lastname, |
| 143 | 143 | i.id as id, i.label as label, |
| 144 | 144 | i.id_tree as id_tree, l.date as date, n.title as folder_title |
| 145 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 146 | - INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id) |
|
| 147 | - LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 148 | - LEFT JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id) |
|
| 145 | + FROM ' . prefixTable('log_items').' as l |
|
| 146 | + INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id) |
|
| 147 | + LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 148 | + LEFT JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id) |
|
| 149 | 149 | WHERE i.inactif = %i |
| 150 | 150 | AND l.action = %s', |
| 151 | 151 | 1, |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | 'label' => $record['label'], |
| 168 | 168 | 'date' => date($SETTINGS['date_format'], (int) $record['date']), |
| 169 | 169 | 'login' => $record['login'], |
| 170 | - 'name' => $record['name'] . ' ' . $record['lastname'], |
|
| 170 | + 'name' => $record['name'].' '.$record['lastname'], |
|
| 171 | 171 | 'folder_label' => $record['folder_title'], |
| 172 | 172 | 'folder_deleted' => $thisFolder, |
| 173 | 173 | ) |
@@ -225,10 +225,10 @@ discard block |
||
| 225 | 225 | foreach ($post_folders as $folderId) { |
| 226 | 226 | $data = DB::queryfirstrow( |
| 227 | 227 | 'SELECT valeur |
| 228 | - FROM ' . prefixTable('misc') . " |
|
| 228 | + FROM ' . prefixTable('misc')." |
|
| 229 | 229 | WHERE type = 'folder_deleted' |
| 230 | 230 | AND intitule = %s", |
| 231 | - 'f' . $folderId |
|
| 231 | + 'f'.$folderId |
|
| 232 | 232 | ); |
| 233 | 233 | if ((int) $data['valeur'] !== 0) { |
| 234 | 234 | $folderData = explode(', ', $data['valeur']); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | prefixTable('misc'), |
| 256 | 256 | 'type = %s AND intitule = %s', |
| 257 | 257 | 'folder_deleted', |
| 258 | - 'f' . $folderId |
|
| 258 | + 'f'.$folderId |
|
| 259 | 259 | ); |
| 260 | 260 | |
| 261 | 261 | // Restore all items in this folder |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | // Get list of all items in thos folder |
| 272 | 272 | $items = DB::query( |
| 273 | 273 | 'SELECT id |
| 274 | - FROM ' . prefixTable('items') . ' |
|
| 274 | + FROM ' . prefixTable('items').' |
|
| 275 | 275 | WHERE id_tree = %i', |
| 276 | 276 | $folderId |
| 277 | 277 | ); |
@@ -360,10 +360,10 @@ discard block |
||
| 360 | 360 | foreach ($post_folders as $folderId) { |
| 361 | 361 | $data = DB::queryfirstrow( |
| 362 | 362 | 'SELECT valeur |
| 363 | - FROM ' . prefixTable('misc') . " |
|
| 363 | + FROM ' . prefixTable('misc')." |
|
| 364 | 364 | WHERE type = 'folder_deleted' |
| 365 | 365 | AND intitule = %s", |
| 366 | - 'f' . $folderId |
|
| 366 | + 'f'.$folderId |
|
| 367 | 367 | ); |
| 368 | 368 | if ((int) $data['valeur'] !== 0) { |
| 369 | 369 | $folderData = explode(', ', $data['valeur']); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | prefixTable('misc'), |
| 397 | 397 | 'type = %s AND intitule = %s', |
| 398 | 398 | 'folder_deleted', |
| 399 | - 'f' . $folderData[0] |
|
| 399 | + 'f'.$folderData[0] |
|
| 400 | 400 | ); |
| 401 | 401 | |
| 402 | 402 | // Delete all items in this folder |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | // Get list of all items in thos folder |
| 411 | 411 | $items = DB::query( |
| 412 | 412 | 'SELECT id |
| 413 | - FROM ' . prefixTable('items') . ' |
|
| 413 | + FROM ' . prefixTable('items').' |
|
| 414 | 414 | WHERE id_tree = %i', |
| 415 | 415 | $folderData[0] |
| 416 | 416 | ); |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | ) { |
| 500 | 500 | if ($post_log_type === 'items') { |
| 501 | 501 | DB::query( |
| 502 | - 'SELECT * FROM ' . prefixTable('log_items') . ' |
|
| 502 | + 'SELECT * FROM '.prefixTable('log_items').' |
|
| 503 | 503 | WHERE (date BETWEEN %i AND %i)' |
| 504 | 504 | . ($post_filter_action === 'all' ? '' : ' AND action = "'.$post_filter_action.'"') |
| 505 | 505 | . ((int) $post_filter_user === -1 ? '' : ' AND id_user = '.(int) $post_filter_user), |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | } elseif ($post_log_type === 'connections') { |
| 520 | 520 | //db::debugmode(true); |
| 521 | 521 | DB::query( |
| 522 | - 'SELECT * FROM ' . prefixTable('log_system') . ' |
|
| 522 | + 'SELECT * FROM '.prefixTable('log_system').' |
|
| 523 | 523 | WHERE type=%s ' |
| 524 | 524 | . 'AND (date BETWEEN %i AND %i)' |
| 525 | 525 | . ($post_filter_action === 'all' ? '' : ' AND action = '.$post_filter_action) |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | ); |
| 543 | 543 | } elseif ($post_log_type === 'errors') { |
| 544 | 544 | DB::query( |
| 545 | - 'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' . |
|
| 545 | + 'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '. |
|
| 546 | 546 | 'AND (date BETWEEN %i AND %i)', |
| 547 | 547 | 'error', |
| 548 | 548 | $post_date_from, |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | ); |
| 560 | 560 | } elseif ($post_log_type === 'copy') { |
| 561 | 561 | DB::query( |
| 562 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' . |
|
| 562 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '. |
|
| 563 | 563 | 'AND (date BETWEEN %i AND %i)', |
| 564 | 564 | 'at_copy', |
| 565 | 565 | $post_date_from, |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | ); |
| 577 | 577 | } elseif ($post_log_type === 'admin') { |
| 578 | 578 | DB::query( |
| 579 | - 'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' . |
|
| 579 | + 'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '. |
|
| 580 | 580 | 'AND (date BETWEEN %i AND %i)', |
| 581 | 581 | 'admin_action', |
| 582 | 582 | $post_date_from, |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | ); |
| 594 | 594 | } elseif ($post_log_type === 'failed') { |
| 595 | 595 | DB::query( |
| 596 | - 'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' . |
|
| 596 | + 'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '. |
|
| 597 | 597 | 'AND (date BETWEEN %i AND %i)', |
| 598 | 598 | 'failed_auth', |
| 599 | 599 | $post_date_from, |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | |
| 664 | 664 | $tasks = DB::query( |
| 665 | 665 | 'SELECT * |
| 666 | - FROM ' . prefixTable('processes_tasks') . ' |
|
| 666 | + FROM ' . prefixTable('processes_tasks').' |
|
| 667 | 667 | WHERE process_id = %i', |
| 668 | 668 | $post_id |
| 669 | 669 | ); |
@@ -671,37 +671,37 @@ discard block |
||
| 671 | 671 | // Get some values |
| 672 | 672 | DB::query( |
| 673 | 673 | 'SELECT id |
| 674 | - FROM ' . prefixTable('items') . ' |
|
| 674 | + FROM ' . prefixTable('items').' |
|
| 675 | 675 | WHERE perso = 0' |
| 676 | 676 | ); |
| 677 | 677 | $items_number = DB::count(); |
| 678 | 678 | |
| 679 | 679 | DB::query( |
| 680 | 680 | 'SELECT increment_id |
| 681 | - FROM ' . prefixTable('log_items') . ' |
|
| 681 | + FROM ' . prefixTable('log_items').' |
|
| 682 | 682 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"' |
| 683 | 683 | ); |
| 684 | 684 | $logs_number = DB::count(); |
| 685 | 685 | |
| 686 | 686 | DB::query( |
| 687 | 687 | 'SELECT id |
| 688 | - FROM ' . prefixTable('categories_items') . ' |
|
| 688 | + FROM ' . prefixTable('categories_items').' |
|
| 689 | 689 | WHERE encryption_type = "teampass_aes"' |
| 690 | 690 | ); |
| 691 | - $items_categories= DB::count(); |
|
| 691 | + $items_categories = DB::count(); |
|
| 692 | 692 | |
| 693 | 693 | DB::query( |
| 694 | 694 | 'SELECT id |
| 695 | 695 | FROM ' . prefixTable('suggestion') |
| 696 | 696 | ); |
| 697 | - $items_suggestions= DB::count(); |
|
| 697 | + $items_suggestions = DB::count(); |
|
| 698 | 698 | |
| 699 | 699 | DB::query( |
| 700 | 700 | 'SELECT id |
| 701 | - FROM ' . prefixTable('files') . ' |
|
| 702 | - WHERE status = "' . TP_ENCRYPTION_NAME . '"' |
|
| 701 | + FROM ' . prefixTable('files').' |
|
| 702 | + WHERE status = "' . TP_ENCRYPTION_NAME.'"' |
|
| 703 | 703 | ); |
| 704 | - $items_files= DB::count(); |
|
| 704 | + $items_files = DB::count(); |
|
| 705 | 705 | |
| 706 | 706 | |
| 707 | 707 | // get list |
@@ -716,26 +716,26 @@ discard block |
||
| 716 | 716 | if ($detail['step'] === 'step0' || (int) $detail['index'] === 0) { |
| 717 | 717 | $task_progress = '0%'; |
| 718 | 718 | } elseif ($detail['step'] === 'step10') { |
| 719 | - $task_progress = pourcentage($detail['index'], 1, 100) .'%'; |
|
| 719 | + $task_progress = pourcentage($detail['index'], 1, 100).'%'; |
|
| 720 | 720 | } elseif ($detail['step'] === 'step20') { |
| 721 | - $task_progress = pourcentage($detail['index'], $items_number, 100) .'%'; |
|
| 721 | + $task_progress = pourcentage($detail['index'], $items_number, 100).'%'; |
|
| 722 | 722 | } elseif ($detail['step'] === 'step30') { |
| 723 | - $task_progress = pourcentage($detail['index'], $logs_number, 100) .'%'; |
|
| 723 | + $task_progress = pourcentage($detail['index'], $logs_number, 100).'%'; |
|
| 724 | 724 | } elseif ($detail['step'] === 'step40') { |
| 725 | - $task_progress = pourcentage($detail['index'], $items_categories, 100) .'%'; |
|
| 725 | + $task_progress = pourcentage($detail['index'], $items_categories, 100).'%'; |
|
| 726 | 726 | } elseif ($detail['step'] === 'step50') { |
| 727 | - $task_progress = pourcentage($detail['index'], $items_suggestions, 100) .'%'; |
|
| 727 | + $task_progress = pourcentage($detail['index'], $items_suggestions, 100).'%'; |
|
| 728 | 728 | } elseif ($detail['step'] === 'step60') { |
| 729 | - $task_progress = pourcentage($detail['index'], $items_files, 100) .'%'; |
|
| 729 | + $task_progress = pourcentage($detail['index'], $items_files, 100).'%'; |
|
| 730 | 730 | } |
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 | array_push( |
| 734 | 734 | $ret, |
| 735 | 735 | [ |
| 736 | - 'created_at' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $task['created_at']), |
|
| 737 | - 'updated_at' => is_null($task['updated_at']) === false ? date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $task['updated_at']) : '', |
|
| 738 | - 'finished_at' => is_null($task['finished_at']) === false ? date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $task['finished_at']) : '', |
|
| 736 | + 'created_at' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $task['created_at']), |
|
| 737 | + 'updated_at' => is_null($task['updated_at']) === false ? date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $task['updated_at']) : '', |
|
| 738 | + 'finished_at' => is_null($task['finished_at']) === false ? date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $task['finished_at']) : '', |
|
| 739 | 739 | 'progress' => $task['finished_at'] !== null ? '100%' : $task_progress, |
| 740 | 740 | 'is_in_progress' => (int) $task['is_in_progress'], |
| 741 | 741 | 'step' => 'step'.$i, |
@@ -784,19 +784,19 @@ discard block |
||
| 784 | 784 | // Get info about task |
| 785 | 785 | $taskInfo = DB::queryfirstrow( |
| 786 | 786 | 'SELECT p.process_type as process_type |
| 787 | - FROM ' . prefixTable('processes') . ' as p |
|
| 787 | + FROM ' . prefixTable('processes').' as p |
|
| 788 | 788 | WHERE p.increment_id = %i', |
| 789 | 789 | $post_id |
| 790 | 790 | ); |
| 791 | 791 | if ($taskInfo !== null) { |
| 792 | 792 | // delete task |
| 793 | 793 | DB::query( |
| 794 | - 'DELETE FROM ' . prefixTable('processes_tasks') . ' |
|
| 794 | + 'DELETE FROM '.prefixTable('processes_tasks').' |
|
| 795 | 795 | WHERE process_id = %i', |
| 796 | 796 | $post_id |
| 797 | 797 | ); |
| 798 | 798 | DB::query( |
| 799 | - 'DELETE FROM ' . prefixTable('processes') . ' |
|
| 799 | + 'DELETE FROM '.prefixTable('processes').' |
|
| 800 | 800 | WHERE increment_id = %i', |
| 801 | 801 | $post_id |
| 802 | 802 | ); |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | ->setDayOfMonth('*') |
| 864 | 864 | ->setMonths('*') |
| 865 | 865 | ->setDayOfWeek('*') |
| 866 | - ->setTaskCommandLine($phpBinaryPath . ' ' . $SETTINGS['cpassman_dir'] . '/sources/scheduler.php') |
|
| 866 | + ->setTaskCommandLine($phpBinaryPath.' '.$SETTINGS['cpassman_dir'].'/sources/scheduler.php') |
|
| 867 | 867 | ->setComments('Teampass scheduler'); |
| 868 | 868 | |
| 869 | 869 | $crontabRepository->addJob($crontabJob); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ) { |
| 74 | 74 | // Not allowed page |
| 75 | 75 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 76 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 76 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 77 | 77 | exit; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -97,22 +97,22 @@ discard block |
||
| 97 | 97 | $sOrder = $sLimit = ''; |
| 98 | 98 | // Is a date sent? |
| 99 | 99 | if (isset($_GET['dateCriteria']) === true && empty($_GET['dateCriteria']) === false) { |
| 100 | - $sWhere .= ' AND a.del_value < ' . round(filter_var($_GET['dateCriteria'], FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 100 | + $sWhere .= ' AND a.del_value < '.round(filter_var($_GET['dateCriteria'], FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 101 | 101 | } |
| 102 | 102 | //echo $sWhere; |
| 103 | 103 | /* BUILD QUERY */ |
| 104 | 104 | //Paging |
| 105 | 105 | $sLimit = ''; |
| 106 | 106 | if (isset($_GET['length']) === true && (int) $_GET['length'] !== -1) { |
| 107 | - $sLimit = ' LIMIT ' . filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) . ', ' . filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT) . ''; |
|
| 107 | + $sLimit = ' LIMIT '.filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).', '.filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).''; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | //Ordering |
| 111 | 111 | if (isset($_GET['order'][0]['dir']) && in_array($_GET['order'][0]['dir'], $aSortTypes)) { |
| 112 | 112 | $sOrder = 'ORDER BY '; |
| 113 | 113 | if (preg_match('#^(asc|desc)$#i', $_GET['order'][0]['column'])) { |
| 114 | - $sOrder .= '' . $aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' ' |
|
| 115 | - . filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . ', '; |
|
| 114 | + $sOrder .= ''.$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)].' ' |
|
| 115 | + . filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_FULL_SPECIAL_CHARS).', '; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $sOrder = substr_replace($sOrder, '', -2); |
@@ -133,29 +133,29 @@ discard block |
||
| 133 | 133 | && $_GET['letter'] !== 'None' |
| 134 | 134 | ) { |
| 135 | 135 | $sWhere .= ' AND '; |
| 136 | - $sWhere .= $aColumns[1] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR "; |
|
| 137 | - $sWhere .= $aColumns[2] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR "; |
|
| 138 | - $sWhere .= $aColumns[3] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' "; |
|
| 136 | + $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR "; |
|
| 137 | + $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR "; |
|
| 138 | + $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' "; |
|
| 139 | 139 | } elseif (isset($_GET['search']['value']) === true && $_GET['search']['value'] !== '') { |
| 140 | 140 | $sWhere = ' AND '; |
| 141 | - $sWhere .= $aColumns[1] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR "; |
|
| 142 | - $sWhere .= $aColumns[2] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR "; |
|
| 143 | - $sWhere .= $aColumns[3] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' "; |
|
| 141 | + $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR "; |
|
| 142 | + $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR "; |
|
| 143 | + $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' "; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $rows = DB::query( |
| 147 | 147 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 148 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 149 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 148 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 149 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 150 | 150 | $sWhere. |
| 151 | 151 | (string) $sOrder |
| 152 | 152 | ); |
| 153 | 153 | $iTotal = DB::count(); |
| 154 | 154 | $rows = DB::query( |
| 155 | 155 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 156 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 157 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 158 | - $sWhere . |
|
| 156 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 157 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 158 | + $sWhere. |
|
| 159 | 159 | $sLimit |
| 160 | 160 | ); |
| 161 | 161 | $iFilteredTotal = DB::count(); |
@@ -173,18 +173,18 @@ discard block |
||
| 173 | 173 | // start the line |
| 174 | 174 | $sOutput .= '['; |
| 175 | 175 | // Column 1 |
| 176 | - $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"' . $record['item_id'] . '\" data-item-tree-id=\"' . $record['id_tree'] . '\"></i>", '; |
|
| 176 | + $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"'.$record['item_id'].'\" data-item-tree-id=\"'.$record['id_tree'].'\"></i>", '; |
|
| 177 | 177 | // Column 2 |
| 178 | - $sOutput .= '"' . $record['label'] . '", '; |
|
| 178 | + $sOutput .= '"'.$record['label'].'", '; |
|
| 179 | 179 | // Column 3 |
| 180 | - $sOutput .= '"' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['del_value']) . '", '; |
|
| 180 | + $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['del_value']).'", '; |
|
| 181 | 181 | // Column 4 |
| 182 | 182 | $path = []; |
| 183 | 183 | $treeDesc = $tree->getPath($record['id_tree'], true); |
| 184 | 184 | foreach ($treeDesc as $t) { |
| 185 | 185 | array_push($path, $t->title); |
| 186 | 186 | } |
| 187 | - $sOutput .= '"' . implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path) . '"],'; |
|
| 187 | + $sOutput .= '"'.implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path).'"],'; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | if ($iTotal > 0) { |
@@ -197,4 +197,4 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // finalize output |
| 200 | -echo '{"recordsTotal": ' . $iTotal . ', "recordsFiltered": ' . $iFilteredTotal . ', "data": ' . $sOutput; |
|
| 200 | +echo '{"recordsTotal": '.$iTotal.', "recordsFiltered": '.$iFilteredTotal.', "data": '.$sOutput; |
|
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | ) { |
| 72 | 72 | // Not allowed page |
| 73 | 73 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 74 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 74 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 75 | 75 | exit; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -906,15 +906,15 @@ discard block |
||
| 906 | 906 | //col1 |
| 907 | 907 | $sOutput .= '"<span data-done=\"'.$record['is_in_progress'].'\" data-type=\"'.$record['process_type'].'\" data-process-id=\"'.$record['increment_id'].'\"></span>", '; |
| 908 | 908 | //col2 |
| 909 | - $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", '; |
|
| 909 | + $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", '; |
|
| 910 | 910 | //col3 |
| 911 | - $sOutput .= '"'.($record['updated_at'] === '' ? '-' : date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['updated_at'])).'", '; |
|
| 911 | + $sOutput .= '"'.($record['updated_at'] === '' ? '-' : date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['updated_at'])).'", '; |
|
| 912 | 912 | //col4 |
| 913 | 913 | $sOutput .= '"'.$record['process_type'].'", '; |
| 914 | 914 | // col5 |
| 915 | 915 | if (in_array($record['process_type'], array('create_user_keys', 'item_copy')) === true) { |
| 916 | 916 | $data_user = DB::queryfirstrow( |
| 917 | - 'SELECT name, lastname FROM ' . prefixTable('users') . ' |
|
| 917 | + 'SELECT name, lastname FROM '.prefixTable('users').' |
|
| 918 | 918 | WHERE id = %i', |
| 919 | 919 | json_decode($record['arguments'], true)['new_user_id'] |
| 920 | 920 | ); |
@@ -997,13 +997,12 @@ discard block |
||
| 997 | 997 | //col1 |
| 998 | 998 | $sOutput .= '"", '; |
| 999 | 999 | //col2 |
| 1000 | - $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", '; |
|
| 1000 | + $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", '; |
|
| 1001 | 1001 | //col3 |
| 1002 | 1002 | $sOutput .= is_null($record['started_at']) === false ? |
| 1003 | - ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['started_at']).'", ') : |
|
| 1004 | - ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", '); |
|
| 1003 | + ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['started_at']).'", ') : ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", '); |
|
| 1005 | 1004 | //col4 |
| 1006 | - $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['finished_at']).'", '; |
|
| 1005 | + $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['finished_at']).'", '; |
|
| 1007 | 1006 | // col7 |
| 1008 | 1007 | $sOutput .= '"'.gmdate('H:i:s', (int) $record['finished_at'] - (is_null($record['started_at']) === false ? (int) $record['started_at'] : (int) $record['created_at'])).'",'; |
| 1009 | 1008 | //col5 |
@@ -1022,7 +1021,7 @@ discard block |
||
| 1022 | 1021 | $newUserId = array_key_exists('new_user_id', $arguments) ? $arguments['new_user_id'] : null; |
| 1023 | 1022 | if ($record['process_type'] === 'create_user_keys' && is_null($newUserId) === false && empty($newUserId) === false) { |
| 1024 | 1023 | $data_user = DB::queryfirstrow( |
| 1025 | - 'SELECT name, lastname, login FROM ' . prefixTable('users') . ' |
|
| 1024 | + 'SELECT name, lastname, login FROM '.prefixTable('users').' |
|
| 1026 | 1025 | WHERE id = %i', |
| 1027 | 1026 | $newUserId |
| 1028 | 1027 | ); |
@@ -1038,7 +1037,7 @@ discard block |
||
| 1038 | 1037 | } elseif ($record['process_type'] === 'user_build_cache_tree') { |
| 1039 | 1038 | $user = json_decode($record['arguments'], true)['user_id']; |
| 1040 | 1039 | $data_user = DB::queryfirstrow( |
| 1041 | - 'SELECT name, lastname, login FROM ' . prefixTable('users') . ' |
|
| 1040 | + 'SELECT name, lastname, login FROM '.prefixTable('users').' |
|
| 1042 | 1041 | WHERE id = %i', |
| 1043 | 1042 | $user |
| 1044 | 1043 | ); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | ) { |
| 67 | 67 | // Not allowed page |
| 68 | 68 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 69 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 69 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 70 | 70 | exit; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | ); |
| 129 | 129 | |
| 130 | 130 | $lastFolderChange = DB::queryfirstrow( |
| 131 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' |
|
| 131 | + 'SELECT valeur FROM '.prefixTable('misc').' |
|
| 132 | 132 | WHERE type = %s AND intitule = %s', |
| 133 | 133 | 'timestamp', |
| 134 | 134 | 'last_folder_change' |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | foreach ($currentNode->children as $child) { |
| 464 | 464 | recursiveTree( |
| 465 | 465 | (int) $child, |
| 466 | - $tree->getNode($child),// get node info for this child |
|
| 466 | + $tree->getNode($child), // get node info for this child |
|
| 467 | 467 | /** @scrutinizer ignore-type */ $tree, |
| 468 | 468 | $listFoldersLimitedKeys, |
| 469 | 469 | $listRestrictedFoldersForItemsKeys, |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $lang = new Language(); |
| 510 | 510 | |
| 511 | 511 | // prepare json return for current node |
| 512 | - $parent = $currentNode->parent_id === '0' ? '#' : 'li_' . $currentNode->parent_id; |
|
| 512 | + $parent = $currentNode->parent_id === '0' ? '#' : 'li_'.$currentNode->parent_id; |
|
| 513 | 513 | |
| 514 | 514 | // handle displaying |
| 515 | 515 | if (isKeyExistingAndEqual('show_only_accessible_folders', 1, $SETTINGS) === true) { |
@@ -526,17 +526,17 @@ discard block |
||
| 526 | 526 | array_push( |
| 527 | 527 | $ret_json, |
| 528 | 528 | array( |
| 529 | - 'id' => 'li_' . $nodeId, |
|
| 529 | + 'id' => 'li_'.$nodeId, |
|
| 530 | 530 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
| 531 | 531 | 'text' => '<i class="'.$currentNode->fa_icon.' tree-folder mr-2" data-folder="'.$currentNode->fa_icon.'" data-folder-selected="'.$currentNode->fa_icon_selected.'"></i>'.$text.$currentNode->title.$nodeData['html'], |
| 532 | 532 | 'li_attr' => array( |
| 533 | 533 | 'class' => 'jstreeopen', |
| 534 | - 'title' => 'ID [' . $nodeId . '] ' . $nodeData['title'], |
|
| 534 | + 'title' => 'ID ['.$nodeId.'] '.$nodeData['title'], |
|
| 535 | 535 | ), |
| 536 | 536 | 'a_attr' => array( |
| 537 | - 'id' => 'fld_' . $nodeId, |
|
| 537 | + 'id' => 'fld_'.$nodeId, |
|
| 538 | 538 | 'class' => $nodeData['folderClass'], |
| 539 | - 'onclick' => 'ListerItems(' . $nodeId . ', ' . $nodeData['restricted'] . ', 0, 1)', |
|
| 539 | + 'onclick' => 'ListerItems('.$nodeId.', '.$nodeData['restricted'].', 0, 1)', |
|
| 540 | 540 | 'data-title' => $currentNode->title, |
| 541 | 541 | ), |
| 542 | 542 | 'is_pf' => in_array($nodeId, $inputData['personalFolders']) === true ? 1 : 0, |
@@ -552,12 +552,12 @@ discard block |
||
| 552 | 552 | array_push( |
| 553 | 553 | $ret_json, |
| 554 | 554 | array( |
| 555 | - 'id' => 'li_' . $nodeId, |
|
| 555 | + 'id' => 'li_'.$nodeId, |
|
| 556 | 556 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
| 557 | 557 | 'text' => '<i class="'.$currentNode->fa_icon.' tree-folder mr-2" data-folder="'.$currentNode->fa_icon.'" data-folder-selected="'.$currentNode->fa_icon_selected.'"></i>'.'<i class="fas fa-times fa-xs text-danger mr-1 ml-1"></i>'.$text.$currentNode->title.$nodeData['html'], |
| 558 | 558 | 'li_attr' => array( |
| 559 | 559 | 'class' => '', |
| 560 | - 'title' => 'ID [' . $nodeId . '] ' . $lang->get('no_access'), |
|
| 560 | + 'title' => 'ID ['.$nodeId.'] '.$lang->get('no_access'), |
|
| 561 | 561 | ), |
| 562 | 562 | ) |
| 563 | 563 | ); |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | if (in_array($nodeId, $session_read_only_folders) === true) { |
| 619 | 619 | return [ |
| 620 | 620 | 'html' => '<i class="far fa-eye fa-xs mr-1 ml-1"></i>'. |
| 621 | - ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>' : ''), |
|
| 621 | + ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''), |
|
| 622 | 622 | 'title' => $lang->get('read_only_account'), |
| 623 | 623 | 'restricted' => 1, |
| 624 | 624 | 'folderClass' => 'folder_not_droppable', |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | ) { |
| 634 | 634 | return [ |
| 635 | 635 | 'html' => '<i class="far fa-eye fa-xs mr-1"></i>'. |
| 636 | - ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>' : ''), |
|
| 636 | + ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''), |
|
| 637 | 637 | 'title' => $lang->get('read_only_account'), |
| 638 | 638 | 'restricted' => 0, |
| 639 | 639 | 'folderClass' => 'folder', |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | return [ |
| 647 | - 'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>' : ''), |
|
| 647 | + 'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''), |
|
| 648 | 648 | 'title' => '', |
| 649 | 649 | 'restricted' => 0, |
| 650 | 650 | 'folderClass' => 'folder', |
@@ -655,8 +655,8 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | } elseif (in_array($nodeId, $listFoldersLimitedKeys) === true) { |
| 657 | 657 | return [ |
| 658 | - 'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '') . |
|
| 659 | - ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_folders_limited[$nodeId]) . '</span>' : ''), |
|
| 658 | + 'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''). |
|
| 659 | + ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_folders_limited[$nodeId]).'</span>' : ''), |
|
| 660 | 660 | 'title' => '', |
| 661 | 661 | 'restricted' => 1, |
| 662 | 662 | 'folderClass' => 'folder', |
@@ -667,8 +667,8 @@ discard block |
||
| 667 | 667 | |
| 668 | 668 | } elseif (in_array($nodeId, $listRestrictedFoldersForItemsKeys) === true) { |
| 669 | 669 | return [ |
| 670 | - 'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '' . |
|
| 671 | - '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_restricted_folders_for_items[$nodeId]) . '</span>', |
|
| 670 | + 'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''. |
|
| 671 | + '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_restricted_folders_for_items[$nodeId]).'</span>', |
|
| 672 | 672 | 'title' => '', |
| 673 | 673 | 'restricted' => 1, |
| 674 | 674 | 'folderClass' => 'folder', |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | // Does this user has a tree cache |
| 779 | 779 | $userCacheTree = DB::queryfirstrow( |
| 780 | 780 | 'SELECT data |
| 781 | - FROM ' . prefixTable('cache_tree') . ' |
|
| 781 | + FROM ' . prefixTable('cache_tree').' |
|
| 782 | 782 | WHERE user_id = %i', |
| 783 | 783 | $userId |
| 784 | 784 | ); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ) { |
| 69 | 69 | // Not allowed page |
| 70 | 70 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 71 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 71 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 72 | 72 | exit; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } else { |
| 116 | 116 | // check if token is expired |
| 117 | 117 | $data = DB::queryFirstRow( |
| 118 | - 'SELECT end_timestamp FROM ' . prefixTable('tokens') . ' WHERE user_id = %i AND token = %s', |
|
| 118 | + 'SELECT end_timestamp FROM '.prefixTable('tokens').' WHERE user_id = %i AND token = %s', |
|
| 119 | 119 | $session->get('user-id'), |
| 120 | 120 | $post_user_token |
| 121 | 121 | ); |
@@ -139,12 +139,12 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | // HTTP headers for no cache etc |
| 141 | 141 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
| 142 | -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); |
|
| 142 | +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
| 143 | 143 | header('Cache-Control: no-store, no-cache, must-revalidate'); |
| 144 | 144 | header('Cache-Control: post-check=0, pre-check=0', false); |
| 145 | 145 | |
| 146 | 146 | if (null !== $post_type_upload && $post_type_upload === 'upload_profile_photo') { |
| 147 | - $targetDir = $SETTINGS['cpassman_dir'] . '/includes/avatars'; |
|
| 147 | + $targetDir = $SETTINGS['cpassman_dir'].'/includes/avatars'; |
|
| 148 | 148 | } else { |
| 149 | 149 | $targetDir = $SETTINGS['path_to_files_folder']; |
| 150 | 150 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | // Validate file name (for our purposes we'll just remove invalid characters) |
| 207 | 207 | $file_name = preg_replace( |
| 208 | - '/[^' . $valid_chars_regex . '\.]/', |
|
| 208 | + '/[^'.$valid_chars_regex.'\.]/', |
|
| 209 | 209 | '', |
| 210 | 210 | filter_var( |
| 211 | 211 | strtolower(basename($_FILES['file']['name'])), |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | ) |
| 214 | 214 | ); |
| 215 | 215 | if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) { |
| 216 | - handleUploadError('Invalid file name: ' . $file_name . '.'); |
|
| 216 | + handleUploadError('Invalid file name: '.$file_name.'.'); |
|
| 217 | 217 | return false; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -228,8 +228,8 @@ discard block |
||
| 228 | 228 | $ext, |
| 229 | 229 | explode( |
| 230 | 230 | ',', |
| 231 | - $SETTINGS['upload_docext'] . ',' . $SETTINGS['upload_imagesext'] . |
|
| 232 | - ',' . $SETTINGS['upload_pkgext'] . ',' . $SETTINGS['upload_otherext'] |
|
| 231 | + $SETTINGS['upload_docext'].','.$SETTINGS['upload_imagesext']. |
|
| 232 | + ','.$SETTINGS['upload_pkgext'].','.$SETTINGS['upload_otherext'] |
|
| 233 | 233 | ) |
| 234 | 234 | ) === false |
| 235 | 235 | && $post_type_upload !== 'import_items_from_keepass' |
@@ -242,28 +242,28 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | // is destination folder writable |
| 244 | 244 | if (is_writable($SETTINGS['path_to_files_folder']) === false) { |
| 245 | - handleUploadError('Not enough permissions on folder ' . $SETTINGS['path_to_files_folder'] . '.'); |
|
| 245 | + handleUploadError('Not enough permissions on folder '.$SETTINGS['path_to_files_folder'].'.'); |
|
| 246 | 246 | return false; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | // Clean the fileName for security reasons |
| 250 | 250 | $fileName = preg_replace('/[^\w\.]+/', '_', $fileName); |
| 251 | -$fileName = preg_replace('/[^' . $valid_chars_regex . '\.]/', '', strtolower(basename($fileName))); |
|
| 251 | +$fileName = preg_replace('/[^'.$valid_chars_regex.'\.]/', '', strtolower(basename($fileName))); |
|
| 252 | 252 | |
| 253 | 253 | // Make sure the fileName is unique but only if chunking is disabled |
| 254 | -if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) { |
|
| 254 | +if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) { |
|
| 255 | 255 | $fileNameA = substr($fileName, 0, strlen($ext)); |
| 256 | 256 | $fileNameB = substr($fileName, strlen($ext)); |
| 257 | 257 | |
| 258 | 258 | $count = 1; |
| 259 | - while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) { |
|
| 259 | + while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) { |
|
| 260 | 260 | ++$count; |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | - $fileName = $fileNameA . '_' . $count . $fileNameB; |
|
| 263 | + $fileName = $fileNameA.'_'.$count.$fileNameB; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | -$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName; |
|
| 266 | +$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName; |
|
| 267 | 267 | |
| 268 | 268 | // Create target dir |
| 269 | 269 | if (!file_exists($targetDir)) { |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | // Remove old temp files |
| 278 | 278 | if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) { |
| 279 | 279 | while (($file = readdir($dir)) !== false) { |
| 280 | - $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file; |
|
| 280 | + $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$file; |
|
| 281 | 281 | |
| 282 | 282 | // Remove temp file if it is older than the max age and is not the current file |
| 283 | 283 | if ( |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | ) { |
| 374 | 374 | rename( |
| 375 | 375 | $filePath, |
| 376 | - $targetDir . DIRECTORY_SEPARATOR . $newFileName |
|
| 376 | + $targetDir.DIRECTORY_SEPARATOR.$newFileName |
|
| 377 | 377 | ); |
| 378 | 378 | |
| 379 | 379 | // Add in DB |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | ) { |
| 403 | 403 | rename( |
| 404 | 404 | $filePath, |
| 405 | - $targetDir . DIRECTORY_SEPARATOR . $newFileName |
|
| 405 | + $targetDir.DIRECTORY_SEPARATOR.$newFileName |
|
| 406 | 406 | ); |
| 407 | 407 | |
| 408 | 408 | // Add in DB |
@@ -435,13 +435,13 @@ discard block |
||
| 435 | 435 | // rename the file |
| 436 | 436 | rename( |
| 437 | 437 | $filePath, |
| 438 | - $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext |
|
| 438 | + $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext |
|
| 439 | 439 | ); |
| 440 | 440 | |
| 441 | 441 | // make thumbnail |
| 442 | 442 | $ret = makeThumbnail( |
| 443 | - $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext, |
|
| 444 | - $targetDir . DIRECTORY_SEPARATOR . $newFileName . '_thumb' . '.' . $ext, |
|
| 443 | + $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext, |
|
| 444 | + $targetDir.DIRECTORY_SEPARATOR.$newFileName.'_thumb'.'.'.$ext, |
|
| 445 | 445 | 40 |
| 446 | 446 | ); |
| 447 | 447 | |
@@ -452,21 +452,21 @@ discard block |
||
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | // get current avatar and delete it |
| 455 | - $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM ' . prefixTable('users') . ' WHERE id=%i', $session->get('user-id')); |
|
| 456 | - fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar'], $SETTINGS); |
|
| 457 | - fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar_thumb'], $SETTINGS); |
|
| 455 | + $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM '.prefixTable('users').' WHERE id=%i', $session->get('user-id')); |
|
| 456 | + fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar'], $SETTINGS); |
|
| 457 | + fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar_thumb'], $SETTINGS); |
|
| 458 | 458 | |
| 459 | 459 | // store in DB the new avatar |
| 460 | 460 | DB::query( |
| 461 | - 'UPDATE ' . prefixTable('users') . " |
|
| 462 | - SET avatar='" . $newFileName . '.' . $ext . "', avatar_thumb='" . $newFileName . '_thumb' . '.' . $ext . "' |
|
| 461 | + 'UPDATE '.prefixTable('users')." |
|
| 462 | + SET avatar='" . $newFileName.'.'.$ext."', avatar_thumb='".$newFileName.'_thumb'.'.'.$ext."' |
|
| 463 | 463 | WHERE id=%i", |
| 464 | 464 | $session->get('user-id') |
| 465 | 465 | ); |
| 466 | 466 | |
| 467 | 467 | // store in session |
| 468 | - $session->set('user-avatar', $newFileName . '.' . $ext); |
|
| 469 | - $session->set('user-avatar_thumb', $newFileName . '_thumb' . '.' . $ext); |
|
| 468 | + $session->set('user-avatar', $newFileName.'.'.$ext); |
|
| 469 | + $session->set('user-avatar_thumb', $newFileName.'_thumb'.'.'.$ext); |
|
| 470 | 470 | |
| 471 | 471 | // return info |
| 472 | 472 | echo prepareExchangedData( |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | ) { |
| 486 | 486 | rename( |
| 487 | 487 | $filePath, |
| 488 | - $targetDir . DIRECTORY_SEPARATOR . $newFileName |
|
| 488 | + $targetDir.DIRECTORY_SEPARATOR.$newFileName |
|
| 489 | 489 | ); |
| 490 | 490 | |
| 491 | 491 | // Add in DB |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | ); |
| 82 | 82 | $db_link->set_charset(DB_ENCODING); |
| 83 | 83 | } else { |
| 84 | - $res = 'Impossible to get connected to server. Error is: ' . addslashes(mysqli_connect_error()); |
|
| 85 | - echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: ' . addslashes(mysqli_connect_error()) . '!"}]'; |
|
| 84 | + $res = 'Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()); |
|
| 85 | + echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 86 | 86 | mysqli_close($db_link); |
| 87 | 87 | exit(); |
| 88 | 88 | } |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | $users = mysqli_query( |
| 108 | 108 | $db_link, |
| 109 | 109 | 'SELECT id |
| 110 | - FROM ' . $pre . 'users |
|
| 110 | + FROM ' . $pre.'users |
|
| 111 | 111 | WHERE (public_key = "none" OR public_key = "" OR public_key IS NULL) |
| 112 | - AND id NOT IN (' . OTV_USER_ID . ',' . SSH_USER_ID . ',' . API_USER_ID . ')' |
|
| 112 | + AND id NOT IN (' . OTV_USER_ID.','.SSH_USER_ID.','.API_USER_ID.')' |
|
| 113 | 113 | ); |
| 114 | 114 | while ($user = mysqli_fetch_array($users)) { |
| 115 | 115 | array_push($listOfUsers, $user['id']); |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | if ((int) $post_tp_user === 0) { |
| 128 | 128 | // Create TP USER |
| 129 | 129 | require_once '../includes/config/include.php'; |
| 130 | - $tmp = mysqli_num_rows(mysqli_query($db_link, "SELECT * FROM `" . $pre . "users` WHERE id = '" . TP_USER_ID . "'")); |
|
| 130 | + $tmp = mysqli_num_rows(mysqli_query($db_link, "SELECT * FROM `".$pre."users` WHERE id = '".TP_USER_ID."'")); |
|
| 131 | 131 | if (intval($tmp) === 0) { |
| 132 | 132 | // generate key for password |
| 133 | 133 | $pwd = GenerateCryptKey(25, true, true, true, true); |
| 134 | - $salt = file_get_contents(SECUREPATH . '/' . SECUREFILE); |
|
| 134 | + $salt = file_get_contents(SECUREPATH.'/'.SECUREFILE); |
|
| 135 | 135 | $encrypted_pwd = cryption( |
| 136 | 136 | $pwd, |
| 137 | 137 | $salt, |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | // Store |
| 145 | 145 | $mysqli_result = mysqli_query( |
| 146 | 146 | $db_link, |
| 147 | - "INSERT INTO `" . $pre . "users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `public_key`, `private_key`, `is_ready_for_usage`, `otp_provided`) VALUES ('" . TP_USER_ID . "', 'TP', '".$encrypted_pwd."', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '".$userKeys['public_key']."', '".$userKeys['private_key']."', '1', '1')" |
|
| 147 | + "INSERT INTO `".$pre."users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `public_key`, `private_key`, `is_ready_for_usage`, `otp_provided`) VALUES ('".TP_USER_ID."', 'TP', '".$encrypted_pwd."', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '".$userKeys['public_key']."', '".$userKeys['private_key']."', '1', '1')" |
|
| 148 | 148 | ); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | mysqli_query( |
| 153 | 153 | $db_link, |
| 154 | 154 | 'SELECT count(*) |
| 155 | - FROM ' . $pre . 'sharekeys_items |
|
| 155 | + FROM ' . $pre.'sharekeys_items |
|
| 156 | 156 | WHERE user_id = ' . (int) TP_USER_ID |
| 157 | 157 | ) |
| 158 | 158 | ); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | mysqli_query( |
| 163 | 163 | $db_link, |
| 164 | 164 | 'SELECT pw, public_key, private_key, name, lastname, login |
| 165 | - FROM ' . $pre . 'users |
|
| 165 | + FROM ' . $pre.'users |
|
| 166 | 166 | WHERE id = ' . (int) TP_USER_ID |
| 167 | 167 | ) |
| 168 | 168 | ); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | ); |
| 179 | 179 | |
| 180 | 180 | // Return |
| 181 | - echo '[{"finish":"0" , "next":"step1", "error":"" , "data" : "' . base64_encode(json_encode($usersArray)) . '" , "number":"1" , "loop_finished" : "' . (count($listOfUsers) === 0 ? "true" : "false") . '" , "rest" : "' . base64_encode(json_encode($listOfUsers)) . '"}]'; |
|
| 181 | + echo '[{"finish":"0" , "next":"step1", "error":"" , "data" : "'.base64_encode(json_encode($usersArray)).'" , "number":"1" , "loop_finished" : "'.(count($listOfUsers) === 0 ? "true" : "false").'" , "rest" : "'.base64_encode(json_encode($listOfUsers)).'"}]'; |
|
| 182 | 182 | |
| 183 | 183 | exit(); |
| 184 | 184 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | mysqli_query( |
| 192 | 192 | $db_link, |
| 193 | 193 | 'SELECT pw, public_key, private_key, name, lastname, login |
| 194 | - FROM ' . $pre . 'users |
|
| 194 | + FROM ' . $pre.'users |
|
| 195 | 195 | WHERE id = ' . (int) $post_number |
| 196 | 196 | ) |
| 197 | 197 | ); |
@@ -221,9 +221,9 @@ discard block |
||
| 221 | 221 | // Store |
| 222 | 222 | mysqli_query( |
| 223 | 223 | $db_link, |
| 224 | - 'UPDATE ' . $pre . "users |
|
| 225 | - SET public_key = '" . $userKeys['public_key'] . "', |
|
| 226 | - private_key = '" . $userKeys['private_key'] . "', |
|
| 224 | + 'UPDATE '.$pre."users |
|
| 225 | + SET public_key = '" . $userKeys['public_key']."', |
|
| 226 | + private_key = '" . $userKeys['private_key']."', |
|
| 227 | 227 | upgrade_needed = 1, |
| 228 | 228 | special = 'otc_is_required_on_next_login' |
| 229 | 229 | WHERE id = " . $post_number |
@@ -233,31 +233,31 @@ discard block |
||
| 233 | 233 | mysqli_query( |
| 234 | 234 | $db_link, |
| 235 | 235 | 'DELETE |
| 236 | - FROM ' . $pre . 'sharekeys_items |
|
| 236 | + FROM ' . $pre.'sharekeys_items |
|
| 237 | 237 | WHERE user_id = ' . (int) $userInfo['id'] |
| 238 | 238 | ); |
| 239 | 239 | mysqli_query( |
| 240 | 240 | $db_link, |
| 241 | 241 | 'DELETE |
| 242 | - FROM ' . $pre . 'sharekeys_logs |
|
| 242 | + FROM ' . $pre.'sharekeys_logs |
|
| 243 | 243 | WHERE user_id = ' . (int) $userInfo['id'] |
| 244 | 244 | ); |
| 245 | 245 | mysqli_query( |
| 246 | 246 | $db_link, |
| 247 | 247 | 'DELETE |
| 248 | - FROM ' . $pre . 'sharekeys_fields |
|
| 248 | + FROM ' . $pre.'sharekeys_fields |
|
| 249 | 249 | WHERE user_id = ' . (int) $userInfo['id'] |
| 250 | 250 | ); |
| 251 | 251 | mysqli_query( |
| 252 | 252 | $db_link, |
| 253 | 253 | 'DELETE |
| 254 | - FROM ' . $pre . 'sharekeys_suggestions |
|
| 254 | + FROM ' . $pre.'sharekeys_suggestions |
|
| 255 | 255 | WHERE user_id = ' . (int) $userInfo['id'] |
| 256 | 256 | ); |
| 257 | 257 | mysqli_query( |
| 258 | 258 | $db_link, |
| 259 | 259 | 'DELETE |
| 260 | - FROM ' . $pre . 'sharekeys_files |
|
| 260 | + FROM ' . $pre.'sharekeys_files |
|
| 261 | 261 | WHERE user_id = ' . (int) $userInfo['id'] |
| 262 | 262 | ); |
| 263 | 263 | |
@@ -273,10 +273,10 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | // Return |
| 276 | - echo '[{"finish":"0" , "next":"step1", "error":"" , "data" : "' . base64_encode(json_encode($usersArray)) . '" , "number":"' . ((int) $post_number + 1) . '" , "loop_finished" : "' . (count($listOfUsers) === 0 ? "true" : "false") . '" , "rest" : "' . base64_encode(json_encode($listOfUsers)) . '"}]'; |
|
| 276 | + echo '[{"finish":"0" , "next":"step1", "error":"" , "data" : "'.base64_encode(json_encode($usersArray)).'" , "number":"'.((int) $post_number + 1).'" , "loop_finished" : "'.(count($listOfUsers) === 0 ? "true" : "false").'" , "rest" : "'.base64_encode(json_encode($listOfUsers)).'"}]'; |
|
| 277 | 277 | } else { |
| 278 | 278 | // No more user to treat |
| 279 | - echo '[{"finish":"0" , "next":"step2", "error":"" , "data" : "" , "number":"' . (empty($post_number) === true ? 0 : $post_number) . '" , "loop_finished" : "true" , "rest" : ""}]'; |
|
| 279 | + echo '[{"finish":"0" , "next":"step2", "error":"" , "data" : "" , "number":"'.(empty($post_number) === true ? 0 : $post_number).'" , "loop_finished" : "true" , "rest" : ""}]'; |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | exit(); |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | if ($userInfo['public_key'] === null) { |
| 299 | 299 | if ($userInfo['id'] !== TP_USER_ID) { |
| 300 | - echo '[{"finish":"1" , "next":"step3", "error":"Public key is null; provided key is '.$post_user_info.'" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "true"}]'; |
|
| 300 | + echo '[{"finish":"1" , "next":"step3", "error":"Public key is null; provided key is '.$post_user_info.'" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "true"}]'; |
|
| 301 | 301 | exit(); |
| 302 | 302 | break; |
| 303 | 303 | } else { |
@@ -306,16 +306,16 @@ discard block |
||
| 306 | 306 | mysqli_query( |
| 307 | 307 | $db_link, |
| 308 | 308 | 'SELECT pw, public_key, private_key, name, lastname, login |
| 309 | - FROM ' . $pre . 'users |
|
| 309 | + FROM ' . $pre.'users |
|
| 310 | 310 | WHERE id = ' . TP_USER_ID |
| 311 | 311 | ) |
| 312 | 312 | ); |
| 313 | 313 | |
| 314 | - $userInfo['public_key'] == $userQuery['public_key']; |
|
| 315 | - $userInfo['private_key'] == $userQuery['private_key']; |
|
| 316 | - $userInfo['login'] == $userQuery['login']; |
|
| 317 | - $userInfo['name'] == $userQuery['name']; |
|
| 318 | - $userInfo['lastname'] == $userQuery['lastname']; |
|
| 314 | + $userInfo['public_key'] == $userQuery['public_key']; |
|
| 315 | + $userInfo['private_key'] == $userQuery['private_key']; |
|
| 316 | + $userInfo['login'] == $userQuery['login']; |
|
| 317 | + $userInfo['name'] == $userQuery['name']; |
|
| 318 | + $userInfo['lastname'] == $userQuery['lastname']; |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
@@ -327,13 +327,13 @@ discard block |
||
| 327 | 327 | mysqli_query( |
| 328 | 328 | $db_link, |
| 329 | 329 | 'SELECT private_key |
| 330 | - FROM ' . $pre . 'users |
|
| 330 | + FROM ' . $pre.'users |
|
| 331 | 331 | WHERE id = ' . (int) $adminId |
| 332 | 332 | ) |
| 333 | 333 | ); |
| 334 | 334 | $adminPrivateKey = decryptPrivateKey($adminPwd, $adminQuery['private_key']); |
| 335 | 335 | if ($adminPrivateKey === false) { |
| 336 | - echo '[{"finish":"1" , "next":"step3", "error":"Admin PWD is null; provided key is '.$post_admin_info[1].'" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "true"}]'; |
|
| 336 | + echo '[{"finish":"1" , "next":"step3", "error":"Admin PWD is null; provided key is '.$post_admin_info[1].'" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "true"}]'; |
|
| 337 | 337 | exit(); |
| 338 | 338 | break; |
| 339 | 339 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | mysqli_query( |
| 344 | 344 | $db_link, |
| 345 | 345 | 'SELECT count(*) |
| 346 | - FROM ' . $pre . 'items |
|
| 346 | + FROM ' . $pre.'items |
|
| 347 | 347 | WHERE perso = 0' |
| 348 | 348 | ) |
| 349 | 349 | ); |
@@ -355,9 +355,9 @@ discard block |
||
| 355 | 355 | $rows = mysqli_query( |
| 356 | 356 | $db_link, |
| 357 | 357 | 'SELECT id, pw, encryption_type |
| 358 | - FROM ' . $pre . 'items |
|
| 358 | + FROM ' . $pre.'items |
|
| 359 | 359 | WHERE perso = 0 |
| 360 | - LIMIT ' . $post_start . ', ' . $post_count_in_loop |
|
| 360 | + LIMIT ' . $post_start.', '.$post_count_in_loop |
|
| 361 | 361 | ); |
| 362 | 362 | |
| 363 | 363 | while ($item = mysqli_fetch_array($rows)) { |
@@ -366,8 +366,8 @@ discard block |
||
| 366 | 366 | mysqli_query( |
| 367 | 367 | $db_link, |
| 368 | 368 | 'SELECT share_key |
| 369 | - FROM ' . $pre . 'sharekeys_items |
|
| 370 | - WHERE object_id = ' . (int) $item['id'] . ' AND user_id = ' . (int) $adminId |
|
| 369 | + FROM ' . $pre.'sharekeys_items |
|
| 370 | + WHERE object_id = ' . (int) $item['id'].' AND user_id = '.(int) $adminId |
|
| 371 | 371 | ) |
| 372 | 372 | ); |
| 373 | 373 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | mysqli_query( |
| 382 | 382 | $db_link, |
| 383 | 383 | 'SELECT public_key |
| 384 | - FROM ' . $pre . 'users |
|
| 384 | + FROM ' . $pre.'users |
|
| 385 | 385 | WHERE id = ' . (int) $userInfo['id'] |
| 386 | 386 | ) |
| 387 | 387 | ); |
@@ -394,15 +394,15 @@ discard block |
||
| 394 | 394 | // Save the key in DB |
| 395 | 395 | mysqli_query( |
| 396 | 396 | $db_link, |
| 397 | - 'INSERT INTO `' . $pre . 'sharekeys_items`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 398 | - VALUES (NULL,' . (int) $item['id'] . ',' . (int) $userInfo['id'] . ",'" . $share_key_for_item . "')" |
|
| 397 | + 'INSERT INTO `'.$pre.'sharekeys_items`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 398 | + VALUES (NULL,' . (int) $item['id'].','.(int) $userInfo['id'].",'".$share_key_for_item."')" |
|
| 399 | 399 | ); |
| 400 | 400 | } |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | - echo '[{"finish":"0" , "next":"step2", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "false"}]'; |
|
| 403 | + echo '[{"finish":"0" , "next":"step2", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "false"}]'; |
|
| 404 | 404 | } else { |
| 405 | - echo '[{"finish":"0" , "next":"step3", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "true"}]'; |
|
| 405 | + echo '[{"finish":"0" , "next":"step3", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "true"}]'; |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | exit(); |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | mysqli_query( |
| 430 | 430 | $db_link, |
| 431 | 431 | 'SELECT private_key |
| 432 | - FROM ' . $pre . 'users |
|
| 432 | + FROM ' . $pre.'users |
|
| 433 | 433 | WHERE id = ' . (int) $adminId |
| 434 | 434 | ) |
| 435 | 435 | ); |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | mysqli_query( |
| 441 | 441 | $db_link, |
| 442 | 442 | 'SELECT increment_id |
| 443 | - FROM ' . $pre . "log_items |
|
| 443 | + FROM ' . $pre."log_items |
|
| 444 | 444 | WHERE raison LIKE 'at_pw :%' AND encryption_type = 'teampass_aes'" |
| 445 | 445 | ) |
| 446 | 446 | ); |
@@ -452,9 +452,9 @@ discard block |
||
| 452 | 452 | $rows = mysqli_query( |
| 453 | 453 | $db_link, |
| 454 | 454 | 'SELECT increment_id |
| 455 | - FROM ' . $pre . "log_items |
|
| 455 | + FROM ' . $pre."log_items |
|
| 456 | 456 | WHERE raison LIKE 'at_pw :%' AND encryption_type = 'teampass_aes' |
| 457 | - LIMIT " . $post_start . ', ' . $post_count_in_loop |
|
| 457 | + LIMIT " . $post_start.', '.$post_count_in_loop |
|
| 458 | 458 | ); |
| 459 | 459 | |
| 460 | 460 | while ($item = mysqli_fetch_array($rows)) { |
@@ -463,8 +463,8 @@ discard block |
||
| 463 | 463 | mysqli_query( |
| 464 | 464 | $db_link, |
| 465 | 465 | 'SELECT share_key |
| 466 | - FROM ' . $pre . 'sharekeys_logs |
|
| 467 | - WHERE object_id = ' . (int) $item['id'] . ' AND user_id = ' . (int) $adminId |
|
| 466 | + FROM ' . $pre.'sharekeys_logs |
|
| 467 | + WHERE object_id = ' . (int) $item['id'].' AND user_id = '.(int) $adminId |
|
| 468 | 468 | ) |
| 469 | 469 | ); |
| 470 | 470 | |
@@ -478,15 +478,15 @@ discard block |
||
| 478 | 478 | // Save the key in DB |
| 479 | 479 | mysqli_query( |
| 480 | 480 | $db_link, |
| 481 | - 'INSERT INTO `' . $pre . 'sharekeys_logs`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 482 | - VALUES (NULL,' . (int) $item['id'] . ',' . (int) $userInfo['id'] . ",'" . $share_key_for_item . "')" |
|
| 481 | + 'INSERT INTO `'.$pre.'sharekeys_logs`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 482 | + VALUES (NULL,' . (int) $item['id'].','.(int) $userInfo['id'].",'".$share_key_for_item."')" |
|
| 483 | 483 | ); |
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | - echo '[{"finish":"0" , "next":"step3", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "false"}]'; |
|
| 487 | + echo '[{"finish":"0" , "next":"step3", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "false"}]'; |
|
| 488 | 488 | } else { |
| 489 | - echo '[{"finish":"0" , "next":"step4", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "true"}]'; |
|
| 489 | + echo '[{"finish":"0" , "next":"step4", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "true"}]'; |
|
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | exit(); |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | mysqli_query( |
| 514 | 514 | $db_link, |
| 515 | 515 | 'SELECT private_key |
| 516 | - FROM ' . $pre . 'users |
|
| 516 | + FROM ' . $pre.'users |
|
| 517 | 517 | WHERE id = ' . (int) $adminId |
| 518 | 518 | ) |
| 519 | 519 | ); |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | mysqli_query( |
| 525 | 525 | $db_link, |
| 526 | 526 | 'SELECT id |
| 527 | - FROM ' . $pre . 'categories_items' |
|
| 527 | + FROM ' . $pre.'categories_items' |
|
| 528 | 528 | ) |
| 529 | 529 | ); |
| 530 | 530 | |
@@ -533,9 +533,9 @@ discard block |
||
| 533 | 533 | $rows = mysqli_query( |
| 534 | 534 | $db_link, |
| 535 | 535 | 'SELECT id, data, encryption_type |
| 536 | - FROM ' . $pre . 'categories_items |
|
| 537 | - WHERE encryption_type = "' . TP_ENCRYPTION_NAME . '" |
|
| 538 | - LIMIT ' . $post_start . ', ' . $post_count_in_loop |
|
| 536 | + FROM ' . $pre.'categories_items |
|
| 537 | + WHERE encryption_type = "' . TP_ENCRYPTION_NAME.'" |
|
| 538 | + LIMIT ' . $post_start.', '.$post_count_in_loop |
|
| 539 | 539 | ); |
| 540 | 540 | |
| 541 | 541 | while ($item = mysqli_fetch_array($rows)) { |
@@ -544,8 +544,8 @@ discard block |
||
| 544 | 544 | mysqli_query( |
| 545 | 545 | $db_link, |
| 546 | 546 | 'SELECT share_key |
| 547 | - FROM ' . $pre . 'sharekeys_fields |
|
| 548 | - WHERE object_id = ' . (int) $item['id'] . ' AND user_id = ' . (int) $adminId |
|
| 547 | + FROM ' . $pre.'sharekeys_fields |
|
| 548 | + WHERE object_id = ' . (int) $item['id'].' AND user_id = '.(int) $adminId |
|
| 549 | 549 | ) |
| 550 | 550 | ); |
| 551 | 551 | |
@@ -559,15 +559,15 @@ discard block |
||
| 559 | 559 | // Save the key in DB |
| 560 | 560 | mysqli_query( |
| 561 | 561 | $db_link, |
| 562 | - 'INSERT INTO `' . $pre . 'sharekeys_fields`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 563 | - VALUES (NULL,' . (int) $item['id'] . ',' . (int) $userInfo['id'] . ",'" . $share_key_for_item . "')" |
|
| 562 | + 'INSERT INTO `'.$pre.'sharekeys_fields`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 563 | + VALUES (NULL,' . (int) $item['id'].','.(int) $userInfo['id'].",'".$share_key_for_item."')" |
|
| 564 | 564 | ); |
| 565 | 565 | } |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | - echo '[{"finish":"0" , "next":"step4", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "false"}]'; |
|
| 568 | + echo '[{"finish":"0" , "next":"step4", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "false"}]'; |
|
| 569 | 569 | } else { |
| 570 | - echo '[{"finish":"0" , "next":"step5", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "true"}]'; |
|
| 570 | + echo '[{"finish":"0" , "next":"step5", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "true"}]'; |
|
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | exit(); |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | mysqli_query( |
| 595 | 595 | $db_link, |
| 596 | 596 | 'SELECT private_key |
| 597 | - FROM ' . $pre . 'users |
|
| 597 | + FROM ' . $pre.'users |
|
| 598 | 598 | WHERE id = ' . (int) $adminId |
| 599 | 599 | ) |
| 600 | 600 | ); |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | mysqli_query( |
| 606 | 606 | $db_link, |
| 607 | 607 | 'SELECT id |
| 608 | - FROM ' . $pre . 'suggestion' |
|
| 608 | + FROM ' . $pre.'suggestion' |
|
| 609 | 609 | ) |
| 610 | 610 | ); |
| 611 | 611 | |
@@ -616,8 +616,8 @@ discard block |
||
| 616 | 616 | $rows = mysqli_query( |
| 617 | 617 | $db_link, |
| 618 | 618 | 'SELECT id |
| 619 | - FROM ' . $pre . 'suggestion |
|
| 620 | - LIMIT ' . $post_start . ', ' . $post_count_in_loop |
|
| 619 | + FROM ' . $pre.'suggestion |
|
| 620 | + LIMIT ' . $post_start.', '.$post_count_in_loop |
|
| 621 | 621 | ); |
| 622 | 622 | |
| 623 | 623 | while ($item = mysqli_fetch_array($rows)) { |
@@ -626,8 +626,8 @@ discard block |
||
| 626 | 626 | mysqli_query( |
| 627 | 627 | $db_link, |
| 628 | 628 | 'SELECT share_key |
| 629 | - FROM ' . $pre . 'sharekeys_suggestions |
|
| 630 | - WHERE object_id = ' . (int) $item['id'] . ' AND user_id = ' . (int) $adminId |
|
| 629 | + FROM ' . $pre.'sharekeys_suggestions |
|
| 630 | + WHERE object_id = ' . (int) $item['id'].' AND user_id = '.(int) $adminId |
|
| 631 | 631 | ) |
| 632 | 632 | ); |
| 633 | 633 | |
@@ -647,15 +647,15 @@ discard block |
||
| 647 | 647 | // Save the key in DB |
| 648 | 648 | mysqli_query( |
| 649 | 649 | $db_link, |
| 650 | - 'INSERT INTO `' . $pre . 'sharekeys_suggestions`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 651 | - VALUES (NULL,' . (int) $item['id'] . ',' . (int) $userInfo['id'] . ",'" . $share_key_for_item . "')" |
|
| 650 | + 'INSERT INTO `'.$pre.'sharekeys_suggestions`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 651 | + VALUES (NULL,' . (int) $item['id'].','.(int) $userInfo['id'].",'".$share_key_for_item."')" |
|
| 652 | 652 | ); |
| 653 | 653 | } |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | - echo '[{"finish":"0" , "next":"step5", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "false"}]'; |
|
| 656 | + echo '[{"finish":"0" , "next":"step5", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "false"}]'; |
|
| 657 | 657 | } else { |
| 658 | - echo '[{"finish":"0" , "next":"step6", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "true"}]'; |
|
| 658 | + echo '[{"finish":"0" , "next":"step6", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "true"}]'; |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | exit(); |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | mysqli_query( |
| 683 | 683 | $db_link, |
| 684 | 684 | 'SELECT private_key |
| 685 | - FROM ' . $pre . 'users |
|
| 685 | + FROM ' . $pre.'users |
|
| 686 | 686 | WHERE id = ' . (int) $adminId |
| 687 | 687 | ) |
| 688 | 688 | ); |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | mysqli_query( |
| 694 | 694 | $db_link, |
| 695 | 695 | 'SELECT id |
| 696 | - FROM ' . $pre . 'files' |
|
| 696 | + FROM ' . $pre.'files' |
|
| 697 | 697 | ) |
| 698 | 698 | ); |
| 699 | 699 | |
@@ -702,9 +702,9 @@ discard block |
||
| 702 | 702 | $rows = mysqli_query( |
| 703 | 703 | $db_link, |
| 704 | 704 | 'SELECT id |
| 705 | - FROM ' . $pre . 'files |
|
| 706 | - WHERE status = "' . TP_ENCRYPTION_NAME . '" |
|
| 707 | - LIMIT ' . $post_start . ', ' . $post_count_in_loop |
|
| 705 | + FROM ' . $pre.'files |
|
| 706 | + WHERE status = "' . TP_ENCRYPTION_NAME.'" |
|
| 707 | + LIMIT ' . $post_start.', '.$post_count_in_loop |
|
| 708 | 708 | ); |
| 709 | 709 | |
| 710 | 710 | while ($item = mysqli_fetch_array($rows)) { |
@@ -713,8 +713,8 @@ discard block |
||
| 713 | 713 | mysqli_query( |
| 714 | 714 | $db_link, |
| 715 | 715 | 'SELECT share_key |
| 716 | - FROM ' . $pre . 'sharekeys_files |
|
| 717 | - WHERE object_id = ' . (int) $item['id'] . ' AND user_id = ' . (int) $adminId |
|
| 716 | + FROM ' . $pre.'sharekeys_files |
|
| 717 | + WHERE object_id = ' . (int) $item['id'].' AND user_id = '.(int) $adminId |
|
| 718 | 718 | ) |
| 719 | 719 | ); |
| 720 | 720 | |
@@ -734,15 +734,15 @@ discard block |
||
| 734 | 734 | // Save the key in DB |
| 735 | 735 | mysqli_query( |
| 736 | 736 | $db_link, |
| 737 | - 'INSERT INTO `' . $pre . 'sharekeys_files`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 738 | - VALUES (NULL,' . (int) $item['id'] . ',' . (int) $userInfo['id'] . ",'" . $share_key_for_item . "')" |
|
| 737 | + 'INSERT INTO `'.$pre.'sharekeys_files`(`increment_id`, `object_id`, `user_id`, `share_key`) |
|
| 738 | + VALUES (NULL,' . (int) $item['id'].','.(int) $userInfo['id'].",'".$share_key_for_item."')" |
|
| 739 | 739 | ); |
| 740 | 740 | } |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - echo '[{"finish":"0" , "next":"step6", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "false"}]'; |
|
| 743 | + echo '[{"finish":"0" , "next":"step6", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "false"}]'; |
|
| 744 | 744 | } else { |
| 745 | - echo '[{"finish":"0" , "next":"nextUser", "error":"" , "data" : "" , "number":"' . $post_number . '" , "loop_finished" : "true"}]'; |
|
| 745 | + echo '[{"finish":"0" , "next":"nextUser", "error":"" , "data" : "" , "number":"'.$post_number.'" , "loop_finished" : "true"}]'; |
|
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | exit(); |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | mysqli_query( |
| 773 | 773 | $db_link, |
| 774 | 774 | 'SELECT email, name as userName |
| 775 | - FROM ' . $pre . 'users |
|
| 775 | + FROM ' . $pre.'users |
|
| 776 | 776 | WHERE id = ' . (int) $userInfo['id'] |
| 777 | 777 | ) |
| 778 | 778 | ); |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | true |
| 793 | 793 | ); |
| 794 | 794 | } catch (Exception $e) { |
| 795 | - console . log(e); |
|
| 795 | + console.log(e); |
|
| 796 | 796 | } |
| 797 | 797 | } |
| 798 | 798 | |
@@ -800,4 +800,4 @@ discard block |
||
| 800 | 800 | } |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | -echo '[{"finish":"1" , "next":"' . $next . '", "error":""}]'; |
|
| 803 | +echo '[{"finish":"1" , "next":"'.$next.'", "error":""}]'; |
|