X-Git-Url: http://git.cyclocoop.org/?p=lhc%2Fweb%2Fclavette_www.git;a=blobdiff_plain;f=www%2Fplugins-dist%2Furls_etendues%2Furls_pipeline.php;h=bf64ede1ea600984199b603f258905b9ba126017;hp=eeb1b30c45992963e8f63f2a1553278e6c3b79c1;hb=cc641eb476987612f6d6df1a5417c1c5582a8ab8;hpb=7d84a490677fb716a1fd4df260f8eab35f6a8506 diff --git a/www/plugins-dist/urls_etendues/urls_pipeline.php b/www/plugins-dist/urls_etendues/urls_pipeline.php index eeb1b30..bf64ede 100644 --- a/www/plugins-dist/urls_etendues/urls_pipeline.php +++ b/www/plugins-dist/urls_etendues/urls_pipeline.php @@ -2,7 +2,7 @@ /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * - * Copyright (c) 2001-2014 * + * Copyright (c) 2001-2016 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * @@ -25,6 +25,24 @@ function autoriser_controlerurls_menu_dist($faire, $type='', $id=0, $qui = NULL, return autoriser('administrer','url'); } +function autoriser_modifierurl($faire, $type='', $id=0, $qui = NULL, $opt = NULL){ + if (autoriser('modifier',$type,$id,$qui,$opt)){ + return true; + } + + // si pas le droit de 'modifier', regarder d'un peu plus pres pourquoi + if (!$type OR !intval($id)) { + return false; + } + // verifier si l'objet existe encore en base + $table_sql = table_objet_sql($type); + $primary = id_table_objet($type); + if (!sql_countsel($table_sql,"$primary=".intval($id))){ + return autoriser('administrer','url'); + } + return false; +} + function urls_afficher_fiche_objet($flux){ if (isset($GLOBALS['meta']['urls_activer_controle']) AND $GLOBALS['meta']['urls_activer_controle']=='oui' @@ -40,4 +58,4 @@ function urls_afficher_fiche_objet($flux){ } return $flux; } -?> \ No newline at end of file +?>