[SPIP] ~maj SPIP v3.0.17 --> v3.0.19
[lhc/web/clavette_www.git] / www / plugins-dist / statistiques / stats_autoriser.php
1 <?php
2
3 if (!defined('_ECRIRE_INC_VERSION')) return;
4
5 function stats_autoriser(){}
6
7
8 function autoriser_statistiques_menu_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL){
9 return autoriser('voirstats', $type, $id, $qui, $opt);
10 }
11 function autoriser_referers_menu_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL){
12 return autoriser('voirstats', $type, $id, $qui, $opt);
13 }
14
15
16 // Lire les stats ?
17 // = tous les admins
18 // http://code.spip.net/@autoriser_voirstats_dist
19 function autoriser_voirstats_dist($faire, $type, $id, $qui, $opt) {
20 return (($GLOBALS['meta']["activer_statistiques"] != 'non')
21 AND ($qui['statut'] == '0minirezo'));
22 }
23
24 // autorisation des boutons et onglets
25 function autoriser_statsvisites_onglet_dist($faire, $type, $id, $qui, $opt) {
26 return autoriser('voirstats', $type, $id, $qui, $opt);
27 }
28
29 function autoriser_statsrepartition_onglet_dist($faire, $type, $id, $qui, $opt) {
30 return autoriser('voirstats', $type, $id, $qui, $opt);
31 }
32
33 function autoriser_statslang_onglet_dist($faire, $type, $id, $qui, $opt) {
34 $objets = explode(',', $GLOBALS['meta']['multi_objets']);
35 return (in_array('spip_articles', $objets)
36 OR in_array('spip_rubriques', $objets))
37 AND autoriser('voirstats', $type, $id, $qui, $opt);
38 }
39
40 function autoriser_statsreferers_onglet_dist($faire, $type, $id, $qui, $opt) {
41 return autoriser('voirstats', $type, $id, $qui, $opt);
42 }
43
44 ?>