wip: si obfusquer => on enregistre le nom du fichier initial dans le champ fichier_origine
This commit is contained in:
parent
9ab900502a
commit
9aec7e9cda
5 changed files with 17 additions and 10 deletions
|
@ -1,12 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||||
|
|
||||||
function action_bigform_supprimer_doc_dist(){
|
function action_bigform_supprimer_doc_dist($arg = null){
|
||||||
|
|
||||||
|
if ($arg === null) {
|
||||||
$securiser_action = charger_fonction('securiser_action', 'inc');
|
$securiser_action = charger_fonction('securiser_action', 'inc');
|
||||||
$arg = $securiser_action();
|
$arg = $securiser_action();
|
||||||
list($id_document, $id_objet, $objet) = explode('-', $arg);
|
list($id_document, $id_objet, $objet) = explode('-', $arg);
|
||||||
|
} else {
|
||||||
|
list($id_document, $id_objet, $objet) = $arg;
|
||||||
|
}
|
||||||
|
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@ if (!defined('_ECRIRE_INC_VERSION')){
|
||||||
|
|
||||||
function bigform_declarer_tables_principales($tables_principales){
|
function bigform_declarer_tables_principales($tables_principales){
|
||||||
|
|
||||||
$tables_principales['spip_documents']['field']['protected'] = 'varchar(5) NOT NULL';
|
$tables_principales['spip_documents']['field']['protected'] = 'varchar(5) NOT NULL';
|
||||||
|
$tables_principales['spip_documents']['field']['fichier_origine'] = 'varchar(255) NOT NULL';
|
||||||
|
|
||||||
return $tables_principales;
|
return $tables_principales;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ function bigform_upgrade($nom_meta_base_version, $version_cible) {
|
||||||
['maj_tables', ['spip_documents']],
|
['maj_tables', ['spip_documents']],
|
||||||
['ecrire_meta', 'bigup', serialize($config_defaut)]];
|
['ecrire_meta', 'bigup', serialize($config_defaut)]];
|
||||||
$maj['1.0.1'] = [['ecrire_meta', 'bigup', serialize($config_defaut)]];
|
$maj['1.0.1'] = [['ecrire_meta', 'bigup', serialize($config_defaut)]];
|
||||||
$maj['1.0.4'] = [['maj_tables', ['spip_documents']]];
|
$maj['1.0.5'] = [['maj_tables', ['spip_documents']]];
|
||||||
|
|
||||||
include_spip('base/upgrade');
|
include_spip('base/upgrade');
|
||||||
maj_plugin($nom_meta_base_version, $version_cible, $maj);
|
maj_plugin($nom_meta_base_version, $version_cible, $maj);
|
||||||
|
|
|
@ -27,7 +27,10 @@ function bigform_obfusquer_doc($Tid_doc){
|
||||||
if (file_exists($source)) {
|
if (file_exists($source)) {
|
||||||
$d = deplacer_fichier_upload($source, $dest, true);
|
$d = deplacer_fichier_upload($source, $dest, true);
|
||||||
if ($d) {
|
if ($d) {
|
||||||
sql_updateq('spip_documents',['fichier' => $fichier_ob], 'id_document='.$id);
|
sql_updateq('spip_documents',[
|
||||||
|
'fichier' => $fichier_ob,
|
||||||
|
'fichier_origine' => $fichier,
|
||||||
|
], 'id_document='.$id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<paquet
|
<paquet
|
||||||
prefix="bigform"
|
prefix="bigform"
|
||||||
categorie="edition"
|
categorie="edition"
|
||||||
version="1.2.1"
|
version="1.2.2"
|
||||||
etat="dev"
|
etat="dev"
|
||||||
compatibilite="[3.2.5;4.1.*]"
|
compatibilite="[3.2.5;4.1.*]"
|
||||||
logo="prive/themes/spip/images/bigform-64.png"
|
logo="prive/themes/spip/images/bigform-64.png"
|
||||||
documentation=""
|
documentation=""
|
||||||
schema="1.0.4"
|
schema="1.0.5"
|
||||||
>
|
>
|
||||||
|
|
||||||
<nom>BigForm</nom>
|
<nom>BigForm</nom>
|
||||||
|
|
Loading…
Add table
Reference in a new issue