3 * Plugin Acces Restreint 3.0 pour Spip 2.0
4 * Licence GPL (c) 2006-2008 Cedric Morin
8 if (!defined("_ECRIRE_INC_VERSION")) return;
10 function formulaires_configurer_accesrestreint_charger_dist(){
12 'accesrestreint_proteger_documents' => isset($GLOBALS['meta']["accesrestreint_proteger_documents"])?
$GLOBALS['meta']["accesrestreint_proteger_documents"]:'non',
13 'creer_htpasswd' => $GLOBALS['meta']["creer_htpasswd"]?
$GLOBALS['meta']["creer_htpasswd"]:'non',
19 function formulaires_configurer_accesrestreint_traiter_dist(){
21 $champs = array('accesrestreint_proteger_documents','creer_htpasswd');
22 $current = $GLOBALS['meta']["accesrestreint_proteger_documents"];
24 foreach($champs as $c)
25 ecrire_meta($c,_request($c)=='oui'?
'oui':'non');
27 // generer/supprimer les fichiers htaccess qui vont bien
28 include_spip("inc/accesrestreint_documents");
29 accesrestreint_gerer_htaccess($GLOBALS['meta']["accesrestreint_proteger_documents"]=="oui");
31 // si le reglage du htaccess a change, purger le cache
32 if ($GLOBALS['meta']["accesrestreint_proteger_documents"]!==$current) {
33 $purger = charger_fonction("purger","action");
37 return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);