23 lines
632 B
PHP
23 lines
632 B
PHP
<?php
|
|
if (!defined('_ECRIRE_INC_VERSION')) return;
|
|
|
|
function action_changer_statut_message_dist(){
|
|
include_spip('inc/autoriser');
|
|
if (!autoriser("modifier","message")) {
|
|
return false;
|
|
}
|
|
|
|
$securiser_action = charger_fonction('securiser_action', 'inc');
|
|
$args = $securiser_action();
|
|
|
|
list($id_message, $statut) = explode('-', $args);
|
|
if (!intval($id_message) || !in_array($statut, ['prepa', 'prop', 'publie', 'poubelle'])) {
|
|
return false;
|
|
}
|
|
|
|
sql_updateq('spip_messages', ['statut' => $statut], ['id_message=' . $id_message]);
|
|
|
|
// Cache
|
|
include_spip('inc/invalideur');
|
|
suivre_invalideur("id='messages/$id_message'");
|
|
}
|