@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Rubriques |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | include_spip('inc/actions'); |
@@ -28,21 +28,21 @@ discard block |
||
| 28 | 28 | * @uses ajax_retour() |
| 29 | 29 | **/ |
| 30 | 30 | function exec_selectionner_dist() { |
| 31 | - $id = intval(_request('id')); |
|
| 32 | - $exclus = intval(_request('exclus')); |
|
| 33 | - $type = _request('type'); |
|
| 34 | - $rac = _request('racine'); |
|
| 35 | - $do = _request('do'); |
|
| 36 | - if (preg_match('/^\w*$/', $do)) { |
|
| 37 | - if (!$do) { |
|
| 38 | - $do = 'aff'; |
|
| 39 | - } |
|
| 31 | + $id = intval(_request('id')); |
|
| 32 | + $exclus = intval(_request('exclus')); |
|
| 33 | + $type = _request('type'); |
|
| 34 | + $rac = _request('racine'); |
|
| 35 | + $do = _request('do'); |
|
| 36 | + if (preg_match('/^\w*$/', $do)) { |
|
| 37 | + if (!$do) { |
|
| 38 | + $do = 'aff'; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - $selectionner = charger_fonction('selectionner', 'inc'); |
|
| 41 | + $selectionner = charger_fonction('selectionner', 'inc'); |
|
| 42 | 42 | |
| 43 | - $r = $selectionner($id, 'choix_parent', $exclus, $rac, $type != 'breve', $do); |
|
| 44 | - } else { |
|
| 45 | - $r = ''; |
|
| 46 | - } |
|
| 47 | - ajax_retour($r); |
|
| 43 | + $r = $selectionner($id, 'choix_parent', $exclus, $rac, $type != 'breve', $do); |
|
| 44 | + } else { |
|
| 45 | + $r = ''; |
|
| 46 | + } |
|
| 47 | + ajax_retour($r); |
|
| 48 | 48 | } |
@@ -17,40 +17,40 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Exec de la page de destruction des tables de SPIP |
| 25 | 25 | **/ |
| 26 | 26 | function exec_base_delete_all_dist() { |
| 27 | - include_spip('inc/autoriser'); |
|
| 28 | - if (!autoriser('detruire')) { |
|
| 29 | - include_spip('inc/minipres'); |
|
| 30 | - echo minipres(); |
|
| 31 | - } else { |
|
| 32 | - include_spip('base/dump'); |
|
| 33 | - $res = base_lister_toutes_tables('', [], [], true); |
|
| 34 | - if (!$res) { |
|
| 35 | - include_spip('inc/minipres'); |
|
| 36 | - spip_log('Erreur base de donnees'); |
|
| 37 | - echo minipres( |
|
| 38 | - _T('info_travaux_titre'), |
|
| 39 | - _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 40 | - ); |
|
| 41 | - } else { |
|
| 42 | - $res = base_saisie_tables('delete', $res); |
|
| 43 | - include_spip('inc/headers'); |
|
| 44 | - $res = "\n<ol style='text-align:left'><li>\n" . |
|
| 45 | - join("</li>\n<li>", $res) . |
|
| 46 | - '</li></ol>'; |
|
| 47 | - $admin = charger_fonction('admin', 'inc'); |
|
| 48 | - $res = $admin('delete_all', _T('titre_page_delete_all'), $res); |
|
| 49 | - if (!$res) { |
|
| 50 | - redirige_url_ecrire('install', ''); |
|
| 51 | - } else { |
|
| 52 | - echo $res; |
|
| 53 | - } |
|
| 54 | - } |
|
| 55 | - } |
|
| 27 | + include_spip('inc/autoriser'); |
|
| 28 | + if (!autoriser('detruire')) { |
|
| 29 | + include_spip('inc/minipres'); |
|
| 30 | + echo minipres(); |
|
| 31 | + } else { |
|
| 32 | + include_spip('base/dump'); |
|
| 33 | + $res = base_lister_toutes_tables('', [], [], true); |
|
| 34 | + if (!$res) { |
|
| 35 | + include_spip('inc/minipres'); |
|
| 36 | + spip_log('Erreur base de donnees'); |
|
| 37 | + echo minipres( |
|
| 38 | + _T('info_travaux_titre'), |
|
| 39 | + _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 40 | + ); |
|
| 41 | + } else { |
|
| 42 | + $res = base_saisie_tables('delete', $res); |
|
| 43 | + include_spip('inc/headers'); |
|
| 44 | + $res = "\n<ol style='text-align:left'><li>\n" . |
|
| 45 | + join("</li>\n<li>", $res) . |
|
| 46 | + '</li></ol>'; |
|
| 47 | + $admin = charger_fonction('admin', 'inc'); |
|
| 48 | + $res = $admin('delete_all', _T('titre_page_delete_all'), $res); |
|
| 49 | + if (!$res) { |
|
| 50 | + redirige_url_ecrire('install', ''); |
|
| 51 | + } else { |
|
| 52 | + echo $res; |
|
| 53 | + } |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 24 | - return; |
|
| 24 | + return; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -29,16 +29,16 @@ discard block |
||
| 29 | 29 | $GLOBALS['delais'] = 0;// pas de cache ! |
| 30 | 30 | // Securite |
| 31 | 31 | if (strstr($fond, '/')) { |
| 32 | - if ( |
|
| 33 | - !include_spip('inc/autoriser') |
|
| 34 | - or !autoriser('webmestre') |
|
| 35 | - ) { |
|
| 36 | - include_spip('inc/minipres'); |
|
| 37 | - echo minipres(); |
|
| 38 | - exit; |
|
| 39 | - } |
|
| 32 | + if ( |
|
| 33 | + !include_spip('inc/autoriser') |
|
| 34 | + or !autoriser('webmestre') |
|
| 35 | + ) { |
|
| 36 | + include_spip('inc/minipres'); |
|
| 37 | + echo minipres(); |
|
| 38 | + exit; |
|
| 39 | + } |
|
| 40 | 40 | } else { |
| 41 | - $fond = "prive/squelettes/$fond"; |
|
| 41 | + $fond = "prive/squelettes/$fond"; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // quelques inclusions et ini prealables |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | * @todo supprimer cette fonction vide ? |
| 51 | 51 | **/ |
| 52 | 52 | function shutdown_error() { |
| 53 | - // si on arrive ici avec un tampon non ferme : erreur fatale |
|
| 54 | - /* if (ob_get_level()){ |
|
| 53 | + // si on arrive ici avec un tampon non ferme : erreur fatale |
|
| 54 | + /* if (ob_get_level()){ |
|
| 55 | 55 | // envoyer tous les tampons |
| 56 | 56 | while (ob_get_level()) |
| 57 | 57 | ob_end_flush(); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -28,49 +28,49 @@ discard block |
||
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | 30 | function enregistre_modif_plugin() { |
| 31 | - include_spip('inc/plugin'); |
|
| 32 | - // recuperer les plugins dans l'ordre des $_POST |
|
| 33 | - $test = []; |
|
| 34 | - foreach (liste_plugin_files() as $file) { |
|
| 35 | - $test['s' . substr(md5(_DIR_PLUGINS . $file), 0, 16)] = $file; |
|
| 36 | - } |
|
| 37 | - if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 38 | - foreach (liste_plugin_files(_DIR_PLUGINS_SUPPL) as $file) { |
|
| 39 | - $test['s' . substr(md5(_DIR_PLUGINS_SUPPL . $file), 0, 16)] = $file; |
|
| 40 | - } |
|
| 41 | - } |
|
| 31 | + include_spip('inc/plugin'); |
|
| 32 | + // recuperer les plugins dans l'ordre des $_POST |
|
| 33 | + $test = []; |
|
| 34 | + foreach (liste_plugin_files() as $file) { |
|
| 35 | + $test['s' . substr(md5(_DIR_PLUGINS . $file), 0, 16)] = $file; |
|
| 36 | + } |
|
| 37 | + if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 38 | + foreach (liste_plugin_files(_DIR_PLUGINS_SUPPL) as $file) { |
|
| 39 | + $test['s' . substr(md5(_DIR_PLUGINS_SUPPL . $file), 0, 16)] = $file; |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - $plugin = []; |
|
| 43 | + $plugin = []; |
|
| 44 | 44 | |
| 45 | - foreach ($_POST as $choix => $val) { |
|
| 46 | - if (isset($test[$choix]) && $val == 'O') { |
|
| 47 | - $plugin[] = $test[$choix]; |
|
| 48 | - } |
|
| 49 | - } |
|
| 45 | + foreach ($_POST as $choix => $val) { |
|
| 46 | + if (isset($test[$choix]) && $val == 'O') { |
|
| 47 | + $plugin[] = $test[$choix]; |
|
| 48 | + } |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - spip_log("Changement des plugins actifs par l'auteur " . $GLOBALS['visiteur_session']['id_auteur'] . ': ' . join( |
|
| 52 | - ',', |
|
| 53 | - $plugin |
|
| 54 | - )); |
|
| 55 | - ecrire_plugin_actifs($plugin); |
|
| 51 | + spip_log("Changement des plugins actifs par l'auteur " . $GLOBALS['visiteur_session']['id_auteur'] . ': ' . join( |
|
| 52 | + ',', |
|
| 53 | + $plugin |
|
| 54 | + )); |
|
| 55 | + ecrire_plugin_actifs($plugin); |
|
| 56 | 56 | |
| 57 | - // Chaque fois que l'on valide des plugins, on memorise la liste de ces plugins comme etant "interessants", avec un score initial, qui sera decremente a chaque tour : ainsi un plugin active pourra reter visible a l'ecran, jusqu'a ce qu'il tombe dans l'oubli. |
|
| 58 | - $plugins_interessants = @unserialize($GLOBALS['meta']['plugins_interessants']); |
|
| 59 | - if (!is_array($plugins_interessants)) { |
|
| 60 | - $plugins_interessants = []; |
|
| 61 | - } |
|
| 57 | + // Chaque fois que l'on valide des plugins, on memorise la liste de ces plugins comme etant "interessants", avec un score initial, qui sera decremente a chaque tour : ainsi un plugin active pourra reter visible a l'ecran, jusqu'a ce qu'il tombe dans l'oubli. |
|
| 58 | + $plugins_interessants = @unserialize($GLOBALS['meta']['plugins_interessants']); |
|
| 59 | + if (!is_array($plugins_interessants)) { |
|
| 60 | + $plugins_interessants = []; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - $plugins_interessants2 = []; |
|
| 63 | + $plugins_interessants2 = []; |
|
| 64 | 64 | |
| 65 | - foreach ($plugins_interessants as $plug => $score) { |
|
| 66 | - if ($score > 1) { |
|
| 67 | - $plugins_interessants2[$plug] = $score - 1; |
|
| 68 | - } |
|
| 69 | - } |
|
| 70 | - foreach ($plugin as $plug) { |
|
| 71 | - $plugins_interessants2[$plug] = 10; |
|
| 72 | - } // score initial |
|
| 73 | - ecrire_meta('plugins_interessants', serialize($plugins_interessants2)); |
|
| 65 | + foreach ($plugins_interessants as $plug => $score) { |
|
| 66 | + if ($score > 1) { |
|
| 67 | + $plugins_interessants2[$plug] = $score - 1; |
|
| 68 | + } |
|
| 69 | + } |
|
| 70 | + foreach ($plugin as $plug) { |
|
| 71 | + $plugins_interessants2[$plug] = 10; |
|
| 72 | + } // score initial |
|
| 73 | + ecrire_meta('plugins_interessants', serialize($plugins_interessants2)); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -82,13 +82,13 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function action_activer_plugins_dist() { |
| 84 | 84 | |
| 85 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 86 | - $securiser_action(); |
|
| 85 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 86 | + $securiser_action(); |
|
| 87 | 87 | |
| 88 | - if (!autoriser('configurer', '_plugins')) { |
|
| 89 | - die('erreur'); |
|
| 90 | - } |
|
| 91 | - // forcer la maj des meta pour les cas de modif de numero de version base via phpmyadmin |
|
| 92 | - lire_metas(); |
|
| 93 | - enregistre_modif_plugin(); |
|
| 88 | + if (!autoriser('configurer', '_plugins')) { |
|
| 89 | + die('erreur'); |
|
| 90 | + } |
|
| 91 | + // forcer la maj des meta pour les cas de modif de numero de version base via phpmyadmin |
|
| 92 | + lire_metas(); |
|
| 93 | + enregistre_modif_plugin(); |
|
| 94 | 94 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Cache |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
@@ -31,41 +31,41 @@ discard block |
||
| 31 | 31 | * de l'action sécurisée. |
| 32 | 32 | */ |
| 33 | 33 | function action_calculer_taille_cache_dist($arg = null) { |
| 34 | - if (is_null($arg)) { |
|
| 35 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 36 | - $arg = $securiser_action(); |
|
| 37 | - } |
|
| 38 | - include_spip('inc/filtres'); |
|
| 34 | + if (is_null($arg)) { |
|
| 35 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 36 | + $arg = $securiser_action(); |
|
| 37 | + } |
|
| 38 | + include_spip('inc/filtres'); |
|
| 39 | 39 | |
| 40 | - if ($arg == 'images') { |
|
| 41 | - $taille = calculer_taille_dossier(_DIR_VAR); |
|
| 42 | - $res = _T( |
|
| 43 | - 'ecrire:taille_cache_image', |
|
| 44 | - [ |
|
| 45 | - 'dir' => joli_repertoire(_DIR_VAR), |
|
| 46 | - 'taille' => '<b>' . (taille_en_octets($taille) > 0 ? taille_en_octets($taille) : '0 octet') . '</b>' |
|
| 47 | - ] |
|
| 48 | - ); |
|
| 49 | - } else { |
|
| 50 | - include_spip('inc/invalideur'); |
|
| 51 | - $taille = |
|
| 52 | - calculer_taille_dossier(_DIR_CACHE_XML) |
|
| 53 | - + calculer_taille_dossier(_DIR_CACHE . 'skel/') |
|
| 54 | - + calculer_taille_dossier(_DIR_CACHE . 'wheels/') |
|
| 55 | - + calculer_taille_dossier(_DIR_CACHE . 'contextes/'); |
|
| 56 | - $taille += intval(taille_du_cache()); |
|
| 57 | - if ($taille <= 150000) { |
|
| 58 | - $res = _T('taille_cache_vide'); |
|
| 59 | - } elseif ($taille <= 1024 * 1024) { |
|
| 60 | - $res = _T('taille_cache_moins_de', ['octets' => taille_en_octets(1024 * 1024)]); |
|
| 61 | - } else { |
|
| 62 | - $res = _T('taille_cache_octets', ['octets' => taille_en_octets($taille)]); |
|
| 63 | - } |
|
| 64 | - $res = "<b>$res</b>"; |
|
| 65 | - } |
|
| 40 | + if ($arg == 'images') { |
|
| 41 | + $taille = calculer_taille_dossier(_DIR_VAR); |
|
| 42 | + $res = _T( |
|
| 43 | + 'ecrire:taille_cache_image', |
|
| 44 | + [ |
|
| 45 | + 'dir' => joli_repertoire(_DIR_VAR), |
|
| 46 | + 'taille' => '<b>' . (taille_en_octets($taille) > 0 ? taille_en_octets($taille) : '0 octet') . '</b>' |
|
| 47 | + ] |
|
| 48 | + ); |
|
| 49 | + } else { |
|
| 50 | + include_spip('inc/invalideur'); |
|
| 51 | + $taille = |
|
| 52 | + calculer_taille_dossier(_DIR_CACHE_XML) |
|
| 53 | + + calculer_taille_dossier(_DIR_CACHE . 'skel/') |
|
| 54 | + + calculer_taille_dossier(_DIR_CACHE . 'wheels/') |
|
| 55 | + + calculer_taille_dossier(_DIR_CACHE . 'contextes/'); |
|
| 56 | + $taille += intval(taille_du_cache()); |
|
| 57 | + if ($taille <= 150000) { |
|
| 58 | + $res = _T('taille_cache_vide'); |
|
| 59 | + } elseif ($taille <= 1024 * 1024) { |
|
| 60 | + $res = _T('taille_cache_moins_de', ['octets' => taille_en_octets(1024 * 1024)]); |
|
| 61 | + } else { |
|
| 62 | + $res = _T('taille_cache_octets', ['octets' => taille_en_octets($taille)]); |
|
| 63 | + } |
|
| 64 | + $res = "<b>$res</b>"; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - $res = "<p>$res</p>"; |
|
| 68 | - ajax_retour($res); |
|
| 67 | + $res = "<p>$res</p>"; |
|
| 68 | + ajax_retour($res); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -76,28 +76,28 @@ discard block |
||
| 76 | 76 | * @return int Taille en octets |
| 77 | 77 | */ |
| 78 | 78 | function calculer_taille_dossier($dir) { |
| 79 | - if (!is_dir($dir) or !is_readable($dir)) { |
|
| 80 | - return 0; |
|
| 81 | - } |
|
| 82 | - $handle = opendir($dir); |
|
| 83 | - if (!$handle) { |
|
| 84 | - return 0; |
|
| 85 | - } |
|
| 86 | - $taille = 0; |
|
| 87 | - while (($fichier = @readdir($handle)) !== false) { |
|
| 88 | - // Eviter ".", "..", ".htaccess", etc. |
|
| 89 | - if ($fichier[0] == '.') { |
|
| 90 | - continue; |
|
| 91 | - } |
|
| 92 | - if (is_file($d = "$dir/$fichier")) { |
|
| 93 | - $taille += filesize($d); |
|
| 94 | - } else { |
|
| 95 | - if (is_dir($d)) { |
|
| 96 | - $taille += calculer_taille_dossier($d); |
|
| 97 | - } |
|
| 98 | - } |
|
| 99 | - } |
|
| 100 | - closedir($handle); |
|
| 79 | + if (!is_dir($dir) or !is_readable($dir)) { |
|
| 80 | + return 0; |
|
| 81 | + } |
|
| 82 | + $handle = opendir($dir); |
|
| 83 | + if (!$handle) { |
|
| 84 | + return 0; |
|
| 85 | + } |
|
| 86 | + $taille = 0; |
|
| 87 | + while (($fichier = @readdir($handle)) !== false) { |
|
| 88 | + // Eviter ".", "..", ".htaccess", etc. |
|
| 89 | + if ($fichier[0] == '.') { |
|
| 90 | + continue; |
|
| 91 | + } |
|
| 92 | + if (is_file($d = "$dir/$fichier")) { |
|
| 93 | + $taille += filesize($d); |
|
| 94 | + } else { |
|
| 95 | + if (is_dir($d)) { |
|
| 96 | + $taille += calculer_taille_dossier($d); |
|
| 97 | + } |
|
| 98 | + } |
|
| 99 | + } |
|
| 100 | + closedir($handle); |
|
| 101 | 101 | |
| 102 | - return $taille; |
|
| 102 | + return $taille; |
|
| 103 | 103 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | 28 | function action_annuler_job_dist() { |
| 29 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 30 | - $id_job = $securiser_action(); |
|
| 29 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 30 | + $id_job = $securiser_action(); |
|
| 31 | 31 | |
| 32 | - if ( |
|
| 33 | - $id_job = intval($id_job) |
|
| 34 | - and autoriser('annuler', 'job', $id_job) |
|
| 35 | - ) { |
|
| 36 | - job_queue_remove($id_job); |
|
| 37 | - } |
|
| 32 | + if ( |
|
| 33 | + $id_job = intval($id_job) |
|
| 34 | + and autoriser('annuler', 'job', $id_job) |
|
| 35 | + ) { |
|
| 36 | + job_queue_remove($id_job); |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | 28 | function action_forcer_job_dist() { |
| 29 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 30 | - $id_job = $securiser_action(); |
|
| 29 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 30 | + $id_job = $securiser_action(); |
|
| 31 | 31 | |
| 32 | - if ( |
|
| 33 | - $id_job = intval($id_job) |
|
| 34 | - and autoriser('forcer', 'job', $id_job) |
|
| 35 | - ) { |
|
| 36 | - include_spip('inc/queue'); |
|
| 37 | - include_spip('inc/genie'); |
|
| 38 | - queue_schedule([$id_job]); |
|
| 39 | - } |
|
| 32 | + if ( |
|
| 33 | + $id_job = intval($id_job) |
|
| 34 | + and autoriser('forcer', 'job', $id_job) |
|
| 35 | + ) { |
|
| 36 | + include_spip('inc/queue'); |
|
| 37 | + include_spip('inc/genie'); |
|
| 38 | + queue_schedule([$id_job]); |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Cache |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -39,57 +39,57 @@ discard block |
||
| 39 | 39 | * de l'action sécurisée. |
| 40 | 40 | */ |
| 41 | 41 | function action_purger_dist($arg = null) { |
| 42 | - if (is_null($arg)) { |
|
| 43 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 44 | - $arg = $securiser_action(); |
|
| 45 | - } |
|
| 42 | + if (is_null($arg)) { |
|
| 43 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 44 | + $arg = $securiser_action(); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - include_spip('inc/invalideur'); |
|
| 47 | + include_spip('inc/invalideur'); |
|
| 48 | 48 | |
| 49 | - spip_log("purger $arg"); |
|
| 49 | + spip_log("purger $arg"); |
|
| 50 | 50 | |
| 51 | - switch ($arg) { |
|
| 52 | - case 'inhibe_cache': |
|
| 53 | - // inhiber le cache pendant 24h |
|
| 54 | - ecrire_meta('cache_inhib', $_SERVER['REQUEST_TIME'] + 24 * 3600); |
|
| 55 | - break; |
|
| 56 | - case 'reactive_cache': |
|
| 57 | - effacer_meta('cache_inhib'); |
|
| 58 | - break; |
|
| 51 | + switch ($arg) { |
|
| 52 | + case 'inhibe_cache': |
|
| 53 | + // inhiber le cache pendant 24h |
|
| 54 | + ecrire_meta('cache_inhib', $_SERVER['REQUEST_TIME'] + 24 * 3600); |
|
| 55 | + break; |
|
| 56 | + case 'reactive_cache': |
|
| 57 | + effacer_meta('cache_inhib'); |
|
| 58 | + break; |
|
| 59 | 59 | |
| 60 | - case 'cache': |
|
| 61 | - supprime_invalideurs(); |
|
| 62 | - @spip_unlink(_CACHE_RUBRIQUES); |
|
| 63 | - @spip_unlink(_CACHE_CHEMIN); |
|
| 64 | - @spip_unlink(_DIR_TMP . 'plugin_xml_cache.gz'); |
|
| 65 | - // on ne supprime que _CACHE_PLUGINS_OPT qui declenche la reconstruction des 3 |
|
| 66 | - // _CACHE_PIPELINES _CACHE_PLUGINS_PATH et _CACHE_PLUGINS_FCT |
|
| 67 | - // pour eviter des problemes de concurence |
|
| 68 | - // cf https://core.spip.net/issues/2989 |
|
| 69 | - //@spip_unlink(_CACHE_PIPELINES); |
|
| 70 | - //@spip_unlink(_CACHE_PLUGINS_PATH); |
|
| 71 | - //@spip_unlink(_CACHE_PLUGINS_FCT); |
|
| 72 | - @spip_unlink(_CACHE_PLUGINS_OPT); |
|
| 73 | - purger_repertoire(_DIR_CACHE, ['subdir' => true]); |
|
| 74 | - purger_repertoire(_DIR_AIDE); |
|
| 75 | - purger_repertoire(_DIR_VAR . 'cache-css'); |
|
| 76 | - purger_repertoire(_DIR_VAR . 'cache-js'); |
|
| 77 | - break; |
|
| 60 | + case 'cache': |
|
| 61 | + supprime_invalideurs(); |
|
| 62 | + @spip_unlink(_CACHE_RUBRIQUES); |
|
| 63 | + @spip_unlink(_CACHE_CHEMIN); |
|
| 64 | + @spip_unlink(_DIR_TMP . 'plugin_xml_cache.gz'); |
|
| 65 | + // on ne supprime que _CACHE_PLUGINS_OPT qui declenche la reconstruction des 3 |
|
| 66 | + // _CACHE_PIPELINES _CACHE_PLUGINS_PATH et _CACHE_PLUGINS_FCT |
|
| 67 | + // pour eviter des problemes de concurence |
|
| 68 | + // cf https://core.spip.net/issues/2989 |
|
| 69 | + //@spip_unlink(_CACHE_PIPELINES); |
|
| 70 | + //@spip_unlink(_CACHE_PLUGINS_PATH); |
|
| 71 | + //@spip_unlink(_CACHE_PLUGINS_FCT); |
|
| 72 | + @spip_unlink(_CACHE_PLUGINS_OPT); |
|
| 73 | + purger_repertoire(_DIR_CACHE, ['subdir' => true]); |
|
| 74 | + purger_repertoire(_DIR_AIDE); |
|
| 75 | + purger_repertoire(_DIR_VAR . 'cache-css'); |
|
| 76 | + purger_repertoire(_DIR_VAR . 'cache-js'); |
|
| 77 | + break; |
|
| 78 | 78 | |
| 79 | - case 'squelettes': |
|
| 80 | - purger_repertoire(_DIR_SKELS); |
|
| 81 | - break; |
|
| 79 | + case 'squelettes': |
|
| 80 | + purger_repertoire(_DIR_SKELS); |
|
| 81 | + break; |
|
| 82 | 82 | |
| 83 | - case 'vignettes': |
|
| 84 | - purger_repertoire(_DIR_VAR . 'cache-gd2', ['subdir' => true]); |
|
| 85 | - purger_repertoire(_DIR_VAR . 'cache-texte', ['subdir' => true]); |
|
| 86 | - purger_repertoire(_DIR_VAR . 'cache-vignettes', ['subdir' => true]); |
|
| 87 | - purger_repertoire(_DIR_VAR . 'cache-TeX', ['subdir' => true]); |
|
| 88 | - supprime_invalideurs(); |
|
| 89 | - purger_repertoire(_DIR_CACHE, ['subdir' => true]); |
|
| 90 | - break; |
|
| 91 | - } |
|
| 83 | + case 'vignettes': |
|
| 84 | + purger_repertoire(_DIR_VAR . 'cache-gd2', ['subdir' => true]); |
|
| 85 | + purger_repertoire(_DIR_VAR . 'cache-texte', ['subdir' => true]); |
|
| 86 | + purger_repertoire(_DIR_VAR . 'cache-vignettes', ['subdir' => true]); |
|
| 87 | + purger_repertoire(_DIR_VAR . 'cache-TeX', ['subdir' => true]); |
|
| 88 | + supprime_invalideurs(); |
|
| 89 | + purger_repertoire(_DIR_CACHE, ['subdir' => true]); |
|
| 90 | + break; |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - // le faire savoir aux plugins |
|
| 94 | - pipeline('trig_purger', $arg); |
|
| 93 | + // le faire savoir aux plugins |
|
| 94 | + pipeline('trig_purger', $arg); |
|
| 95 | 95 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('inc/actions'); |
@@ -29,23 +29,23 @@ discard block |
||
| 29 | 29 | * @return void |
| 30 | 30 | */ |
| 31 | 31 | function action_etre_webmestre_dist() { |
| 32 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 33 | - $time = $securiser_action(); |
|
| 32 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 33 | + $time = $securiser_action(); |
|
| 34 | 34 | |
| 35 | - if ( |
|
| 36 | - time() - $time < 15 * 60 |
|
| 37 | - and $GLOBALS['visiteur_session']['statut'] == '0minirezo' |
|
| 38 | - and $GLOBALS['visiteur_session']['webmestre'] !== 'oui' |
|
| 39 | - ) { |
|
| 40 | - $action = _T('info_admin_etre_webmestre'); |
|
| 41 | - $admin = charger_fonction('admin', 'inc'); |
|
| 42 | - // lance la verif par ftp et l'appel |
|
| 43 | - // a base_etre_webmestre_dist quand c'est OK |
|
| 44 | - if ($r = $admin('etre_webmestre', $action)) { |
|
| 45 | - echo $r; |
|
| 46 | - exit; |
|
| 47 | - } |
|
| 48 | - } |
|
| 35 | + if ( |
|
| 36 | + time() - $time < 15 * 60 |
|
| 37 | + and $GLOBALS['visiteur_session']['statut'] == '0minirezo' |
|
| 38 | + and $GLOBALS['visiteur_session']['webmestre'] !== 'oui' |
|
| 39 | + ) { |
|
| 40 | + $action = _T('info_admin_etre_webmestre'); |
|
| 41 | + $admin = charger_fonction('admin', 'inc'); |
|
| 42 | + // lance la verif par ftp et l'appel |
|
| 43 | + // a base_etre_webmestre_dist quand c'est OK |
|
| 44 | + if ($r = $admin('etre_webmestre', $action)) { |
|
| 45 | + echo $r; |
|
| 46 | + exit; |
|
| 47 | + } |
|
| 48 | + } |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | * @return void |
| 55 | 55 | */ |
| 56 | 56 | function base_etre_webmestre_dist() { |
| 57 | - if ($GLOBALS['visiteur_session']['statut'] == '0minirezo' and $GLOBALS['visiteur_session']['webmestre'] !== 'oui') { |
|
| 58 | - include_spip('action/editer_auteur'); |
|
| 59 | - auteur_instituer($GLOBALS['visiteur_session']['id_auteur'], ['webmestre' => 'oui'], true); |
|
| 60 | - } |
|
| 57 | + if ($GLOBALS['visiteur_session']['statut'] == '0minirezo' and $GLOBALS['visiteur_session']['webmestre'] !== 'oui') { |
|
| 58 | + include_spip('action/editer_auteur'); |
|
| 59 | + auteur_instituer($GLOBALS['visiteur_session']['id_auteur'], ['webmestre' => 'oui'], true); |
|
| 60 | + } |
|
| 61 | 61 | } |