diff --git a/ecrire/inc/autoriser.php b/ecrire/inc/autoriser.php index 2bf5d33862937f61e7363fd655568988f2e56cc4..27e612935d288903ebf5e4afa138571e6f41dda4 100644 --- a/ecrire/inc/autoriser.php +++ b/ecrire/inc/autoriser.php @@ -13,6 +13,18 @@ if (!defined("_ECRIRE_INC_VERSION")) return; +define ('_DEBUG_AUTORISER', false); + +// surcharge possible de autoriser(), sinon autoriser_dist() +// http://doc.spip.org/@autoriser +if (!function_exists('autoriser')) { + function autoriser() { + $args = func_get_args(); + return call_user_func_array('autoriser_dist', $args); + } +} + + // API pour une fonction generique d'autorisation : // $qui est : vide (on prend alors auteur_session) // un id_auteur (on regarde dans la base) @@ -24,9 +36,9 @@ if (!defined("_ECRIRE_INC_VERSION")) return; // (par exemple pour preciser si l'autorisation concerne tel ou tel champ) // // Seul le premier argument est obligatoire -define ('_DEBUG_AUTORISER', false); -// http://doc.spip.org/@autoriser -function autoriser($faire, $type='', $id=0, $qui = NULL, $opt = NULL) { +// +// http://doc.spip.org/@autoriser_dist +function autoriser_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL) { static $restreint = array(); // Qui ? auteur_session ? @@ -202,5 +214,4 @@ function autoriser_moderer_petition_dist($faire, $type, $id, $qui, $opt) { autoriser('modifier', $type, $id, $qui, $opt); } - ?>