| @@ -1056,7 +1056,7 @@ discard block | ||
| 1056 | 1056 | mysqli_query( | 
| 1057 | 1057 | $db_link, | 
| 1058 | 1058 | "ALTER TABLE `".$pre."nested_tree` CHANGE `nleft` `nleft` INT(11) NULL DEFAULT NULL, CHANGE `nright` `nright` INT(11) NULL DEFAULT NULL, CHANGE `nlevel` `nlevel` INT(11) NULL DEFAULT NULL;" | 
| 1059 | -);" | |
| 1059 | +); " | |
| 1060 | 1060 | |
| 1061 | 1061 | |
| 1062 | 1062 | |
| @@ -1076,8 +1076,8 @@ discard block | ||
| 1076 | 1076 | `folder_id` tinyint(12) NOT NULL, | 
| 1077 | 1077 | `user_id` tinyint(12) NOT NULL, | 
| 1078 | 1078 | `timestamp` varchar(50) NOT NULL DEFAULT 'none', | 
| 1079 | - PRIMARY KEY (`id`) | |
| 1080 | - ) CHARSET=utf8;" | |
| 1079 | + PRIMARY KEY(`id`) | |
| 1080 | + ) CHARSET = utf8; " | |
| 1081 | 1081 | ); | 
| 1082 | 1082 | |
| 1083 | 1083 | |
| @@ -1088,7 +1088,7 @@ discard block | ||
| 1088 | 1088 | "longblob DEFAULT NULL" | 
| 1089 | 1089 | ); | 
| 1090 | 1090 |  if ($res === false) { | 
| 1091 | -    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field content to table files! '.mysqli_error($db_link).'!"}]'; | |
| 1091 | +    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field content to table files!'.mysqli_error($db_link).'!"}]'; | |
| 1092 | 1092 | mysqli_close($db_link); | 
| 1093 | 1093 | exit(); | 
| 1094 | 1094 | } | 
| @@ -1101,8 +1101,8 @@ discard block | ||
| 1101 | 1101 | `increment_id` int(12) NOT NULL AUTO_INCREMENT, | 
| 1102 | 1102 | `item_id` int(12) NOT NULL, | 
| 1103 | 1103 | `category_id` int(12) NOT NULL, | 
| 1104 | - PRIMARY KEY (`increment_id`) | |
| 1105 | - ) CHARSET=utf8;" | |
| 1104 | + PRIMARY KEY(`increment_id`) | |
| 1105 | + ) CHARSET = utf8; " | |
| 1106 | 1106 | ); | 
| 1107 | 1107 | |
| 1108 | 1108 | |
| @@ -1115,12 +1115,12 @@ discard block | ||
| 1115 | 1115 | "VARCHAR(50) NOT NULL DEFAULT '0'" | 
| 1116 | 1116 | ); | 
| 1117 | 1117 |  if ($res === false) { | 
| 1118 | -    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field agses-usercardid to table Users! '.mysqli_error($db_link).'!"}]'; | |
| 1118 | +    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field agses - usercardid to table Users!'.mysqli_error($db_link).'!"}]'; | |
| 1119 | 1119 | mysqli_close($db_link); | 
| 1120 | 1120 | exit(); | 
| 1121 | 1121 | } | 
| 1122 | 1122 | |
| 1123 | -// fill in this new field with the current "encryption-file" status | |
| 1123 | +// fill in this new field with the current "encryption - file" status | |
| 1124 | 1124 | $tmp = mysqli_fetch_row(mysqli_query($db_link, "SELECT valeur FROM `".$pre."misc` WHERE type = 'admin' AND intitule = 'enable_attachment_encryption'")); | 
| 1125 | 1125 |  if (!empty($tmp[0])) { | 
| 1126 | 1126 |      if ($tmp[0] === "1") { | 
| @@ -1137,14 +1137,14 @@ discard block | ||
| 1137 | 1137 |  if (intval($tmp) === 0) { | 
| 1138 | 1138 | mysqli_query( | 
| 1139 | 1139 | $db_link, | 
| 1140 | -        "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`) VALUES ('9999991', 'OTV', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0')" | |
| 1140 | +        "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`) VALUES('9999991', 'OTV', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0')" | |
| 1141 | 1141 | ); | 
| 1142 | 1142 | } | 
| 1143 | 1143 | $tmp = mysqli_num_rows(mysqli_query($db_link, "SELECT * FROM `".$pre."users` WHERE id = '9999991' AND login = 'OTV'")); | 
| 1144 | 1144 |  if (intval($tmp) === 0) { | 
| 1145 | 1145 | mysqli_query( | 
| 1146 | 1146 | $db_link, | 
| 1147 | -        "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`) VALUES ('9999999', 'API', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0')" | |
| 1147 | +        "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`) VALUES('9999999', 'API', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0')" | |
| 1148 | 1148 | ); | 
| 1149 | 1149 | } | 
| 1150 | 1150 | |
| @@ -1163,7 +1163,7 @@ discard block | ||
| 1163 | 1163 | |
| 1164 | 1164 | // Remove some indexes | 
| 1165 | 1165 | mysqli_query($db_link, "ALTER TABLE ".$pre."nested_tree` DROP INDEX `id`;"); | 
| 1166 | -mysqli_query($db_link, "ALTER TABLE ".$pre."tags` DROP INDEX `id`;"); | |
| 1166 | +mysqli_query($db_link, "ALTER TABLE ".$pre."tags` DROP INDEX `id`; "); | |
| 1167 | 1167 | |
| 1168 | 1168 | |
| 1169 | 1169 | // add field masked to CATEGORIES table | 
| @@ -1173,7 +1173,7 @@ discard block | ||
| 1173 | 1173 | "tinyint(1) NOT NULL default '0'" | 
| 1174 | 1174 | ); | 
| 1175 | 1175 |  if ($res === false) { | 
| 1176 | -    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field masked to table CATEGORIES! '.mysqli_error($db_link).'!"}]'; | |
| 1176 | +    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field masked to table CATEGORIES!'.mysqli_error($db_link).'!"}]'; | |
| 1177 | 1177 | mysqli_close($db_link); | 
| 1178 | 1178 | exit(); | 
| 1179 | 1179 | } | 
| @@ -1186,7 +1186,7 @@ discard block | ||
| 1186 | 1186 | "VARCHAR(250) NOT NULL DEFAULT 'all'" | 
| 1187 | 1187 | ); | 
| 1188 | 1188 |  if ($res === false) { | 
| 1189 | -    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field role_visibility to table CATEGORIES! '.mysqli_error($db_link).'!"}]'; | |
| 1189 | +    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field role_visibility to table CATEGORIES!'.mysqli_error($db_link).'!"}]'; | |
| 1190 | 1190 | mysqli_close($db_link); | 
| 1191 | 1191 | exit(); | 
| 1192 | 1192 | } | 
| @@ -1199,7 +1199,7 @@ discard block | ||
| 1199 | 1199 | "tinyint(1) NOT NULL DEFAULT '0'" | 
| 1200 | 1200 | ); | 
| 1201 | 1201 |  if ($res === false) { | 
| 1202 | -    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field is_mandatory to table CATEGORIES! '.mysqli_error($db_link).'!"}]'; | |
| 1202 | +    echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field is_mandatory to table CATEGORIES!'.mysqli_error($db_link).'!"}]'; | |
| 1203 | 1203 | mysqli_close($db_link); | 
| 1204 | 1204 | exit(); | 
| 1205 | 1205 | } | 
| @@ -1224,10 +1224,10 @@ discard block | ||
| 1224 | 1224 | /* | 
| 1225 | 1225 | * Introduce new CONFIG file | 
| 1226 | 1226 | */ | 
| 1227 | -$tp_config_file = "../includes/config/tp.config.php"; | |
| 1227 | +$tp_config_file = ".. / includes / config / tp.config.php"; | |
| 1228 | 1228 |  if (file_exists($tp_config_file)) { | 
| 1229 | 1229 |      if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { | 
| 1230 | -        echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; | |
| 1230 | +        echo '[{"error" : "includes / config / tp.config.php file already exists and cannot be renamed.Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; | |
| 1231 | 1231 | return false; | 
| 1232 | 1232 |      } else { | 
| 1233 | 1233 | unlink($tp_config_file); | 
| @@ -1241,7 +1241,7 @@ discard block | ||
| 1241 | 1241 |  while ($row = mysqli_fetch_assoc($result)) { | 
| 1242 | 1242 | // append new setting in config file | 
| 1243 | 1243 | $config_text .= " | 
| 1244 | - '".$row['intitule']."' => '".$row['valeur']."',"; | |
| 1244 | + '".$row['intitule']."' => '".$row['valeur']."', "; | |
| 1245 | 1245 |      if ($any_settings === false) { | 
| 1246 | 1246 | $any_settings = true; | 
| 1247 | 1247 | } | 
| @@ -1253,10 +1253,10 @@ discard block | ||
| 1253 | 1253 | $result = fwrite( | 
| 1254 | 1254 | $file_handler, | 
| 1255 | 1255 | utf8_encode( | 
| 1256 | - "<?php | |
| 1256 | + " < ?php | |
| 1257 | 1257 | global \$SETTINGS; | 
| 1258 | -\$SETTINGS = array (" . $config_text." | |
| 1259 | -);" | |
| 1258 | +\$SETTINGS = array(" . $config_text." | |
| 1259 | +); " | |
| 1260 | 1260 | ) | 
| 1261 | 1261 | ); | 
| 1262 | 1262 | } | 
| @@ -1264,14 +1264,14 @@ discard block | ||
| 1264 | 1264 | |
| 1265 | 1265 | |
| 1266 | 1266 | // Generate API key by user | 
| 1267 | -$result = mysqli_query($db_link, "SELECT id FROM `".$pre."users` WHERE login NOT IN ('admin', 'API', 'OTV')"); | |
| 1267 | +$result = mysqli_query($db_link, "SELECT id FROM `".$pre."users` WHERE login NOT IN('admin', 'API', 'OTV')"); | |
| 1268 | 1268 |  while ($row = mysqli_fetch_assoc($result)) { | 
| 1269 | 1269 | // Check if key already exists | 
| 1270 | 1270 | $tmp = mysqli_num_rows(mysqli_query($db_link, "SELECT * FROM `".$pre."api` WHERE label = '".$row['id']."'")); | 
| 1271 | 1271 |      if (intval($tmp) === 0) { | 
| 1272 | 1272 | mysqli_query( | 
| 1273 | 1273 | $db_link, | 
| 1274 | -            "INSERT INTO `".$pre."api` (`type`, `label`, `value`, `timestamp`) VALUES ('user', '".$row['id']."', '".uniqidReal(39)."', '".time()."')" | |
| 1274 | +            "INSERT INTO `".$pre."api` (`type`, `label`, `value`, `timestamp`) VALUES('user', '".$row['id']."', '".uniqidReal(39)."', '".time()."')" | |
| 1275 | 1275 | ); | 
| 1276 | 1276 | } | 
| 1277 | 1277 | } | 
| @@ -1227,7 +1227,8 @@ discard block | ||
| 1227 | 1227 | $tp_config_file = "../includes/config/tp.config.php"; | 
| 1228 | 1228 |  if (file_exists($tp_config_file)) { | 
| 1229 | 1229 |      if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { | 
| 1230 | -        echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; | |
| 1230 | +        echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do { | |
| 1231 | + it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; | |
| 1231 | 1232 | return false; | 
| 1232 | 1233 |      } else { | 
| 1233 | 1234 | unlink($tp_config_file); | 
| @@ -1255,6 +1256,7 @@ discard block | ||
| 1255 | 1256 | utf8_encode( | 
| 1256 | 1257 | "<?php | 
| 1257 | 1258 | global \$SETTINGS; | 
| 1259 | +} | |
| 1258 | 1260 |  \$SETTINGS = array (" . $config_text." | 
| 1259 | 1261 | );" | 
| 1260 | 1262 | ) | 
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 
| 14 | 14 | */ | 
| 15 | 15 | global $LANG; | 
| 16 | -$LANG = array ( | |
| 16 | +$LANG = array( | |
| 17 | 17 | '2fa_authentication_selector' => '', | 
| 18 | 18 | 'user_ga_code' => 'Email Google Authentication to user', | 
| 19 | 19 | 'send_ga_code' => 'Set and email Google Authentication code', |