[SPIP] ~maj 3.0.13 -> 3.0.14
[ptitvelo/web/www.git] / www / plugins-dist / organiseur / organiseur_autoriser.php
index 15d0e67..34ad4ee 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2013                                                *
+ *  Copyright (c) 2001-2014                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -44,6 +44,9 @@ function autoriser_message_modifier_dist($faire, $type='', $id=0, $qui = NULL, $
 }
 
 function autoriser_message_instituer_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL){
+       // rediriger vers la bonne autorisation en cas de suppression
+       if ($opt['statut'] == 'poub')
+               return autoriser('supprimer','message',$id,$qui,$opt);
        return autoriser('modifier','message',$id,$qui,$opt);
 }
 
@@ -78,10 +81,11 @@ function autoriser_message_dater_dist($faire, $type='', $id=0, $qui = NULL, $opt
        return false;
 }
 
-// par defaut, autorisation commune a tous les type de message
-// peut etre surchargee en fonction de $type (pb,affich,normal)
 function autoriser_envoyermessage_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL){
-       if(!($GLOBALS['meta']['messagerie_agenda'] == 'oui') OR !intval($qui['id_auteur']))
+       if (!($GLOBALS['meta']['messagerie_agenda'] == 'oui') OR !intval($qui['id_auteur']))
+               return false;
+       // on peut envoyer une annonce si on est admin
+       if (!($qui['statut']=='0minirezo') AND $type=='affich')
                return false;
        return true;
 }