@@ -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 | /** |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | * @return array Environnement du formulaire |
| 34 | 34 | **/ |
| 35 | 35 | function formulaires_recherche_ecrire_charger_dist($action = '', $class = '') { |
| 36 | - if ($GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) { |
|
| 37 | - $lang = $GLOBALS['spip_lang']; |
|
| 38 | - } else { |
|
| 39 | - $lang = ''; |
|
| 40 | - } |
|
| 36 | + if ($GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) { |
|
| 37 | + $lang = $GLOBALS['spip_lang']; |
|
| 38 | + } else { |
|
| 39 | + $lang = ''; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - return |
|
| 43 | - array( |
|
| 44 | - 'action' => ($action ? $action : generer_url_ecrire('recherche')), |
|
| 45 | - # action specifique, ne passe pas par Verifier, ni Traiter |
|
| 46 | - 'recherche' => _request('recherche'), |
|
| 47 | - 'lang' => $lang, |
|
| 48 | - 'class' => $class, |
|
| 49 | - '_id_champ' => 'rechercher_' . substr(md5($action . $class), 0, 4), |
|
| 50 | - ); |
|
| 42 | + return |
|
| 43 | + array( |
|
| 44 | + 'action' => ($action ? $action : generer_url_ecrire('recherche')), |
|
| 45 | + # action specifique, ne passe pas par Verifier, ni Traiter |
|
| 46 | + 'recherche' => _request('recherche'), |
|
| 47 | + 'lang' => $lang, |
|
| 48 | + 'class' => $class, |
|
| 49 | + '_id_champ' => 'rechercher_' . substr(md5($action . $class), 0, 4), |
|
| 50 | + ); |
|
| 51 | 51 | } |
@@ -11,46 +11,46 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | include_spip('inc/presentation'); |
| 17 | 17 | |
| 18 | 18 | function formulaires_configurer_visiteurs_charger_dist() { |
| 19 | - $valeurs = array(); |
|
| 20 | - if (avoir_visiteurs(false, false)) { |
|
| 21 | - $valeurs['editable'] = false; |
|
| 22 | - } |
|
| 23 | - |
|
| 24 | - foreach (array( |
|
| 25 | - 'accepter_visiteurs' |
|
| 26 | - ) as $m) { |
|
| 27 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - return $valeurs; |
|
| 19 | + $valeurs = array(); |
|
| 20 | + if (avoir_visiteurs(false, false)) { |
|
| 21 | + $valeurs['editable'] = false; |
|
| 22 | + } |
|
| 23 | + |
|
| 24 | + foreach (array( |
|
| 25 | + 'accepter_visiteurs' |
|
| 26 | + ) as $m) { |
|
| 27 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + return $valeurs; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | function formulaires_configurer_visiteurs_traiter_dist() { |
| 35 | - $res = array('editable' => true); |
|
| 36 | - // Modification du reglage accepter_inscriptions => vider le cache |
|
| 37 | - // (pour repercuter la modif sur le panneau de login) |
|
| 38 | - if (($i = _request('accepter_visiteurs') |
|
| 39 | - and $i != $GLOBALS['meta']['accepter_visiteurs']) |
|
| 40 | - ) { |
|
| 41 | - include_spip('inc/invalideur'); |
|
| 42 | - suivre_invalideur('1'); # tout effacer |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - foreach (array( |
|
| 46 | - 'accepter_visiteurs', |
|
| 47 | - ) as $m) { |
|
| 48 | - if (!is_null($v = _request($m))) { |
|
| 49 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 54 | - |
|
| 55 | - return $res; |
|
| 35 | + $res = array('editable' => true); |
|
| 36 | + // Modification du reglage accepter_inscriptions => vider le cache |
|
| 37 | + // (pour repercuter la modif sur le panneau de login) |
|
| 38 | + if (($i = _request('accepter_visiteurs') |
|
| 39 | + and $i != $GLOBALS['meta']['accepter_visiteurs']) |
|
| 40 | + ) { |
|
| 41 | + include_spip('inc/invalideur'); |
|
| 42 | + suivre_invalideur('1'); # tout effacer |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + foreach (array( |
|
| 46 | + 'accepter_visiteurs', |
|
| 47 | + ) as $m) { |
|
| 48 | + if (!is_null($v = _request($m))) { |
|
| 49 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 54 | + |
|
| 55 | + return $res; |
|
| 56 | 56 | } |
@@ -11,34 +11,34 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_logos_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'activer_logos', |
|
| 21 | - 'activer_logos_survol' |
|
| 22 | - ) as $m) { |
|
| 23 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - return $valeurs; |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'activer_logos', |
|
| 21 | + 'activer_logos_survol' |
|
| 22 | + ) as $m) { |
|
| 23 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + return $valeurs; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | function formulaires_configurer_logos_traiter_dist() { |
| 31 | - $res = array('editable' => true); |
|
| 32 | - foreach (array( |
|
| 33 | - 'activer_logos', |
|
| 34 | - 'activer_logos_survol', |
|
| 35 | - ) as $m) { |
|
| 36 | - if (!is_null($v = _request($m))) { |
|
| 37 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | - } |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | - |
|
| 43 | - return $res; |
|
| 31 | + $res = array('editable' => true); |
|
| 32 | + foreach (array( |
|
| 33 | + 'activer_logos', |
|
| 34 | + 'activer_logos_survol', |
|
| 35 | + ) as $m) { |
|
| 36 | + if (!is_null($v = _request($m))) { |
|
| 37 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | + } |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | + |
|
| 43 | + return $res; |
|
| 44 | 44 | } |
@@ -11,34 +11,34 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_rubriques_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'rubriques_descriptif', |
|
| 21 | - 'rubriques_texte' |
|
| 22 | - ) as $m) { |
|
| 23 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - return $valeurs; |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'rubriques_descriptif', |
|
| 21 | + 'rubriques_texte' |
|
| 22 | + ) as $m) { |
|
| 23 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + return $valeurs; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | function formulaires_configurer_rubriques_traiter_dist() { |
| 31 | - $res = array('editable' => true); |
|
| 32 | - foreach (array( |
|
| 33 | - 'rubriques_descriptif', |
|
| 34 | - 'rubriques_texte' |
|
| 35 | - ) as $m) { |
|
| 36 | - if (!is_null($v = _request($m))) { |
|
| 37 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | - } |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | - |
|
| 43 | - return $res; |
|
| 31 | + $res = array('editable' => true); |
|
| 32 | + foreach (array( |
|
| 33 | + 'rubriques_descriptif', |
|
| 34 | + 'rubriques_texte' |
|
| 35 | + ) as $m) { |
|
| 36 | + if (!is_null($v = _request($m))) { |
|
| 37 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | + } |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | + |
|
| 43 | + return $res; |
|
| 44 | 44 | } |
@@ -11,61 +11,61 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_articles_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'articles_surtitre', |
|
| 21 | - 'articles_soustitre', |
|
| 22 | - 'articles_descriptif', |
|
| 23 | - 'articles_chapeau', |
|
| 24 | - 'articles_texte', |
|
| 25 | - 'articles_ps', |
|
| 26 | - 'articles_redac', |
|
| 27 | - 'articles_urlref', |
|
| 28 | - 'post_dates', |
|
| 29 | - 'articles_redirection', |
|
| 30 | - ) as $m) { |
|
| 31 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 32 | - } |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'articles_surtitre', |
|
| 21 | + 'articles_soustitre', |
|
| 22 | + 'articles_descriptif', |
|
| 23 | + 'articles_chapeau', |
|
| 24 | + 'articles_texte', |
|
| 25 | + 'articles_ps', |
|
| 26 | + 'articles_redac', |
|
| 27 | + 'articles_urlref', |
|
| 28 | + 'post_dates', |
|
| 29 | + 'articles_redirection', |
|
| 30 | + ) as $m) { |
|
| 31 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - return $valeurs; |
|
| 34 | + return $valeurs; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | function formulaires_configurer_articles_traiter_dist() { |
| 39 | - $res = array('editable' => true); |
|
| 40 | - $purger_skel = false; |
|
| 41 | - // Purger les squelettes si un changement de meta les affecte |
|
| 42 | - if ($i = _request('post_dates') and ($i != $GLOBALS['meta']['post_dates'])) { |
|
| 43 | - $purger_skel = true; |
|
| 44 | - } |
|
| 39 | + $res = array('editable' => true); |
|
| 40 | + $purger_skel = false; |
|
| 41 | + // Purger les squelettes si un changement de meta les affecte |
|
| 42 | + if ($i = _request('post_dates') and ($i != $GLOBALS['meta']['post_dates'])) { |
|
| 43 | + $purger_skel = true; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - foreach (array( |
|
| 47 | - 'articles_surtitre', |
|
| 48 | - 'articles_soustitre', |
|
| 49 | - 'articles_descriptif', |
|
| 50 | - 'articles_chapeau', |
|
| 51 | - 'articles_texte', |
|
| 52 | - 'articles_ps', |
|
| 53 | - 'articles_redac', |
|
| 54 | - 'articles_urlref', |
|
| 55 | - 'post_dates', |
|
| 56 | - 'articles_redirection', |
|
| 57 | - ) as $m) { |
|
| 58 | - if (!is_null($v = _request($m))) { |
|
| 59 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 60 | - } |
|
| 61 | - } |
|
| 46 | + foreach (array( |
|
| 47 | + 'articles_surtitre', |
|
| 48 | + 'articles_soustitre', |
|
| 49 | + 'articles_descriptif', |
|
| 50 | + 'articles_chapeau', |
|
| 51 | + 'articles_texte', |
|
| 52 | + 'articles_ps', |
|
| 53 | + 'articles_redac', |
|
| 54 | + 'articles_urlref', |
|
| 55 | + 'post_dates', |
|
| 56 | + 'articles_redirection', |
|
| 57 | + ) as $m) { |
|
| 58 | + if (!is_null($v = _request($m))) { |
|
| 59 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - if ($purger_skel) { |
|
| 64 | - include_spip('inc/invalideur'); |
|
| 65 | - purger_repertoire(_DIR_SKELS); |
|
| 66 | - } |
|
| 63 | + if ($purger_skel) { |
|
| 64 | + include_spip('inc/invalideur'); |
|
| 65 | + purger_repertoire(_DIR_SKELS); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 68 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 69 | 69 | |
| 70 | - return $res; |
|
| 70 | + return $res; |
|
| 71 | 71 | } |
@@ -11,64 +11,64 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_rediriger_article_charger_dist($id_article, $retour = '') { |
| 18 | 18 | |
| 19 | - include_spip('inc/autoriser'); |
|
| 20 | - if (!autoriser('modifier', 'article', $id_article)) { |
|
| 21 | - return false; |
|
| 22 | - } |
|
| 23 | - |
|
| 24 | - $row = sql_fetsel('id_article,virtuel', 'spip_articles', 'id_article=' . intval($id_article)); |
|
| 25 | - if (!$row['id_article']) { |
|
| 26 | - return false; |
|
| 27 | - } |
|
| 28 | - include_spip('inc/lien'); |
|
| 29 | - $redirection = virtuel_redirige($row['virtuel']); |
|
| 30 | - |
|
| 31 | - if (!$redirection |
|
| 32 | - and $GLOBALS['meta']['articles_redirection'] != 'oui' |
|
| 33 | - ) { |
|
| 34 | - return false; |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - |
|
| 38 | - include_spip('inc/texte'); |
|
| 39 | - $valeurs = array( |
|
| 40 | - 'redirection' => $redirection, |
|
| 41 | - 'id' => $id_article, |
|
| 42 | - '_afficher_url' => ($redirection ? propre("[->$redirection]") : ''), |
|
| 43 | - ); |
|
| 44 | - |
|
| 45 | - return $valeurs; |
|
| 19 | + include_spip('inc/autoriser'); |
|
| 20 | + if (!autoriser('modifier', 'article', $id_article)) { |
|
| 21 | + return false; |
|
| 22 | + } |
|
| 23 | + |
|
| 24 | + $row = sql_fetsel('id_article,virtuel', 'spip_articles', 'id_article=' . intval($id_article)); |
|
| 25 | + if (!$row['id_article']) { |
|
| 26 | + return false; |
|
| 27 | + } |
|
| 28 | + include_spip('inc/lien'); |
|
| 29 | + $redirection = virtuel_redirige($row['virtuel']); |
|
| 30 | + |
|
| 31 | + if (!$redirection |
|
| 32 | + and $GLOBALS['meta']['articles_redirection'] != 'oui' |
|
| 33 | + ) { |
|
| 34 | + return false; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + |
|
| 38 | + include_spip('inc/texte'); |
|
| 39 | + $valeurs = array( |
|
| 40 | + 'redirection' => $redirection, |
|
| 41 | + 'id' => $id_article, |
|
| 42 | + '_afficher_url' => ($redirection ? propre("[->$redirection]") : ''), |
|
| 43 | + ); |
|
| 44 | + |
|
| 45 | + return $valeurs; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | function formulaires_rediriger_article_verifier_dist($id_article, $retour = '') { |
| 49 | - $erreurs = array(); |
|
| 49 | + $erreurs = array(); |
|
| 50 | 50 | |
| 51 | - if (($redirection = _request('redirection')) == $id_article || $redirection == 'art' . $id_article) { |
|
| 52 | - $erreurs['redirection'] = _T('info_redirection_boucle'); |
|
| 53 | - } |
|
| 51 | + if (($redirection = _request('redirection')) == $id_article || $redirection == 'art' . $id_article) { |
|
| 52 | + $erreurs['redirection'] = _T('info_redirection_boucle'); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - return $erreurs; |
|
| 55 | + return $erreurs; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | function formulaires_rediriger_article_traiter_dist($id_article, $retour = '') { |
| 59 | 59 | |
| 60 | - $url = preg_replace(',^\s*https?://$,i', '', rtrim(_request('redirection'))); |
|
| 61 | - if ($url) { |
|
| 62 | - $url = corriger_caracteres($url); |
|
| 63 | - } |
|
| 60 | + $url = preg_replace(',^\s*https?://$,i', '', rtrim(_request('redirection'))); |
|
| 61 | + if ($url) { |
|
| 62 | + $url = corriger_caracteres($url); |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - include_spip('action/editer_article'); |
|
| 66 | - articles_set($id_article, array('virtuel' => $url)); |
|
| 65 | + include_spip('action/editer_article'); |
|
| 66 | + articles_set($id_article, array('virtuel' => $url)); |
|
| 67 | 67 | |
| 68 | - $js = _AJAX ? '<script type="text/javascript">if (window.ajaxReload) ajaxReload("wysiwyg");</script>' : ''; |
|
| 68 | + $js = _AJAX ? '<script type="text/javascript">if (window.ajaxReload) ajaxReload("wysiwyg");</script>' : ''; |
|
| 69 | 69 | |
| 70 | - return array( |
|
| 71 | - 'message_ok' => ($url ? _T('info_redirection_activee') : _T('info_redirection_desactivee')) . $js, |
|
| 72 | - 'editable' => true |
|
| 73 | - ); |
|
| 70 | + return array( |
|
| 71 | + 'message_ok' => ($url ? _T('info_redirection_activee') : _T('info_redirection_desactivee')) . $js, |
|
| 72 | + 'editable' => true |
|
| 73 | + ); |
|
| 74 | 74 | } |
@@ -11,140 +11,140 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | include_spip('inc/presentation'); |
| 17 | 17 | include_spip('inc/config'); |
| 18 | 18 | |
| 19 | 19 | function formulaires_configurer_relayeur_charger_dist() { |
| 20 | - $valeurs = array( |
|
| 21 | - 'http_proxy' => no_password_proxy_url(lire_config('http_proxy', '')), |
|
| 22 | - 'http_noproxy' => lire_config('http_noproxy', ''), |
|
| 23 | - 'test_proxy' => 'http://www.spip.net/', |
|
| 24 | - ); |
|
| 20 | + $valeurs = array( |
|
| 21 | + 'http_proxy' => no_password_proxy_url(lire_config('http_proxy', '')), |
|
| 22 | + 'http_noproxy' => lire_config('http_noproxy', ''), |
|
| 23 | + 'test_proxy' => 'http://www.spip.net/', |
|
| 24 | + ); |
|
| 25 | 25 | |
| 26 | - return $valeurs; |
|
| 26 | + return $valeurs; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | function formulaires_configurer_relayeur_verifier_dist() { |
| 30 | - $erreurs = array(); |
|
| 31 | - $http_proxy = relayeur_saisie_ou_config(_request('http_proxy'), lire_config('http_proxy', '')); |
|
| 32 | - $http_noproxy = _request('http_noproxy'); |
|
| 33 | - |
|
| 34 | - if ($http_proxy and !tester_url_absolue($http_proxy)) { |
|
| 35 | - $erreurs['http_proxy'] = _T('info_url_proxy_pas_conforme'); |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - if (!isset($erreurs['http_proxy']) and _request('tester_proxy')) { |
|
| 39 | - if (!$http_proxy) { |
|
| 40 | - $erreurs['http_proxy'] = _T('info_obligatoire'); |
|
| 41 | - } else { |
|
| 42 | - include_spip('inc/distant'); |
|
| 43 | - $test_proxy = _request('test_proxy'); |
|
| 44 | - $t = parse_url($test_proxy); |
|
| 45 | - if (!@$t['host']) { |
|
| 46 | - $erreurs['test_proxy'] = _T('info_adresse_non_indiquee'); |
|
| 47 | - } else { |
|
| 48 | - include_spip('inc/texte'); // pour aide, couper, lang |
|
| 49 | - $info = ''; |
|
| 50 | - if (!need_proxy($t['host'], $http_proxy, $http_noproxy)) { |
|
| 51 | - $info = '<strong>' . _T('page_pas_proxy') . '</strong><br />'; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - // il faut fausser le proxy actuel pour faire le test ! |
|
| 55 | - $cur_http_proxy = $GLOBALS['meta']['http_proxy']; |
|
| 56 | - $cur_http_noproxy = $GLOBALS['meta']['http_noproxy']; |
|
| 57 | - $GLOBALS['meta']['http_proxy'] = $http_proxy; |
|
| 58 | - $GLOBALS['meta']['http_noproxy'] = $http_noproxy; |
|
| 59 | - $page = recuperer_page($test_proxy, true); |
|
| 60 | - $GLOBALS['meta']['http_proxy'] = $cur_http_proxy; |
|
| 61 | - $GLOBALS['meta']['http_noproxy'] = $cur_http_noproxy; |
|
| 62 | - if ($page) { |
|
| 63 | - $erreurs['message_ok'] = _T('info_proxy_ok') . "<br />$info\n<tt>" . couper(entites_html($page), 300) . '</tt>'; |
|
| 64 | - $erreurs['message_erreur'] = ''; |
|
| 65 | - } else { |
|
| 66 | - $erreurs['message_erreur'] = $info . _T( |
|
| 67 | - 'info_impossible_lire_page', |
|
| 68 | - array('test_proxy' => "<tt>$test_proxy</tt>") |
|
| 69 | - ) |
|
| 70 | - . ' <b><tt>' . no_password_proxy_url($http_proxy) . '</tt></b>.' |
|
| 71 | - . aider('confhttpproxy'); |
|
| 72 | - } |
|
| 73 | - } |
|
| 74 | - } |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - return $erreurs; |
|
| 30 | + $erreurs = array(); |
|
| 31 | + $http_proxy = relayeur_saisie_ou_config(_request('http_proxy'), lire_config('http_proxy', '')); |
|
| 32 | + $http_noproxy = _request('http_noproxy'); |
|
| 33 | + |
|
| 34 | + if ($http_proxy and !tester_url_absolue($http_proxy)) { |
|
| 35 | + $erreurs['http_proxy'] = _T('info_url_proxy_pas_conforme'); |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + if (!isset($erreurs['http_proxy']) and _request('tester_proxy')) { |
|
| 39 | + if (!$http_proxy) { |
|
| 40 | + $erreurs['http_proxy'] = _T('info_obligatoire'); |
|
| 41 | + } else { |
|
| 42 | + include_spip('inc/distant'); |
|
| 43 | + $test_proxy = _request('test_proxy'); |
|
| 44 | + $t = parse_url($test_proxy); |
|
| 45 | + if (!@$t['host']) { |
|
| 46 | + $erreurs['test_proxy'] = _T('info_adresse_non_indiquee'); |
|
| 47 | + } else { |
|
| 48 | + include_spip('inc/texte'); // pour aide, couper, lang |
|
| 49 | + $info = ''; |
|
| 50 | + if (!need_proxy($t['host'], $http_proxy, $http_noproxy)) { |
|
| 51 | + $info = '<strong>' . _T('page_pas_proxy') . '</strong><br />'; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + // il faut fausser le proxy actuel pour faire le test ! |
|
| 55 | + $cur_http_proxy = $GLOBALS['meta']['http_proxy']; |
|
| 56 | + $cur_http_noproxy = $GLOBALS['meta']['http_noproxy']; |
|
| 57 | + $GLOBALS['meta']['http_proxy'] = $http_proxy; |
|
| 58 | + $GLOBALS['meta']['http_noproxy'] = $http_noproxy; |
|
| 59 | + $page = recuperer_page($test_proxy, true); |
|
| 60 | + $GLOBALS['meta']['http_proxy'] = $cur_http_proxy; |
|
| 61 | + $GLOBALS['meta']['http_noproxy'] = $cur_http_noproxy; |
|
| 62 | + if ($page) { |
|
| 63 | + $erreurs['message_ok'] = _T('info_proxy_ok') . "<br />$info\n<tt>" . couper(entites_html($page), 300) . '</tt>'; |
|
| 64 | + $erreurs['message_erreur'] = ''; |
|
| 65 | + } else { |
|
| 66 | + $erreurs['message_erreur'] = $info . _T( |
|
| 67 | + 'info_impossible_lire_page', |
|
| 68 | + array('test_proxy' => "<tt>$test_proxy</tt>") |
|
| 69 | + ) |
|
| 70 | + . ' <b><tt>' . no_password_proxy_url($http_proxy) . '</tt></b>.' |
|
| 71 | + . aider('confhttpproxy'); |
|
| 72 | + } |
|
| 73 | + } |
|
| 74 | + } |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + return $erreurs; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | function formulaires_configurer_relayeur_traiter_dist() { |
| 81 | - $res = array('editable' => true); |
|
| 81 | + $res = array('editable' => true); |
|
| 82 | 82 | |
| 83 | - $http_proxy = relayeur_saisie_ou_config(_request('http_proxy'), lire_config('http_proxy', '')); |
|
| 84 | - $http_noproxy = _request('http_noproxy'); |
|
| 85 | - if ($http_proxy !== null) { |
|
| 86 | - ecrire_meta('http_proxy', $http_proxy); |
|
| 87 | - } |
|
| 83 | + $http_proxy = relayeur_saisie_ou_config(_request('http_proxy'), lire_config('http_proxy', '')); |
|
| 84 | + $http_noproxy = _request('http_noproxy'); |
|
| 85 | + if ($http_proxy !== null) { |
|
| 86 | + ecrire_meta('http_proxy', $http_proxy); |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - if ($http_noproxy !== null) { |
|
| 90 | - ecrire_meta('http_noproxy', $http_noproxy); |
|
| 91 | - } |
|
| 89 | + if ($http_noproxy !== null) { |
|
| 90 | + ecrire_meta('http_noproxy', $http_noproxy); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 93 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 94 | 94 | |
| 95 | - return $res; |
|
| 95 | + return $res; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | function relayeur_saisie_ou_config($http_proxy, $default) { |
| 99 | - // http_proxy : ne pas prendre en compte la modif si le password est '****' |
|
| 100 | - if (preg_match(',:\*\*\*\*@,', $http_proxy)) { |
|
| 101 | - $http_proxy = $default; |
|
| 102 | - } |
|
| 99 | + // http_proxy : ne pas prendre en compte la modif si le password est '****' |
|
| 100 | + if (preg_match(',:\*\*\*\*@,', $http_proxy)) { |
|
| 101 | + $http_proxy = $default; |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - return $http_proxy; |
|
| 104 | + return $http_proxy; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // Function glue_url : le pendant de parse_url |
| 108 | 108 | // http://code.spip.net/@glue_url |
| 109 | 109 | function glue_url($url) { |
| 110 | - if (!is_array($url)) { |
|
| 111 | - return false; |
|
| 112 | - } |
|
| 113 | - // scheme |
|
| 114 | - $uri = (!empty($url['scheme'])) ? $url['scheme'] . '://' : ''; |
|
| 115 | - // user & pass |
|
| 116 | - if (!empty($url['user'])) { |
|
| 117 | - $uri .= $url['user'] . ':' . $url['pass'] . '@'; |
|
| 118 | - } |
|
| 119 | - // host |
|
| 120 | - $uri .= $url['host']; |
|
| 121 | - // port |
|
| 122 | - $port = (!empty($url['port'])) ? ':' . $url['port'] : ''; |
|
| 123 | - $uri .= $port; |
|
| 124 | - // path |
|
| 125 | - $uri .= $url['path']; |
|
| 110 | + if (!is_array($url)) { |
|
| 111 | + return false; |
|
| 112 | + } |
|
| 113 | + // scheme |
|
| 114 | + $uri = (!empty($url['scheme'])) ? $url['scheme'] . '://' : ''; |
|
| 115 | + // user & pass |
|
| 116 | + if (!empty($url['user'])) { |
|
| 117 | + $uri .= $url['user'] . ':' . $url['pass'] . '@'; |
|
| 118 | + } |
|
| 119 | + // host |
|
| 120 | + $uri .= $url['host']; |
|
| 121 | + // port |
|
| 122 | + $port = (!empty($url['port'])) ? ':' . $url['port'] : ''; |
|
| 123 | + $uri .= $port; |
|
| 124 | + // path |
|
| 125 | + $uri .= $url['path']; |
|
| 126 | 126 | // fragment or query |
| 127 | - if (isset($url['fragment'])) { |
|
| 128 | - $uri .= '#' . $url['fragment']; |
|
| 129 | - } elseif (isset($url['query'])) { |
|
| 130 | - $uri .= '?' . $url['query']; |
|
| 131 | - } |
|
| 127 | + if (isset($url['fragment'])) { |
|
| 128 | + $uri .= '#' . $url['fragment']; |
|
| 129 | + } elseif (isset($url['query'])) { |
|
| 130 | + $uri .= '?' . $url['query']; |
|
| 131 | + } |
|
| 132 | 132 | |
| 133 | - return $uri; |
|
| 133 | + return $uri; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| 137 | 137 | // Ne pas afficher la partie 'password' du proxy |
| 138 | 138 | // http://code.spip.net/@no_password_proxy_url |
| 139 | 139 | function no_password_proxy_url($http_proxy) { |
| 140 | - if ($http_proxy |
|
| 141 | - and $p = @parse_url($http_proxy) |
|
| 142 | - and isset($p['pass']) |
|
| 143 | - and $p['pass'] |
|
| 144 | - ) { |
|
| 145 | - $p['pass'] = '****'; |
|
| 146 | - $http_proxy = glue_url($p); |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - return $http_proxy; |
|
| 140 | + if ($http_proxy |
|
| 141 | + and $p = @parse_url($http_proxy) |
|
| 142 | + and isset($p['pass']) |
|
| 143 | + and $p['pass'] |
|
| 144 | + ) { |
|
| 145 | + $p['pass'] = '****'; |
|
| 146 | + $http_proxy = glue_url($p); |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + return $http_proxy; |
|
| 150 | 150 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | **/ |
| 19 | 19 | |
| 20 | 20 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 21 | - return; |
|
| 21 | + return; |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -28,22 +28,22 @@ discard block |
||
| 28 | 28 | * Environnement du formulaire |
| 29 | 29 | **/ |
| 30 | 30 | function formulaires_configurer_reducteur_charger_dist() { |
| 31 | - $valeurs = array(); |
|
| 32 | - foreach (array( |
|
| 33 | - 'image_process', |
|
| 34 | - 'formats_graphiques', |
|
| 35 | - 'creer_preview', |
|
| 36 | - 'taille_preview', |
|
| 37 | - ) as $m) { |
|
| 38 | - $valeurs[$m] = isset($GLOBALS['meta'][$m]) ? $GLOBALS['meta'][$m] : null; |
|
| 39 | - } |
|
| 31 | + $valeurs = array(); |
|
| 32 | + foreach (array( |
|
| 33 | + 'image_process', |
|
| 34 | + 'formats_graphiques', |
|
| 35 | + 'creer_preview', |
|
| 36 | + 'taille_preview', |
|
| 37 | + ) as $m) { |
|
| 38 | + $valeurs[$m] = isset($GLOBALS['meta'][$m]) ? $GLOBALS['meta'][$m] : null; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - $valeurs['taille_preview'] = intval($valeurs['taille_preview']); |
|
| 42 | - if ($valeurs['taille_preview'] < 10) { |
|
| 43 | - $valeurs['taille_preview'] = 120; |
|
| 44 | - } |
|
| 41 | + $valeurs['taille_preview'] = intval($valeurs['taille_preview']); |
|
| 42 | + if ($valeurs['taille_preview'] < 10) { |
|
| 43 | + $valeurs['taille_preview'] = 120; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - return $valeurs; |
|
| 46 | + return $valeurs; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
@@ -54,51 +54,51 @@ discard block |
||
| 54 | 54 | * Retours des traitements |
| 55 | 55 | **/ |
| 56 | 56 | function formulaires_configurer_reducteur_traiter_dist() { |
| 57 | - $res = array('editable' => true); |
|
| 57 | + $res = array('editable' => true); |
|
| 58 | 58 | |
| 59 | - if (is_array($image_process = _request('image_process_'))) { |
|
| 60 | - $image_process = array_keys($image_process); |
|
| 61 | - $image_process = reset($image_process); |
|
| 59 | + if (is_array($image_process = _request('image_process_'))) { |
|
| 60 | + $image_process = array_keys($image_process); |
|
| 61 | + $image_process = reset($image_process); |
|
| 62 | 62 | |
| 63 | - // application du choix de vignette |
|
| 64 | - if ($image_process) { |
|
| 65 | - // mettre a jour les formats graphiques lisibles |
|
| 66 | - switch ($image_process) { |
|
| 67 | - case 'gd1': |
|
| 68 | - case 'gd2': |
|
| 69 | - $formats_graphiques = $GLOBALS['meta']['gd_formats_read']; |
|
| 70 | - break; |
|
| 71 | - case 'netpbm': |
|
| 72 | - $formats_graphiques = $GLOBALS['meta']['netpbm_formats']; |
|
| 73 | - break; |
|
| 74 | - case 'convert': |
|
| 75 | - case 'imagick': |
|
| 76 | - $formats_graphiques = 'gif,jpg,png'; |
|
| 77 | - break; |
|
| 78 | - default: #debug |
|
| 79 | - $formats_graphiques = ''; |
|
| 80 | - $image_process = 'non'; |
|
| 81 | - break; |
|
| 82 | - } |
|
| 83 | - ecrire_meta('formats_graphiques', $formats_graphiques, 'non'); |
|
| 84 | - ecrire_meta('image_process', $image_process, 'non'); |
|
| 85 | - } |
|
| 86 | - } |
|
| 63 | + // application du choix de vignette |
|
| 64 | + if ($image_process) { |
|
| 65 | + // mettre a jour les formats graphiques lisibles |
|
| 66 | + switch ($image_process) { |
|
| 67 | + case 'gd1': |
|
| 68 | + case 'gd2': |
|
| 69 | + $formats_graphiques = $GLOBALS['meta']['gd_formats_read']; |
|
| 70 | + break; |
|
| 71 | + case 'netpbm': |
|
| 72 | + $formats_graphiques = $GLOBALS['meta']['netpbm_formats']; |
|
| 73 | + break; |
|
| 74 | + case 'convert': |
|
| 75 | + case 'imagick': |
|
| 76 | + $formats_graphiques = 'gif,jpg,png'; |
|
| 77 | + break; |
|
| 78 | + default: #debug |
|
| 79 | + $formats_graphiques = ''; |
|
| 80 | + $image_process = 'non'; |
|
| 81 | + break; |
|
| 82 | + } |
|
| 83 | + ecrire_meta('formats_graphiques', $formats_graphiques, 'non'); |
|
| 84 | + ecrire_meta('image_process', $image_process, 'non'); |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - foreach (array( |
|
| 89 | - 'creer_preview' |
|
| 90 | - ) as $m) { |
|
| 91 | - if (!is_null($v = _request($m))) { |
|
| 92 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 93 | - } |
|
| 94 | - } |
|
| 95 | - if (!is_null($v = _request('taille_preview'))) { |
|
| 96 | - ecrire_meta('taille_preview', intval($v)); |
|
| 97 | - } |
|
| 88 | + foreach (array( |
|
| 89 | + 'creer_preview' |
|
| 90 | + ) as $m) { |
|
| 91 | + if (!is_null($v = _request($m))) { |
|
| 92 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 93 | + } |
|
| 94 | + } |
|
| 95 | + if (!is_null($v = _request('taille_preview'))) { |
|
| 96 | + ecrire_meta('taille_preview', intval($v)); |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 99 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 100 | 100 | |
| 101 | - return $res; |
|
| 101 | + return $res; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -111,36 +111,36 @@ discard block |
||
| 111 | 111 | * URL d'action pour tester la librairie graphique en créant une vignette |
| 112 | 112 | **/ |
| 113 | 113 | function url_vignette_choix($process) { |
| 114 | - switch ($process) { |
|
| 115 | - case 'gd2': |
|
| 116 | - if (!function_exists('ImageCreateTrueColor')) { |
|
| 117 | - return ''; |
|
| 118 | - } |
|
| 119 | - break; |
|
| 120 | - case 'gd1': |
|
| 121 | - if (!function_exists('ImageGif') |
|
| 122 | - and !function_exists('ImageJpeg') |
|
| 123 | - and !function_exists('ImagePng') |
|
| 124 | - ) { |
|
| 125 | - return ''; |
|
| 126 | - } |
|
| 127 | - break; |
|
| 128 | - case 'netpbm': |
|
| 129 | - if (defined('_PNMSCALE_COMMAND') and _PNMSCALE_COMMAND == '') { |
|
| 130 | - return ''; |
|
| 131 | - } |
|
| 132 | - break; |
|
| 133 | - case 'imagick': |
|
| 134 | - if (!method_exists('Imagick', 'readImage')) { |
|
| 135 | - return ''; |
|
| 136 | - } |
|
| 137 | - break; |
|
| 138 | - case 'convert': |
|
| 139 | - if (defined('_CONVERT_COMMAND') and _CONVERT_COMMAND == '') { |
|
| 140 | - return ''; |
|
| 141 | - } |
|
| 142 | - break; |
|
| 143 | - } |
|
| 114 | + switch ($process) { |
|
| 115 | + case 'gd2': |
|
| 116 | + if (!function_exists('ImageCreateTrueColor')) { |
|
| 117 | + return ''; |
|
| 118 | + } |
|
| 119 | + break; |
|
| 120 | + case 'gd1': |
|
| 121 | + if (!function_exists('ImageGif') |
|
| 122 | + and !function_exists('ImageJpeg') |
|
| 123 | + and !function_exists('ImagePng') |
|
| 124 | + ) { |
|
| 125 | + return ''; |
|
| 126 | + } |
|
| 127 | + break; |
|
| 128 | + case 'netpbm': |
|
| 129 | + if (defined('_PNMSCALE_COMMAND') and _PNMSCALE_COMMAND == '') { |
|
| 130 | + return ''; |
|
| 131 | + } |
|
| 132 | + break; |
|
| 133 | + case 'imagick': |
|
| 134 | + if (!method_exists('Imagick', 'readImage')) { |
|
| 135 | + return ''; |
|
| 136 | + } |
|
| 137 | + break; |
|
| 138 | + case 'convert': |
|
| 139 | + if (defined('_CONVERT_COMMAND') and _CONVERT_COMMAND == '') { |
|
| 140 | + return ''; |
|
| 141 | + } |
|
| 142 | + break; |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - return generer_url_action('tester', "arg=$process&time=" . time()); |
|
| 145 | + return generer_url_action('tester', "arg=$process&time=" . time()); |
|
| 146 | 146 | } |
@@ -11,87 +11,87 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_annonces_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'suivi_edito', |
|
| 21 | - 'adresse_suivi', |
|
| 22 | - 'adresse_suivi_inscription', |
|
| 23 | - 'quoi_de_neuf', |
|
| 24 | - 'adresse_neuf', |
|
| 25 | - 'jours_neuf', |
|
| 26 | - 'email_envoi', |
|
| 27 | - ) as $m) { |
|
| 28 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 29 | - } |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'suivi_edito', |
|
| 21 | + 'adresse_suivi', |
|
| 22 | + 'adresse_suivi_inscription', |
|
| 23 | + 'quoi_de_neuf', |
|
| 24 | + 'adresse_neuf', |
|
| 25 | + 'jours_neuf', |
|
| 26 | + 'email_envoi', |
|
| 27 | + ) as $m) { |
|
| 28 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - return $valeurs; |
|
| 31 | + return $valeurs; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | function formulaires_configurer_annonces_verifier_dist() { |
| 35 | - $erreurs = array(); |
|
| 36 | - if (_request('suivi_edito') == 'oui') { |
|
| 37 | - if (!$email = _request('adresse_suivi')) { |
|
| 38 | - $erreurs['adresse_suivi'] = _T('info_obligatoire'); |
|
| 39 | - } else { |
|
| 40 | - include_spip('inc/filtres'); |
|
| 41 | - if (!email_valide($email)) { |
|
| 42 | - $erreurs['adresse_suivi'] = _T('form_prop_indiquer_email'); |
|
| 43 | - } |
|
| 44 | - } |
|
| 45 | - } |
|
| 46 | - if (_request('quoi_de_neuf') == 'oui') { |
|
| 47 | - if (!$email = _request('adresse_neuf')) { |
|
| 48 | - $erreurs['adresse_neuf'] = _T('info_obligatoire'); |
|
| 49 | - } else { |
|
| 50 | - include_spip('inc/filtres'); |
|
| 51 | - if (!email_valide($email)) { |
|
| 52 | - $erreurs['adresse_neuf'] = _T('form_prop_indiquer_email'); |
|
| 53 | - } |
|
| 54 | - } |
|
| 55 | - if (!$email = _request('jours_neuf')) { |
|
| 56 | - $erreurs['jours_neuf'] = _T('info_obligatoire'); |
|
| 57 | - } |
|
| 58 | - } |
|
| 35 | + $erreurs = array(); |
|
| 36 | + if (_request('suivi_edito') == 'oui') { |
|
| 37 | + if (!$email = _request('adresse_suivi')) { |
|
| 38 | + $erreurs['adresse_suivi'] = _T('info_obligatoire'); |
|
| 39 | + } else { |
|
| 40 | + include_spip('inc/filtres'); |
|
| 41 | + if (!email_valide($email)) { |
|
| 42 | + $erreurs['adresse_suivi'] = _T('form_prop_indiquer_email'); |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | + if (_request('quoi_de_neuf') == 'oui') { |
|
| 47 | + if (!$email = _request('adresse_neuf')) { |
|
| 48 | + $erreurs['adresse_neuf'] = _T('info_obligatoire'); |
|
| 49 | + } else { |
|
| 50 | + include_spip('inc/filtres'); |
|
| 51 | + if (!email_valide($email)) { |
|
| 52 | + $erreurs['adresse_neuf'] = _T('form_prop_indiquer_email'); |
|
| 53 | + } |
|
| 54 | + } |
|
| 55 | + if (!$email = _request('jours_neuf')) { |
|
| 56 | + $erreurs['jours_neuf'] = _T('info_obligatoire'); |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - return $erreurs; |
|
| 60 | + return $erreurs; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | function formulaires_configurer_annonces_traiter_dist() { |
| 64 | - $res = array('editable' => true); |
|
| 65 | - foreach (array( |
|
| 66 | - 'suivi_edito', |
|
| 67 | - 'quoi_de_neuf', |
|
| 68 | - ) as $m) { |
|
| 69 | - if (!is_null($v = _request($m))) { |
|
| 70 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 71 | - } |
|
| 72 | - } |
|
| 64 | + $res = array('editable' => true); |
|
| 65 | + foreach (array( |
|
| 66 | + 'suivi_edito', |
|
| 67 | + 'quoi_de_neuf', |
|
| 68 | + ) as $m) { |
|
| 69 | + if (!is_null($v = _request($m))) { |
|
| 70 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 71 | + } |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - foreach (array( |
|
| 75 | - 'adresse_suivi', |
|
| 76 | - 'adresse_suivi_inscription', |
|
| 77 | - 'adresse_neuf', |
|
| 78 | - 'jours_neuf', |
|
| 79 | - 'email_envoi', |
|
| 80 | - ) as $m) { |
|
| 81 | - if (!is_null($v = _request($m))) { |
|
| 82 | - ecrire_meta($m, $v); |
|
| 83 | - } |
|
| 84 | - } |
|
| 74 | + foreach (array( |
|
| 75 | + 'adresse_suivi', |
|
| 76 | + 'adresse_suivi_inscription', |
|
| 77 | + 'adresse_neuf', |
|
| 78 | + 'jours_neuf', |
|
| 79 | + 'email_envoi', |
|
| 80 | + ) as $m) { |
|
| 81 | + if (!is_null($v = _request($m))) { |
|
| 82 | + ecrire_meta($m, $v); |
|
| 83 | + } |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 87 | - // provoquer l'envoi des nouveautes en supprimant le fichier lock |
|
| 88 | - if (_request('envoi_now')) { |
|
| 89 | - effacer_meta('dernier_envoi_neuf'); |
|
| 90 | - $id_job = job_queue_add('mail', 'Test Envoi des nouveautes', array(0), 'genie/'); |
|
| 91 | - include_spip('inc/queue'); |
|
| 92 | - queue_schedule(array($id_job)); |
|
| 93 | - $res['message_ok'] .= '<br />' . _T('info_liste_nouveautes_envoyee'); |
|
| 94 | - } |
|
| 86 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 87 | + // provoquer l'envoi des nouveautes en supprimant le fichier lock |
|
| 88 | + if (_request('envoi_now')) { |
|
| 89 | + effacer_meta('dernier_envoi_neuf'); |
|
| 90 | + $id_job = job_queue_add('mail', 'Test Envoi des nouveautes', array(0), 'genie/'); |
|
| 91 | + include_spip('inc/queue'); |
|
| 92 | + queue_schedule(array($id_job)); |
|
| 93 | + $res['message_ok'] .= '<br />' . _T('info_liste_nouveautes_envoyee'); |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - return $res; |
|
| 96 | + return $res; |
|
| 97 | 97 | } |