| @@ 68-88 (lines=21) @@ | ||
| 65 | // DataBase |
|
| 66 | // Test DB connexion |
|
| 67 | $pass = defuse_return_decrypted($pass); |
|
| 68 | if (mysqli_connect( |
|
| 69 | $server, |
|
| 70 | $user, |
|
| 71 | $pass, |
|
| 72 | $database, |
|
| 73 | $port |
|
| 74 | ) |
|
| 75 | ) { |
|
| 76 | $db_link = mysqli_connect( |
|
| 77 | $server, |
|
| 78 | $user, |
|
| 79 | $pass, |
|
| 80 | $database, |
|
| 81 | $port |
|
| 82 | ); |
|
| 83 | } else { |
|
| 84 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 85 | echo '[{"finish":"1", "msg":"", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 86 | mysqli_close($db_link); |
|
| 87 | exit(); |
|
| 88 | } |
|
| 89 | ||
| 90 | ################ |
|
| 91 | ## Function permits to get the value from a line |
|
| @@ 56-76 (lines=21) @@ | ||
| 53 | // DataBase |
|
| 54 | // Test DB connexion |
|
| 55 | $pass = defuse_return_decrypted($pass); |
|
| 56 | if (mysqli_connect( |
|
| 57 | $server, |
|
| 58 | $user, |
|
| 59 | $pass, |
|
| 60 | $database, |
|
| 61 | $port |
|
| 62 | ) |
|
| 63 | ) { |
|
| 64 | $db_link = mysqli_connect( |
|
| 65 | $server, |
|
| 66 | $user, |
|
| 67 | $pass, |
|
| 68 | $database, |
|
| 69 | $port |
|
| 70 | ); |
|
| 71 | } else { |
|
| 72 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 73 | echo '[{"finish":"1", "msg":"", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 74 | mysqli_close($db_link); |
|
| 75 | exit(); |
|
| 76 | } |
|
| 77 | ||
| 78 | // Load libraries |
|
| 79 | require_once '../includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| @@ 119-139 (lines=21) @@ | ||
| 116 | ||
| 117 | // Test DB connexion |
|
| 118 | $pass = defuse_return_decrypted($pass); |
|
| 119 | if (mysqli_connect( |
|
| 120 | $server, |
|
| 121 | $user, |
|
| 122 | $pass, |
|
| 123 | $database, |
|
| 124 | $port |
|
| 125 | ) |
|
| 126 | ) { |
|
| 127 | $db_link = mysqli_connect( |
|
| 128 | $server, |
|
| 129 | $user, |
|
| 130 | $pass, |
|
| 131 | $database, |
|
| 132 | $port |
|
| 133 | ); |
|
| 134 | } else { |
|
| 135 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 136 | echo '[{"finish":"1", "msg":"", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 137 | mysqli_close($db_link); |
|
| 138 | exit(); |
|
| 139 | } |
|
| 140 | ||
| 141 | // 2.1.27 check with DEFUSE |
|
| 142 | // check if library defuse already on-going here |
|
| @@ 42-62 (lines=21) @@ | ||
| 39 | ||
| 40 | // Test DB connexion |
|
| 41 | $pass = defuse_return_decrypted($pass); |
|
| 42 | if (mysqli_connect( |
|
| 43 | $server, |
|
| 44 | $user, |
|
| 45 | $pass, |
|
| 46 | $database, |
|
| 47 | $port |
|
| 48 | ) |
|
| 49 | ) { |
|
| 50 | $db_link = mysqli_connect( |
|
| 51 | $server, |
|
| 52 | $user, |
|
| 53 | $pass, |
|
| 54 | $database, |
|
| 55 | $port |
|
| 56 | ); |
|
| 57 | } else { |
|
| 58 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 59 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 60 | mysqli_close($db_link); |
|
| 61 | exit(); |
|
| 62 | } |
|
| 63 | ||
| 64 | // Get old saltkey from saltkey_ante_2127 |
|
| 65 | $db_sk = mysqli_fetch_array( |
|
| @@ 42-62 (lines=21) @@ | ||
| 39 | ||
| 40 | // Test DB connexion |
|
| 41 | $pass = defuse_return_decrypted($pass); |
|
| 42 | if (mysqli_connect( |
|
| 43 | $server, |
|
| 44 | $user, |
|
| 45 | $pass, |
|
| 46 | $database, |
|
| 47 | $port |
|
| 48 | ) |
|
| 49 | ) { |
|
| 50 | $db_link = mysqli_connect( |
|
| 51 | $server, |
|
| 52 | $user, |
|
| 53 | $pass, |
|
| 54 | $database, |
|
| 55 | $port |
|
| 56 | ); |
|
| 57 | } else { |
|
| 58 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 59 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 60 | mysqli_close($db_link); |
|
| 61 | exit(); |
|
| 62 | } |
|
| 63 | // Get old saltkey from saltkey_ante_2127 |
|
| 64 | $db_sk = mysqli_fetch_array( |
|
| 65 | mysqli_query( |
|
| @@ 42-62 (lines=21) @@ | ||
| 39 | ||
| 40 | // Test DB connexion |
|
| 41 | $pass = defuse_return_decrypted($pass); |
|
| 42 | if (mysqli_connect( |
|
| 43 | $server, |
|
| 44 | $user, |
|
| 45 | $pass, |
|
| 46 | $database, |
|
| 47 | $port |
|
| 48 | ) |
|
| 49 | ) { |
|
| 50 | $db_link = mysqli_connect( |
|
| 51 | $server, |
|
| 52 | $user, |
|
| 53 | $pass, |
|
| 54 | $database, |
|
| 55 | $port |
|
| 56 | ); |
|
| 57 | } else { |
|
| 58 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 59 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 60 | mysqli_close($db_link); |
|
| 61 | exit(); |
|
| 62 | } |
|
| 63 | ||
| 64 | // if no encryption then stop |
|
| 65 | if ($SETTINGS['enable_attachment_encryption'] === "0") { |
|
| @@ 47-67 (lines=21) @@ | ||
| 44 | ||
| 45 | // Test DB connexion |
|
| 46 | $pass = defuse_return_decrypted($pass); |
|
| 47 | if (mysqli_connect( |
|
| 48 | $server, |
|
| 49 | $user, |
|
| 50 | $pass, |
|
| 51 | $database, |
|
| 52 | $port |
|
| 53 | ) |
|
| 54 | ) { |
|
| 55 | $db_link = mysqli_connect( |
|
| 56 | $server, |
|
| 57 | $user, |
|
| 58 | $pass, |
|
| 59 | $database, |
|
| 60 | $port |
|
| 61 | ); |
|
| 62 | } else { |
|
| 63 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 64 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 65 | mysqli_close($db_link); |
|
| 66 | exit(); |
|
| 67 | } |
|
| 68 | ||
| 69 | // if no encryption then stop |
|
| 70 | if ($SETTINGS['enable_attachment_encryption'] === "0") { |
|
| @@ 41-61 (lines=21) @@ | ||
| 38 | ||
| 39 | // Test DB connexion |
|
| 40 | $pass = defuse_return_decrypted($pass); |
|
| 41 | if (mysqli_connect( |
|
| 42 | $server, |
|
| 43 | $user, |
|
| 44 | $pass, |
|
| 45 | $database, |
|
| 46 | $port |
|
| 47 | ) |
|
| 48 | ) { |
|
| 49 | $db_link = mysqli_connect( |
|
| 50 | $server, |
|
| 51 | $user, |
|
| 52 | $pass, |
|
| 53 | $database, |
|
| 54 | $port |
|
| 55 | ); |
|
| 56 | } else { |
|
| 57 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 58 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 59 | mysqli_close($db_link); |
|
| 60 | exit(); |
|
| 61 | } |
|
| 62 | ||
| 63 | // Get old saltkey from saltkey_ante_2127 |
|
| 64 | $db_sk = mysqli_fetch_array( |
|
| @@ 42-62 (lines=21) @@ | ||
| 39 | ||
| 40 | // Test DB connexion |
|
| 41 | $pass = defuse_return_decrypted($pass); |
|
| 42 | if (mysqli_connect( |
|
| 43 | $server, |
|
| 44 | $user, |
|
| 45 | $pass, |
|
| 46 | $database, |
|
| 47 | $port |
|
| 48 | ) |
|
| 49 | ) { |
|
| 50 | $db_link = mysqli_connect( |
|
| 51 | $server, |
|
| 52 | $user, |
|
| 53 | $pass, |
|
| 54 | $database, |
|
| 55 | $port |
|
| 56 | ); |
|
| 57 | } else { |
|
| 58 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 59 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 60 | mysqli_close($db_link); |
|
| 61 | exit(); |
|
| 62 | } |
|
| 63 | ||
| 64 | // Get old saltkey from saltkey_ante_2127 |
|
| 65 | $db_sk = mysqli_fetch_array( |
|
| @@ 54-74 (lines=21) @@ | ||
| 51 | ||
| 52 | // Test DB connexion |
|
| 53 | $pass = defuse_return_decrypted($pass); |
|
| 54 | if (mysqli_connect( |
|
| 55 | $server, |
|
| 56 | $user, |
|
| 57 | $pass, |
|
| 58 | $database, |
|
| 59 | $port |
|
| 60 | ) |
|
| 61 | ) { |
|
| 62 | $db_link = mysqli_connect( |
|
| 63 | $server, |
|
| 64 | $user, |
|
| 65 | $pass, |
|
| 66 | $database, |
|
| 67 | $port |
|
| 68 | ); |
|
| 69 | } else { |
|
| 70 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 71 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 72 | mysqli_close($db_link); |
|
| 73 | exit(); |
|
| 74 | } |
|
| 75 | ||
| 76 | fputs($dbgDuo, (string) "\n\nSELECT id, pw, pw_iv FROM ".$pre."items |
|
| 77 | WHERE perso = '0' LIMIT ".$post_start.", ".$post_nb."\n"); |
|
| @@ 54-74 (lines=21) @@ | ||
| 51 | ||
| 52 | // Test DB connexion |
|
| 53 | $pass = defuse_return_decrypted($pass); |
|
| 54 | if (mysqli_connect( |
|
| 55 | $server, |
|
| 56 | $user, |
|
| 57 | $pass, |
|
| 58 | $database, |
|
| 59 | $port |
|
| 60 | ) |
|
| 61 | ) { |
|
| 62 | $db_link = mysqli_connect( |
|
| 63 | $server, |
|
| 64 | $user, |
|
| 65 | $pass, |
|
| 66 | $database, |
|
| 67 | $port |
|
| 68 | ); |
|
| 69 | } else { |
|
| 70 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 71 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 72 | mysqli_close($db_link); |
|
| 73 | exit(); |
|
| 74 | } |
|
| 75 | ||
| 76 | fputs($dbgDuo, (string) "\nStarting suggestion.\n\n"); |
|
| 77 | // decrypt passwords in suggestion table |
|
| @@ 48-68 (lines=21) @@ | ||
| 45 | ||
| 46 | // Test DB connexion |
|
| 47 | $pass = defuse_return_decrypted($pass); |
|
| 48 | if (mysqli_connect( |
|
| 49 | $server, |
|
| 50 | $user, |
|
| 51 | $pass, |
|
| 52 | $database, |
|
| 53 | $port |
|
| 54 | ) |
|
| 55 | ) { |
|
| 56 | $db_link = mysqli_connect( |
|
| 57 | $server, |
|
| 58 | $user, |
|
| 59 | $pass, |
|
| 60 | $database, |
|
| 61 | $port |
|
| 62 | ); |
|
| 63 | } else { |
|
| 64 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
|
| 65 | echo '[{"finish":"1", "next":"", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
|
| 66 | mysqli_close($db_link); |
|
| 67 | exit(); |
|
| 68 | } |
|
| 69 | ||
| 70 | //Update CACHE table -> this will be the last task during update |
|
| 71 | if ($post_type === "reload_cache_table" || empty($post_type)) { |
|