action.php 585 B

12345678910111213141516171819202122232425
  1. <?php
  2. //Sauvegarde des configurations de Restriction IP (WhiteList)
  3. Action::register('whitelist_setting_save',function(&$response){
  4. global $_,$conf;
  5. User::check_access('whitelist','configure');
  6. //Si input file "multiple", possibilité de normaliser le
  7. //tableau $_FILES récupéré avec la fonction => normalize_php_files();
  8. foreach(Configuration::setting('whitelist') as $key=>$value){
  9. if(!is_array($value)) continue;
  10. $allowed[] = $key;
  11. }
  12. foreach ($_['fields'] as $key => $value) {
  13. if(in_array($key, $allowed))
  14. $conf->put($key,$value);
  15. }
  16. });
  17. ?>