32 lines
724 B
PHP
32 lines
724 B
PHP
<?php
|
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
|
return;
|
|
}
|
|
|
|
function action_supprimer_gamuform_dist() {
|
|
|
|
|
|
$securiser_action = charger_fonction('securiser_action', 'inc');
|
|
$arg = $securiser_action();
|
|
list($id_objet,$objet) = explode('/', $arg);
|
|
include_spip('gamuform_fonctions');
|
|
|
|
if (
|
|
intval($id_objet)
|
|
and gamuform_objet_autoriser($objet)
|
|
) {
|
|
$id_objet = (int) $id_objet;
|
|
include_spip('inc/autoriser');
|
|
if (! autoriser('supprimer', 'gamuform', $id_objet, '', ['objet' => $objet])) {
|
|
return false;
|
|
}
|
|
|
|
$table = table_objet_sql($objet);
|
|
$id = id_table_objet($objet);
|
|
|
|
sql_delete($table, "$id=" . $id_objet);
|
|
|
|
include_spip('inc/invalideur');
|
|
suivre_invalideur("id='"."$id_objet"."/1");
|
|
}
|
|
}
|