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
|
// Champs à créer
$create = [
'id INTEGER PRIMARY KEY, -- Numéro attribué automatiquement',
'id_categorie INTEGER NOT NULL, -- Numéro de catégorie',
'date_connexion TEXT NULL, -- Date de dernière connexion',
'date_inscription TEXT NOT NULL DEFAULT CURRENT_DATE, -- Date d\'inscription',
'secret_otp TEXT NULL, -- Code secret pour TOTP'
];
$create_keys = [
'FOREIGN KEY (id_categorie) REFERENCES membres_categories (id)'
];
// Champs à recopier
$copy = [
'id',
'id_categorie',
'date_connexion',
'date_inscription',
'secret_otp',
];
$anciens_champs = $config->get('champs_membres');
$anciens_champs = is_null($anciens_champs) ? $this->champs : $anciens_champs->getAll();
foreach ($this->champs as $key=>$cfg)
{
|
|
>
>
|
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
|
// Champs à créer
$create = [
'id INTEGER PRIMARY KEY, -- Numéro attribué automatiquement',
'id_categorie INTEGER NOT NULL, -- Numéro de catégorie',
'date_connexion TEXT NULL, -- Date de dernière connexion',
'date_inscription TEXT NOT NULL DEFAULT CURRENT_DATE, -- Date d\'inscription',
'secret_otp TEXT NULL, -- Code secret pour TOTP',
'clef_pgp TEXT NULL, -- Clé publique PGP'
];
$create_keys = [
'FOREIGN KEY (id_categorie) REFERENCES membres_categories (id)'
];
// Champs à recopier
$copy = [
'id',
'id_categorie',
'date_connexion',
'date_inscription',
'secret_otp',
'clef_pgp',
];
$anciens_champs = $config->get('champs_membres');
$anciens_champs = is_null($anciens_champs) ? $this->champs : $anciens_champs->getAll();
foreach ($this->champs as $key=>$cfg)
{
|