-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.php
More file actions
534 lines (461 loc) · 20.7 KB
/
config.php
File metadata and controls
534 lines (461 loc) · 20.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
<?php
/*###################################################################################
# Fichier configuration du Plugin VIP_ZONE pour PluXml (Cette version est incompatible avec les versions 6 et + de PluXml)
# Auteur : Gcyrillus aka Gc-Nomade
# premiere version : Sept. 2021
# Version : 2.0.2 / Avr 2024
# Dépot github : https://github.com/gcyrillus/PLX_VIP_ZONE
# Options de configurations de Zone privatisée dans votre PluXml.
# Aide Forum : https://forum.pluxml.org/discussion/7056/plugin-vip-zone-options-de-privatisation-de-votre-pluxml#latest
###################################################################################*/ if(!defined("PLX_ROOT")) exit;
$plxAdmin = plxAdmin::getInstance();
$plxMotor = plxMotor::getInstance();
class SimpleXMLExtended extends SimpleXMLElement {
// from https://web.archive.org/web/20110223233311/http://coffeerings.posterous.com/php-simplexml-and-cdata
public function addCData($cdata_text) {
$node = dom_import_simplexml($this);
$no = $node->ownerDocument;
$node->appendChild($no->createCDATASection($cdata_text));
}
}
function updateFromCsv() {
$plxMotor = plxMotor::getInstance();
// on verfie que nos fichiers sont accessibles
if ((file_exists(PLX_ROOT.PLX_CONFIG_PATH.'users.xml')) && (($open = fopen(PLX_PLUGINS.'/vip_zone/username.csv', 'r')) !== FALSE) && (!isset($_GET['upmsg']))) {
//les fichiers existent
//préparation des tableaux verification des doublons
$loginUser=array();
$nameUser= array();
$mailUser= array();
// alimentation des tableaux avec user déjà existantes
$userLoop = $plxMotor->aUsers; foreach($userLoop as $nb => $num ){
$loginUser[]=$num['login'] ;
$nameUser[]= $num['name'] ;
$mailUser[]= $num['email'] ;
//Les tableaux seront alimentés aux cours des verifications de doublons.
}
// on commence avec le fichier csv
while (($data = fgetcsv($open, 1000, ";")) !== FALSE) {
$array[] = $data;
}
fclose($open);
// on recupere le fichier XML
$xml = file_get_contents(PLX_ROOT.PLX_CONFIG_PATH.'users.xml', true);
// on charge le fichier xml
$doc = new SimpleXMLExtended($xml);
// on compte ses enregistrements
$kids = $doc->children();
$nbUser = count($kids);
$nbUser++;
$nbRecords =0;
// on boucle sur les lignes du fichiers CSV pour récuperer les données et les ajouter aux données existantes
foreach($array as $i => $line){
$fileError ='0';
$element='';
$infoUser='';//par défaut
if($i >0) { // on passe la premiere ligne ou sont stockées les entêtes de colonnes.
$nbRecords++; // on compte les enregistrements qui sont ajoutés.
//test si données présentes
if((!isset($line[0])) or (!isset($line[1])) or (!isset($line[2])) or (!isset($line[3]))) {
echo '<p class="alert red "> '.$plxMotor->plxPlugins->aPlugins['vip_zone']->getLang('L_ERROR_BATCH_RECORDS').': <b> '.$nbRecords .'</b></p>';
continue;
}
else {
// on verifie les doublons sur login, name et email
if (in_array( $line[0], $loginUser) && $line[0] !='' && $line[1] !='' || in_array( $line[1], $nameUser)) {// verif doublon
echo '<p class="alert red "> '.L_ERR_LOGIN_ALREADY_EXISTS.$plxMotor->plxPlugins->aPlugins['vip_zone']->getLang('L_ON_LINE').': <b> '.$nbRecords .'</b></p>';
continue;
} else {
$nbUser++;
}
if (in_array( $line[1], $nameUser) && $line[1] !='') {// verif doublon
echo '<p class="alert red "> '.L_ERR_USERNAME_ALREADY_EXISTS.$plxMotor->plxPlugins->aPlugins['vip_zone']->getLang('L_ON_LINE').': <b> '.$nbRecords .'</b></p>';
continue;
}
if(isset($line[4])) {
$infoUser= $line[4];
}
if(trim($line[3])!='' AND !plxUtils::checkMail(trim($line[3]))){ // verif format email
echo '<p class="alert red "> '.L_ERR_INVALID_EMAIL.': <b> '.$nbRecords .'</b></p>';
continue;
}
if (in_array( $line[3], $mailUser)) {// verif doublon
echo '<p class="alert red "> '.L_ERR_EMAIL_ALREADY_EXISTS.$plxMotor->plxPlugins->aPlugins['vip_zone']->getLang('L_ON_LINE').': <b> '.$nbRecords .'</b></p>';
continue;
}
}
}
if(isset($line[0]) && trim($line[0]) != 'LOGIN' && isset($line[1]) && isset($line[2]) && isset($line[3])) {
// on alimente les données visiteur V.I.P.
$element = $doc->addChild('user');
$element->addAttribute('number', str_pad($nbUser, 3,'0', STR_PAD_LEFT) );
$element->addAttribute('active', '1' );
$element->addAttribute('profil', '5' );
$element->addAttribute('delete', '0' );
$loginUser[]=$line[0];
$login = $element->addChild('login');
$login->addCData($line[0]);
$nameUser[]=$line[1];
$name = $element->addChild('name');
$name->addCData($line[1]);
$infos = $element->addChild('infos');
$infos->addCData($infoUser);
// grain de sel
$salt = plxUtils::charAleatoire(10);
//cryptage du mot de passe
$pwd=sha1($salt.md5($line[2]));
$password = $element->addChild('password');
$password->addCData($pwd);
$salted = $element->addChild('salt');
$salted->addCData($salt);
$mailUser[]=$line[3];
$email = $element->addChild('email');
$email->addCData($line[3]);
$lang = $element->addChild('lang');
$lang->addCData('fr');
$password_token = $element->addChild('password_token');
$password_token->addCData('');
$password_token_expiry = $element->addChild('password_token_expiry');
$password_token_expiry->addCData('');
//On refait l'indentation du fichier parceque c'est plus joli
$xmlDoc = new DOMDocument ();
$xmlDoc->preserveWhiteSpace = false;
$xmlDoc->formatOutput = true;
$xmlDoc->loadXML ( $doc->asXML() );
// on sauvegarde le fichier xml mis à jour.
$xmlDoc->save(PLX_ROOT.PLX_CONFIG_PATH.'users.xml');
echo '<p class="alert green ">'.L_SAVE_FILE_SUCCESSFULLY.' - '.L_CONFIG_USERS_NEW.' <b> '.$nbRecords .'</b></p>';
// on vide le fichier si tout s'est bien déroulé pour le prochain enregistrement.
$open = fopen(PLX_PLUGINS."/vip_zone/username.csv", "w") ;
$fileCsv="LOGIN;NAME;PASSWORD;EMAIL \n";
fwrite($open, $fileCsv);
fclose($open);
}
}
}
else {
exit(L_SAVE_FILE_ERROR.' user.xml / username.csv.');
}
}
function addVipStatic(){
$plxMotor = plxMotor::getInstance();
$newVipStatic = $_POST["newVipStatic"] ;
// on recupere le fichier XML
#on verifie que l'on a accés au fichier de config
if (file_exists(PLX_ROOT.PLX_CONFIG_PATH.'statiques.xml')) {
$xml = file_get_contents(PLX_ROOT.PLX_CONFIG_PATH.'statiques.xml', true) ;
// on charge le fichier xml
$doc = new SimpleXMLExtended($xml);
// on recherche le dernier numero et on l'incremente de 1 pour numeroter notre nouvelle page statique.
$searchMax = new SimpleXMLElement($xml);
$numbers= array();
foreach($searchMax->statique as $a => $b) {
$numbers[]= (string)$b['number'];
}
sort($numbers);
$max= array_pop($numbers);
$max= $max + 1 ;
// on alimente les données visiteur V.I.P..
$element = $doc->addChild('statique');
$element->addAttribute('number', str_pad($max, 3,'0', STR_PAD_LEFT) );
$element->addAttribute('active', '0' );
$element->addAttribute('menu', 'oui' );
$element->addAttribute('url', $_POST["newVipStatic"] );
$element->addAttribute('template', 'static.php' );
$group = $element->addChild('group');
$group->addCData('V.I.P.');
$name = $element->addChild('name');
$name->addCData($_POST['newVipStatic']);
$meta_description = $element->addChild('meta_description');
$meta_description->addCData('');
$title_htmltag = $element->addChild('title_htmltag');
$title_htmltag->addCData('');
$date_creation = $element->addChild('date_creation');
$date_creation->addCData(date('YmdHi'));
$date_update = $element->addChild('date_update');
$date_update->addCData(date('YmdHi'));
$element = $element.'\n';
$content="<?php if (!isset(\$_SESSION['profil']) ) {\$_SESSION['pageRequest'] = \$_SERVER['REQUEST_URI'] ; header(\"Location: /core/admin/\");die;} ?>\n\n ".$plxMotor->plxPlugins->aPlugins['vip_zone']->getLang("L_NOT_FIRST_LINE");
if (!file_exists(PLX_ROOT.'data/statiques/'.$newVipStatic.'.php')) {
$open = fopen(PLX_ROOT.'data/statiques/'.str_pad($max, 3,'0', STR_PAD_LEFT).'.'.$_POST["newVipStatic"].'.php', 'w') ;
fwrite($open, $content);
fclose($open);
}
}
if (!isset($fileError)) {
$xmlDoc = new DOMDocument ();
$xmlDoc->preserveWhiteSpace = false;
$xmlDoc->formatOutput = true;
$xmlDoc->loadXML ( $doc->asXML() );
// on sauvegarde le fichier xml mis à jour.
$xmlDoc->save(PLX_ROOT.PLX_CONFIG_PATH.'statiques.xml');
echo '<p class="alert green ">'.L_SAVE_FILE_SUCCESSFULLY.'</p>';
}
else {
exit(L_SAVE_FILE_ERROR.' statiques.xml .');
}
}
// configuation : fait un backup du fichier users.xml
if (!file_exists(PLX_ROOT.PLX_CONFIG_PATH.'users.xml.bak')) {
$file = PLX_ROOT.PLX_CONFIG_PATH.'users.xml';
$newfile = PLX_ROOT.PLX_CONFIG_PATH.'users.xml.bak';
if (!copy($file, $newfile)) {
echo "La copie $file du fichier a échoué...\n";
}
else {
$jour = date("d/m/Y");
$plxPlugin->setParam('set', '<p style="color:tomato;background:#E7F16E;width:max-content;max-width:80%;padding-right:1em;margin:0 0 0.5em;"><i style="color:green"> <b>'.$jour. '</b> '.L_SAVE_FILE_SUCCESSFULLY.' </i> :<br> '.PLX_ROOT.PLX_CONFIG_PATH.'<b>users.xml.bak </b> </p>', 'cdata');
$plxPlugin->saveParams();
header('Location: parametres_plugin.php?p='.$plugin);
exit;
}
}
//maj du fichier username.csv
if(!empty($_GET['ploc'])) {
if(!empty($_POST['csv'])) {
$fileupdate = fopen(PLX_PLUGINS.$plugin."/username.csv", "w") ;
fwrite($fileupdate, $_POST['csv']);
$fileCsv=$_POST['csv'];
fclose($fileupdate);
}
updateFromCsv();
}
if (!empty($_GET['sendIt'])) {
$plxPlugin->resetPluginsToTop();
header('Location: parametres_plugin.php?p='.$plugin);
}
//maj configuration zone privatisée
if(!empty($_POST['privatize'])) {
if($_POST['privatize'] =="catart") {
$vip = "catart";
}
else if ($_POST['privatize'] =="stat") {
$vip ="static";
}
else if ($_POST['privatize'] =="blog") {
$vip ="blog";
}
else if ($_POST['privatize'] =="none") {
$vip ="none";
}
$plxPlugin->setParam('privatize', $vip, 'cdata');
$plxPlugin->saveParams();
header('Location: parametres_plugin.php?p='.$plugin);
exit;
}
//ajout d'une page static privatisé dans le groupe V.I.P.
if (!empty($_POST['newVipStatic'])) {
addVipStatic();
}
// creation du fichier username.csv si absent
if (file_exists(PLX_PLUGINS.$plugin."/username.csv")) {
$fileCsv = file_get_contents(PLX_PLUGINS.$plugin."/username.csv", true);
}
else {
$open = fopen(PLX_PLUGINS.$plugin."/username.csv", "w") ;
$fileCsv="login;name;password;email;infos\n";
fwrite($open, $fileCsv);
fclose($open);
}
?>
<?php
#verif compatibilité mode PLuXMl et mode privatisé
$configZone = $plxPlugin->getParam('privatize');
#message d'alert , devrait ne jamais s'afficher . Situation en principe gerer en amont sur le formulaire en désactivant les config incompatibles.
$messageZone='';
#selectionne le parametre active
if($configZone =="none") {$none=" selected " ;} else {$none="" ;}
if($configZone =="catart") {$catart=" selected ";} else {$catart="";}
if($configZone =="blog") {$blog=" selected " ; $static="disabled ";} else {$blog="" ;}
if($configZone =="static") {$static=" selected "; $blog="disabled"; } else {$static="";}
if(empty($plxMotor->aConf['homestatic'])) {$blog="disabled"; }
if(isset($plxMotor->aStats[$plxMotor->aConf['homestatic']]) and ($plxMotor->aStats[$plxMotor->aConf['homestatic']]['active']) =='1') {$static="disabled"; }
if ( isset($plxMotor->aStats[$plxMotor->aConf['homestatic']]) and $plxMotor->aStats[$plxMotor->aConf['homestatic']]['active'] =='1' and $configZone =="static") {
$static="disabled ";
$messageZone = "L_UNSET_PRIVATE_ZONE_STATIC_TO_NONE";
$plxPlugin->setParam('privatize', 'none', 'cdata');
$plxPlugin->saveParams();
}
else if (empty($plxMotor->aConf['homestatic'] ) and $configZone =="blog") {
$blog="disabled";
$static="";
$messageZone = "L_UNSET_PRIVATE_ZONE_BLOG_TO_NONE";
$plxPlugin->setParam('privatize', 'none', 'cdata');
$plxPlugin->saveParams();
}
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" media="screen"/>
<div class="grid-center x2">
<div class="vip-edit-zone">
<form action="" method="post">
<fieldset><legend>
<?php $plxPlugin->lang("L_VIP_ZONE_PRIVATIZED"); ?>
</legend>
<div class="gridx2">
<label><?php $plxPlugin->lang("L_VIP_ZONE_SELECTION"); ?></label>
<select name="privatize">
<option value="none" <?php echo $none; ?> ><?php $plxPlugin->lang("L_ZONE_NONE2"); ?></option>
<option value="blog" <?php echo $blog; ?> ><?php $plxPlugin->lang("L_ZONE_BLOG"); ?></option>
<option value="catart" <?php echo $catart; ?> ><?php $plxPlugin->lang("L_ZONE_CAT_ART"); ?></option>
<option value="stat" <?php echo $static; ?> ><?php $plxPlugin->lang("L_ZONE_STATIC"); ?></option>
</select>
<p class="alert red"><?php echo $plxPlugin->lang($messageZone); ?></p>
<input value="<?php $plxPlugin->lang("L_SAVE_VIP_ZONE_SELECTED"); ?>" type="submit">
</div>
</fieldset>
</form>
<form action=" " method="post" autocomplete="off">
<fieldset><legend><?php echo $plxPlugin->lang("L_NEW_STATIC_VIP").' <br> '. L_CONFIG_VIEW_HOMESTATIC_ACTIVE ?></legend>
<div class="gridx2">
<div class="gridx2">
<input type="text" placeholder="<?php echo L_STATICS_TITLE ; ?>" name="newVipStatic" >
<input type="submit" name="update" value="<?php echo L_STATICS_UPDATE ?>" />
</div>
</div>
</fieldset>
<script>
let ipt = document.querySelector("[name='newVipStatic']");
ipt.addEventListener("keyup", function () {
checkValue(ipt.value, statName_arr);
});
//verifie si le nom de page existe
const statName_arr = [<?php $noms = $plxMotor->aStats; foreach($noms as $nb => $nom){ echo "'".$nom['name']."',";} echo "'".time(); ?>'];
function checkValue(value, arr) {
for (let i = 0; i < arr.length; i++) {
let name = arr[i];
if (name == value) {
ipt.value= prompt('<?php echo L_ERR_STATIC_ALREADY_EXISTS ; ?> : ' + ipt.value +' \n\n<?php echo L_MEDIAS_NEW_NAME .':' ; ?>');
checkValue(ipt.value, arr);// juste au cas où c'est pas clair
break;
}
}
}
</script>
<aside><?php
if (!empty($_POST['newVipStatic'])) {
echo '<p class="alert orange">'.$plxPlugin->getLang("L_DO_UPDATE_NEW_VIP_STAT").' <a href="'. PLX_ROOT.'core/admin/statiques.php" style="color:#258fd6;">'. L_STATICS_PAGE_TITLE .'</a></p>';
} else {
echo '<small><a href="'. PLX_ROOT.'core/admin/statiques.php" style="color:#258fd6;">'. L_STATICS_PAGE_TITLE .'</a></small>';
} ?>
</aside>
</form>
</div>
<div class="visitorUser">
<form enctype="multipart/form-data" action="<?php echo PLX_PLUGINS.$plugin.'/upCSV.php'; ?>" method="post" >
<fieldset>
<legend><?php $plxPlugin->lang("L_BATCH_NEW_VIPS"); ?></legend>
<div class="gridx2">
<button type="button" name="blobupload" onclick="dl_CSV();" > <?php $plxPlugin->lang("L_DL_101_CSV_FILE") ?></button>
<?php if(!empty($_GET['upmsg']) && ($_GET['upmsg']=="fail")){ echo '<p class="alert red row1-2col" >'.L_SAVE_FILE_ERROR.' <br> '.L_PLUGINS_REQUIREMENTS.': '.L_FILE_REQUIRED.' <b>username.csv</b>.</p>'; } ?>
<?php if(!empty($_GET['upmsg']) && ($_GET['upmsg']=="sucess")){ echo '<p class="alert green row1-2col">'.L_SAVE_FILE_SUCCESSFULLY.'</p>'; } ?>
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<input name="userfile" type="file" accept=".csv" required ><br>
<button type="submit"> <?php $plxPlugin->lang("L_UPLOAD_NEW_CSV_FILE"); ?></button>
</div>
</fieldset>
</form>
</div>
<?php
echo ' <div class="visitorUser">
<form action="parametres_plugin.php?p='.$plugin.'&ploc=envoyer" method="post" >
<fieldset><legend> ';
$plxPlugin->lang("L_SAVE_VIP_PROFILE_FILE_ONLINE");
echo ':</legend>
<textarea name="csv" id="csv" >'. $fileCsv . '</textarea>
<br>
<input value="';
$plxPlugin->lang("L_UPDATE_NEW_USERS_CSV");
echo '" type="submit">
</fieldset>
</form>
</div>';
# on regarde si le plugin est en premiere position, sinon on affiche le formulaire de debogage.
$plugPos = (array)$plxMotor->plxPlugins->aPlugins;
foreach($plugPos as $key => $value) {
$firstKey = $key;
break;// on ne veut que la premiere clé.
}
if ($firstKey !=='vip_zone') {echo '
<div class="resetVipFirst grid-center x2 span2col ">
<form action="parametres_plugin.php?p='.$plugin.'&sendIt=first" method="post" class="span2col">
<fieldset>
<legend>'.$plxPlugin->getLang("L_LOAD_VIP_POSITION").'</legend>
<p class="alert orange span2col">'.$plxPlugin->getLang("L_LOAD_VIP_WARNING").'</p>
<label class="gridx2">'.$plxPlugin->getLang("L_LOAD_VIP_FIRST").'<input type="submit" name="resetToTop" value="'.L_PLUGINS_APPLY_BUTTON.'" ></label>
</fieldset>
</form>
</div>';
} # fin formulaire débogage
# infos configurations du plugins
$nbVIP = '0';
$nbactVIP = '0';
$nbStatVIP = '0';
foreach($plxAdmin->aUsers as $users) {
if ( $users['profil']=='5') {$nbVIP++;}
if (($users['profil']=='5') && ($users['active']=='1')) {$nbactVIP++;}
}
foreach($plxAdmin->aStats as $statpage) {
if ($statpage['group']=='V.I.P.') {$nbStatVIP++;}
}
echo '
<footer class="span2col">
<table>
<caption>'.$plxPlugin->getLang("L_INFO_CONFIG_PLUGIN").'</caption>
<tbody>
<tr>
<th>'.$plxPlugin->getLang("L_NBR_REGISTERED_VIP").'</th>
<td>'.$nbVIP.'</td>
</tr>
<tr>
<th>'.$plxPlugin->getLang("L_NBR_REGISTERED_ACTIVE_VIP").'</th>
<td>'.$nbactVIP.'</td>
</tr>
<tr>
<th>'.$plxPlugin->getLang("L_CLASS_FOR_BODY").'</th>
<td> <code>vip-mode-'.$plxPlugin->getParam('privatize').'</code></td>
</tr>
<tr>
<th>'.$plxPlugin->getLang("L_NBR_STATIC_VIP").'</th>
<td>'.$nbStatVIP.'</td>
</tr>
<tr>
<th>'.$plxPlugin->getLang("L_USER_FILE").'</th>
<td>'.PLX_ROOT.PLX_CONFIG_PATH.'<b>users.xml</b></td>
</tr>
<tr>
<th>'.$plxPlugin->getLang("L_BACKUP_USER_FILE_FIRST_INSTALL").'</th>
<td>'.$plxPlugin->getParam('set').'</td>
</tr>
<tr>
<th>'.$plxPlugin->getLang("L_BATCH_FILE_NAME_DIRECTORY").'</th>
<td>'.PLX_PLUGINS.$plugin.'/<b>username.csv</b></td>
</tr>
</tbody>
</table>
</footer>
';
?></div><!-- zone de repli code -->
<!-- code mirror -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.63.0/codemirror.min.css" integrity="sha512-6sALqOPMrNSc+1p5xOhPwGIzs6kIlST+9oGWlI4Wwcbj1saaX9J3uzO3Vub016dmHV7hM+bMi/rfXLiF5DNIZg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.63.0/codemirror.min.js" integrity="sha512-Mq3vhmcyngWQdBzrOf0SA5p9O3WePmAFfsewXSy5v3BzreKxO4WNzIYa9MyWTNBWTjERTNrU5dBnqbEKIl/4dA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.63.0/mode/meta.min.js" integrity="sha512-/2x+sfL5ERHfoViXm/UncFBzaD54f2bkjEui6w2IheEUafG2gcHJv3gQ4VDIqNr+LuApQwpnsjjrEMXI43nPzg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- add codemirror to textarea editing CSV file -->
<script>
var editor = CodeMirror.fromTextArea(document.getElementById('csv'), {
lineNumbers: true,
mode: 'text/plain',
matchBrackets: true,
});
</script>
<!-- upload default username.csv file -->
<script>
function dl_CSV() {
let link = document.createElement("a");
link.download = "username.csv";
let blob = new Blob(["Login;Name;Passsword;Email;infos\n"], {type: "text/csv"});
link.href = URL.createObjectURL(blob);
link.target="_blank"
link.click();
URL.revokeObjectURL(link.href);
}
</script>