[SPIP] ~maj 3.0.10 --> 3.0.14
[lhc/web/www.git] / www / plugins-dist / urls_etendues / action / supprimer_url.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined("_ECRIRE_INC_VERSION")) return;
14
15 function action_supprimer_url_dist($arg=null) {
16
17 if (is_null($arg)){
18 // Rien a faire ici pour le moment
19 $securiser_action = charger_fonction('securiser_action', 'inc');
20 $arg = $securiser_action();
21 }
22 $arg = explode('-',$arg);
23 $id_parent = array_shift($arg);
24 $url = implode('-',$arg);
25
26 $where = 'id_parent='.intval($id_parent)." AND url=".sql_quote($url);
27 if($row = sql_fetsel('*','spip_urls',$where)){
28
29 if (autoriser('modifier',$row['type'],$row['id_objet'])){
30 sql_delete('spip_urls',$where);
31 }
32 else
33 spip_log('supprimer sans autorisation l\'URL '.$id_parent."://".$url,"urls."._LOG_ERREUR);
34
35 }
36 else
37 spip_log('Impossible de supprimer une URL inconnue '.$id_parent."://".$url,"urls."._LOG_INFO_IMPORTANTE);
38
39
40 }