41 lines
870 B
PHP
41 lines
870 B
PHP
<?php
|
|
/**
|
|
* Utilisation de l'action supprimer pour l'objet aut_mod
|
|
*
|
|
* @plugin Autorisations étendues
|
|
* @copyright 2020
|
|
* @author tofulm
|
|
* @licence GNU/GPL
|
|
* @package SPIP\Auted\Action
|
|
*/
|
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* Action pour supprimer un·e aut_mod
|
|
*
|
|
* Vérifier l'autorisation avant d'appeler l'action.
|
|
*
|
|
* @param null|int $arg
|
|
* Identifiant à supprimer.
|
|
* En absence de id utilise l'argument de l'action sécurisée.
|
|
**/
|
|
function action_supprimer_aut_mod_dist($arg=null) {
|
|
if (is_null($arg)){
|
|
$securiser_action = charger_fonction('securiser_action', 'inc');
|
|
$arg = $securiser_action();
|
|
}
|
|
$arg = intval($arg);
|
|
|
|
// cas suppression
|
|
if ($arg) {
|
|
sql_delete('spip_aut_mods', 'id_aut_mod=' . sql_quote($arg));
|
|
}
|
|
else {
|
|
spip_log("action_supprimer_aut_mod_dist $arg pas compris");
|
|
}
|
|
}
|