Skip to content
Extraits de code Groupes Projets
Valider f569fa25 rédigé par Fil's avatar Fil
Parcourir les fichiers

amelioration des possibilites de surcharge de autoriser(), sans obliger a...

amelioration des possibilites de surcharge de autoriser(), sans obliger a passer par charger_fonction()
parent 90bd8c92
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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);
}
?>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter