@@ -15,32 +15,32 @@ |
||
| 15 | 15 | // http://doc.spip.org/@action_instituer_langue_rubrique_dist |
| 16 | 16 | function action_instituer_langue_rubrique_dist() { |
| 17 | 17 | |
| 18 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 19 | - $arg = $securiser_action(); |
|
| 20 | - $changer_lang = _request('changer_lang'); |
|
| 18 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 19 | + $arg = $securiser_action(); |
|
| 20 | + $changer_lang = _request('changer_lang'); |
|
| 21 | 21 | |
| 22 | - list($id_rubrique, $id_parent) = preg_split('/\W/', $arg); |
|
| 22 | + list($id_rubrique, $id_parent) = preg_split('/\W/', $arg); |
|
| 23 | 23 | |
| 24 | - if ($changer_lang |
|
| 25 | - AND $id_rubrique>0 |
|
| 26 | - AND $GLOBALS['meta']['multi_rubriques'] == 'oui' |
|
| 27 | - AND ($GLOBALS['meta']['multi_secteurs'] == 'non' OR $id_parent == 0)) { |
|
| 28 | - if ($changer_lang != "herit") |
|
| 29 | - sql_updateq('spip_rubriques', array('lang'=>$changer_lang, 'langue_choisie'=>'oui'), "id_rubrique=$id_rubrique"); |
|
| 30 | - else { |
|
| 31 | - if ($id_parent == 0) |
|
| 32 | - $langue_parent = $GLOBALS['meta']['langue_site']; |
|
| 33 | - else { |
|
| 34 | - $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=$id_parent"); |
|
| 35 | - } |
|
| 36 | - sql_updateq('spip_rubriques', array('lang'=>$langue_parent, 'langue_choisie'=>'non'), "id_rubrique=$id_rubrique"); |
|
| 37 | - } |
|
| 38 | - include_spip('inc/rubriques'); |
|
| 39 | - calculer_langues_rubriques(); |
|
| 24 | + if ($changer_lang |
|
| 25 | + AND $id_rubrique>0 |
|
| 26 | + AND $GLOBALS['meta']['multi_rubriques'] == 'oui' |
|
| 27 | + AND ($GLOBALS['meta']['multi_secteurs'] == 'non' OR $id_parent == 0)) { |
|
| 28 | + if ($changer_lang != "herit") |
|
| 29 | + sql_updateq('spip_rubriques', array('lang'=>$changer_lang, 'langue_choisie'=>'oui'), "id_rubrique=$id_rubrique"); |
|
| 30 | + else { |
|
| 31 | + if ($id_parent == 0) |
|
| 32 | + $langue_parent = $GLOBALS['meta']['langue_site']; |
|
| 33 | + else { |
|
| 34 | + $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=$id_parent"); |
|
| 35 | + } |
|
| 36 | + sql_updateq('spip_rubriques', array('lang'=>$langue_parent, 'langue_choisie'=>'non'), "id_rubrique=$id_rubrique"); |
|
| 37 | + } |
|
| 38 | + include_spip('inc/rubriques'); |
|
| 39 | + calculer_langues_rubriques(); |
|
| 40 | 40 | |
| 41 | - // invalider les caches marques de cette rubrique |
|
| 42 | - include_spip('inc/invalideur'); |
|
| 43 | - suivre_invalideur("id='rubrique/$id_rubrique'"); |
|
| 44 | - } |
|
| 41 | + // invalider les caches marques de cette rubrique |
|
| 42 | + include_spip('inc/invalideur'); |
|
| 43 | + suivre_invalideur("id='rubrique/$id_rubrique'"); |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | ?> |
@@ -36,31 +36,31 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | function action_editer_rubrique_dist($arg=null) { |
| 38 | 38 | |
| 39 | - if (is_null($arg)){ |
|
| 40 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 41 | - $arg = $securiser_action(); |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - if (!$id_rubrique = intval($arg)) { |
|
| 45 | - if ($arg != 'oui') { |
|
| 46 | - include_spip('inc/headers'); |
|
| 47 | - redirige_url_ecrire(); |
|
| 48 | - } |
|
| 49 | - $id_rubrique = rubrique_inserer(_request('id_parent')); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - $err = rubrique_modifier($id_rubrique); |
|
| 53 | - |
|
| 54 | - if (_request('redirect')) { |
|
| 55 | - $redirect = parametre_url( |
|
| 56 | - urldecode(_request('redirect')), |
|
| 57 | - 'id_rubrique', $id_rubrique, '&'); |
|
| 39 | + if (is_null($arg)){ |
|
| 40 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 41 | + $arg = $securiser_action(); |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + if (!$id_rubrique = intval($arg)) { |
|
| 45 | + if ($arg != 'oui') { |
|
| 46 | + include_spip('inc/headers'); |
|
| 47 | + redirige_url_ecrire(); |
|
| 48 | + } |
|
| 49 | + $id_rubrique = rubrique_inserer(_request('id_parent')); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + $err = rubrique_modifier($id_rubrique); |
|
| 53 | + |
|
| 54 | + if (_request('redirect')) { |
|
| 55 | + $redirect = parametre_url( |
|
| 56 | + urldecode(_request('redirect')), |
|
| 57 | + 'id_rubrique', $id_rubrique, '&'); |
|
| 58 | 58 | |
| 59 | - include_spip('inc/headers'); |
|
| 60 | - redirige_par_entete($redirect); |
|
| 61 | - } |
|
| 59 | + include_spip('inc/headers'); |
|
| 60 | + redirige_par_entete($redirect); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - return array($id_rubrique,$err); |
|
| 63 | + return array($id_rubrique,$err); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
@@ -74,34 +74,34 @@ discard block |
||
| 74 | 74 | * Identifiant de la rubrique crée |
| 75 | 75 | */ |
| 76 | 76 | function rubrique_inserer($id_parent) { |
| 77 | - $champs = array( |
|
| 78 | - 'titre' => _T('item_nouvelle_rubrique'), |
|
| 79 | - 'id_parent' => intval($id_parent), |
|
| 80 | - 'statut' => 'new'); |
|
| 77 | + $champs = array( |
|
| 78 | + 'titre' => _T('item_nouvelle_rubrique'), |
|
| 79 | + 'id_parent' => intval($id_parent), |
|
| 80 | + 'statut' => 'new'); |
|
| 81 | 81 | |
| 82 | - // Envoyer aux plugins |
|
| 83 | - $champs = pipeline('pre_insertion', |
|
| 84 | - array( |
|
| 85 | - 'args' => array( |
|
| 86 | - 'table' => 'spip_rubriques', |
|
| 87 | - ), |
|
| 88 | - 'data' => $champs |
|
| 89 | - ) |
|
| 90 | - ); |
|
| 82 | + // Envoyer aux plugins |
|
| 83 | + $champs = pipeline('pre_insertion', |
|
| 84 | + array( |
|
| 85 | + 'args' => array( |
|
| 86 | + 'table' => 'spip_rubriques', |
|
| 87 | + ), |
|
| 88 | + 'data' => $champs |
|
| 89 | + ) |
|
| 90 | + ); |
|
| 91 | 91 | |
| 92 | - $id_rubrique = sql_insertq("spip_rubriques", $champs); |
|
| 93 | - pipeline('post_insertion', |
|
| 94 | - array( |
|
| 95 | - 'args' => array( |
|
| 96 | - 'table' => 'spip_rubriques', |
|
| 97 | - 'id_objet' => $id_rubrique |
|
| 98 | - ), |
|
| 99 | - 'data' => $champs |
|
| 100 | - ) |
|
| 101 | - ); |
|
| 102 | - propager_les_secteurs(); |
|
| 103 | - calculer_langues_rubriques(); |
|
| 104 | - return $id_rubrique; |
|
| 92 | + $id_rubrique = sql_insertq("spip_rubriques", $champs); |
|
| 93 | + pipeline('post_insertion', |
|
| 94 | + array( |
|
| 95 | + 'args' => array( |
|
| 96 | + 'table' => 'spip_rubriques', |
|
| 97 | + 'id_objet' => $id_rubrique |
|
| 98 | + ), |
|
| 99 | + 'data' => $champs |
|
| 100 | + ) |
|
| 101 | + ); |
|
| 102 | + propager_les_secteurs(); |
|
| 103 | + calculer_langues_rubriques(); |
|
| 104 | + return $id_rubrique; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -117,39 +117,39 @@ discard block |
||
| 117 | 117 | * - chaîne : Texte d'un message d'erreur |
| 118 | 118 | */ |
| 119 | 119 | function rubrique_modifier($id_rubrique, $set=null) { |
| 120 | - include_spip('inc/autoriser'); |
|
| 121 | - include_spip('inc/filtres'); |
|
| 122 | - |
|
| 123 | - include_spip('inc/modifier'); |
|
| 124 | - $c = collecter_requests( |
|
| 125 | - // white list |
|
| 126 | - objet_info('rubrique','champs_editables'), |
|
| 127 | - // black list |
|
| 128 | - array('id_parent', 'confirme_deplace'), |
|
| 129 | - // donnees eventuellement fournies |
|
| 130 | - $set |
|
| 131 | - ); |
|
| 132 | - |
|
| 133 | - if ($err = objet_modifier_champs('rubrique', $id_rubrique, |
|
| 134 | - array( |
|
| 135 | - 'data' => $set, |
|
| 136 | - 'nonvide' => array('titre' => _T('titre_nouvelle_rubrique')." "._T('info_numero_abbreviation').$id_rubrique) |
|
| 137 | - ), |
|
| 138 | - $c)) |
|
| 139 | - return $err; |
|
| 140 | - |
|
| 141 | - $c = collecter_requests(array('id_parent', 'confirme_deplace'),array(),$set); |
|
| 142 | - // Deplacer la rubrique |
|
| 143 | - if (isset($c['id_parent'])) { |
|
| 144 | - $err = rubrique_instituer($id_rubrique, $c); |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - // invalider les caches marques de cette rubrique |
|
| 148 | - include_spip('inc/invalideur'); |
|
| 149 | - suivre_invalideur("id='rubrique/$id_rubrique'"); |
|
| 150 | - // et celui de menu_rubriques |
|
| 151 | - effacer_meta("date_calcul_rubriques"); |
|
| 152 | - return $err; |
|
| 120 | + include_spip('inc/autoriser'); |
|
| 121 | + include_spip('inc/filtres'); |
|
| 122 | + |
|
| 123 | + include_spip('inc/modifier'); |
|
| 124 | + $c = collecter_requests( |
|
| 125 | + // white list |
|
| 126 | + objet_info('rubrique','champs_editables'), |
|
| 127 | + // black list |
|
| 128 | + array('id_parent', 'confirme_deplace'), |
|
| 129 | + // donnees eventuellement fournies |
|
| 130 | + $set |
|
| 131 | + ); |
|
| 132 | + |
|
| 133 | + if ($err = objet_modifier_champs('rubrique', $id_rubrique, |
|
| 134 | + array( |
|
| 135 | + 'data' => $set, |
|
| 136 | + 'nonvide' => array('titre' => _T('titre_nouvelle_rubrique')." "._T('info_numero_abbreviation').$id_rubrique) |
|
| 137 | + ), |
|
| 138 | + $c)) |
|
| 139 | + return $err; |
|
| 140 | + |
|
| 141 | + $c = collecter_requests(array('id_parent', 'confirme_deplace'),array(),$set); |
|
| 142 | + // Deplacer la rubrique |
|
| 143 | + if (isset($c['id_parent'])) { |
|
| 144 | + $err = rubrique_instituer($id_rubrique, $c); |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + // invalider les caches marques de cette rubrique |
|
| 148 | + include_spip('inc/invalideur'); |
|
| 149 | + suivre_invalideur("id='rubrique/$id_rubrique'"); |
|
| 150 | + // et celui de menu_rubriques |
|
| 151 | + effacer_meta("date_calcul_rubriques"); |
|
| 152 | + return $err; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -173,17 +173,17 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | function editer_rubrique_breves($id_rubrique, $id_parent, $c=array()) |
| 175 | 175 | { |
| 176 | - if (!sql_countsel('spip_breves', "id_rubrique=$id_rubrique")) |
|
| 177 | - return true; |
|
| 176 | + if (!sql_countsel('spip_breves', "id_rubrique=$id_rubrique")) |
|
| 177 | + return true; |
|
| 178 | 178 | |
| 179 | - if ($c['confirme_deplace'] != 'oui') |
|
| 180 | - return false; |
|
| 179 | + if ($c['confirme_deplace'] != 'oui') |
|
| 180 | + return false; |
|
| 181 | 181 | |
| 182 | - if ($id_secteur = sql_getfetsel("id_secteur", |
|
| 183 | - "spip_rubriques", "id_rubrique=$id_parent")) |
|
| 184 | - sql_updateq("spip_breves", array("id_rubrique" => $id_secteur), "id_rubrique=$id_rubrique"); |
|
| 182 | + if ($id_secteur = sql_getfetsel("id_secteur", |
|
| 183 | + "spip_rubriques", "id_rubrique=$id_parent")) |
|
| 184 | + sql_updateq("spip_breves", array("id_rubrique" => $id_secteur), "id_rubrique=$id_rubrique"); |
|
| 185 | 185 | |
| 186 | - return true; |
|
| 186 | + return true; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
@@ -204,78 +204,78 @@ discard block |
||
| 204 | 204 | * Chaîne : Texte du message d'erreur |
| 205 | 205 | */ |
| 206 | 206 | function rubrique_instituer($id_rubrique, $c) { |
| 207 | - // traitement de la rubrique parente |
|
| 208 | - // interdiction de deplacer vers ou a partir d'une rubrique |
|
| 209 | - // qu'on n'administre pas. |
|
| 210 | - |
|
| 211 | - if (NULL !== ($id_parent = $c['id_parent'])) { |
|
| 212 | - $id_parent = intval($id_parent); |
|
| 213 | - $filles = calcul_branche_in($id_rubrique); |
|
| 214 | - if (strpos(",$id_parent,", ",$filles,") !== false) |
|
| 215 | - spip_log("La rubrique $id_rubrique ne peut etre fille de sa descendante $id_parent"); |
|
| 216 | - else { |
|
| 217 | - $s = sql_fetsel("id_parent, statut", "spip_rubriques", "id_rubrique=$id_rubrique"); |
|
| 218 | - $old_parent = $s['id_parent']; |
|
| 219 | - |
|
| 220 | - if (!($id_parent != $old_parent |
|
| 221 | - AND autoriser('publierdans', 'rubrique', $id_parent) |
|
| 222 | - AND autoriser('creerrubriquedans', 'rubrique', $id_parent) |
|
| 223 | - AND autoriser('publierdans', 'rubrique', $old_parent) |
|
| 224 | - )) { |
|
| 225 | - if ($s['statut'] != 'new') { |
|
| 226 | - spip_log("deplacement de $id_rubrique vers $id_parent refuse a " . $GLOBALS['visiteur_session']['id_auteur'] . ' '. $GLOBALS['visiteur_session']['statut']); |
|
| 227 | - } |
|
| 228 | - } |
|
| 229 | - elseif (editer_rubrique_breves($id_rubrique, $id_parent, $c)) { |
|
| 230 | - |
|
| 231 | - $champs = array('id_parent' => $id_parent); |
|
| 232 | - $statut_ancien = $s['statut']; |
|
| 233 | - |
|
| 234 | - // Envoyer aux plugins |
|
| 235 | - $champs = pipeline('pre_edition', |
|
| 236 | - array( |
|
| 237 | - 'args' => array( |
|
| 238 | - 'table' => 'spip_rubriques', |
|
| 239 | - 'id_objet' => $id_rubrique, |
|
| 240 | - 'action'=>'instituer', |
|
| 241 | - 'statut_ancien' => $statut_ancien, |
|
| 242 | - ), |
|
| 243 | - 'data' => $champs |
|
| 244 | - ) |
|
| 245 | - ); |
|
| 246 | - |
|
| 247 | - if (!count($champs)) return ''; |
|
| 248 | - |
|
| 249 | - sql_updateq('spip_rubriques', $champs, "id_rubrique=$id_rubrique"); |
|
| 250 | - |
|
| 251 | - propager_les_secteurs(); |
|
| 252 | - |
|
| 253 | - // Deplacement d'une rubrique publiee ==> chgt general de leur statut |
|
| 254 | - if ($statut_ancien == 'publie') |
|
| 255 | - calculer_rubriques_if($old_parent, array('id_rubrique' => $id_parent), $statut_ancien); |
|
| 256 | - // Creation ou deplacement d'une rubrique non publiee |
|
| 257 | - // invalider le cache de leur menu |
|
| 258 | - elseif (!$statut_ancien || $old_parent!=$id_parent) |
|
| 259 | - effacer_meta("date_calcul_rubriques"); |
|
| 260 | - |
|
| 261 | - calculer_langues_rubriques(); |
|
| 262 | - |
|
| 263 | - // Pipeline |
|
| 264 | - pipeline('post_edition', |
|
| 265 | - array( |
|
| 266 | - 'args' => array( |
|
| 267 | - 'table' => 'spip_rubriques', |
|
| 268 | - 'id_objet' => $id_rubrique, |
|
| 269 | - 'action'=>'instituer', |
|
| 270 | - 'statut_ancien' => $statut_ancien, |
|
| 271 | - ), |
|
| 272 | - 'data' => $champs |
|
| 273 | - ) |
|
| 274 | - ); |
|
| 275 | - } |
|
| 276 | - } |
|
| 277 | - } |
|
| 278 | - return ''; // pas d'erreur |
|
| 207 | + // traitement de la rubrique parente |
|
| 208 | + // interdiction de deplacer vers ou a partir d'une rubrique |
|
| 209 | + // qu'on n'administre pas. |
|
| 210 | + |
|
| 211 | + if (NULL !== ($id_parent = $c['id_parent'])) { |
|
| 212 | + $id_parent = intval($id_parent); |
|
| 213 | + $filles = calcul_branche_in($id_rubrique); |
|
| 214 | + if (strpos(",$id_parent,", ",$filles,") !== false) |
|
| 215 | + spip_log("La rubrique $id_rubrique ne peut etre fille de sa descendante $id_parent"); |
|
| 216 | + else { |
|
| 217 | + $s = sql_fetsel("id_parent, statut", "spip_rubriques", "id_rubrique=$id_rubrique"); |
|
| 218 | + $old_parent = $s['id_parent']; |
|
| 219 | + |
|
| 220 | + if (!($id_parent != $old_parent |
|
| 221 | + AND autoriser('publierdans', 'rubrique', $id_parent) |
|
| 222 | + AND autoriser('creerrubriquedans', 'rubrique', $id_parent) |
|
| 223 | + AND autoriser('publierdans', 'rubrique', $old_parent) |
|
| 224 | + )) { |
|
| 225 | + if ($s['statut'] != 'new') { |
|
| 226 | + spip_log("deplacement de $id_rubrique vers $id_parent refuse a " . $GLOBALS['visiteur_session']['id_auteur'] . ' '. $GLOBALS['visiteur_session']['statut']); |
|
| 227 | + } |
|
| 228 | + } |
|
| 229 | + elseif (editer_rubrique_breves($id_rubrique, $id_parent, $c)) { |
|
| 230 | + |
|
| 231 | + $champs = array('id_parent' => $id_parent); |
|
| 232 | + $statut_ancien = $s['statut']; |
|
| 233 | + |
|
| 234 | + // Envoyer aux plugins |
|
| 235 | + $champs = pipeline('pre_edition', |
|
| 236 | + array( |
|
| 237 | + 'args' => array( |
|
| 238 | + 'table' => 'spip_rubriques', |
|
| 239 | + 'id_objet' => $id_rubrique, |
|
| 240 | + 'action'=>'instituer', |
|
| 241 | + 'statut_ancien' => $statut_ancien, |
|
| 242 | + ), |
|
| 243 | + 'data' => $champs |
|
| 244 | + ) |
|
| 245 | + ); |
|
| 246 | + |
|
| 247 | + if (!count($champs)) return ''; |
|
| 248 | + |
|
| 249 | + sql_updateq('spip_rubriques', $champs, "id_rubrique=$id_rubrique"); |
|
| 250 | + |
|
| 251 | + propager_les_secteurs(); |
|
| 252 | + |
|
| 253 | + // Deplacement d'une rubrique publiee ==> chgt general de leur statut |
|
| 254 | + if ($statut_ancien == 'publie') |
|
| 255 | + calculer_rubriques_if($old_parent, array('id_rubrique' => $id_parent), $statut_ancien); |
|
| 256 | + // Creation ou deplacement d'une rubrique non publiee |
|
| 257 | + // invalider le cache de leur menu |
|
| 258 | + elseif (!$statut_ancien || $old_parent!=$id_parent) |
|
| 259 | + effacer_meta("date_calcul_rubriques"); |
|
| 260 | + |
|
| 261 | + calculer_langues_rubriques(); |
|
| 262 | + |
|
| 263 | + // Pipeline |
|
| 264 | + pipeline('post_edition', |
|
| 265 | + array( |
|
| 266 | + 'args' => array( |
|
| 267 | + 'table' => 'spip_rubriques', |
|
| 268 | + 'id_objet' => $id_rubrique, |
|
| 269 | + 'action'=>'instituer', |
|
| 270 | + 'statut_ancien' => $statut_ancien, |
|
| 271 | + ), |
|
| 272 | + 'data' => $champs |
|
| 273 | + ) |
|
| 274 | + ); |
|
| 275 | + } |
|
| 276 | + } |
|
| 277 | + } |
|
| 278 | + return ''; // pas d'erreur |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * Identifiant de la rubrique crée |
| 293 | 293 | **/ |
| 294 | 294 | function insert_rubrique($id_parent) { |
| 295 | - return rubrique_inserer($id_parent); |
|
| 295 | + return rubrique_inserer($id_parent); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | * - chaîne : Texte d'un message d'erreur |
| 314 | 314 | **/ |
| 315 | 315 | function revisions_rubriques($id_rubrique, $set=null) { |
| 316 | - return rubrique_modifier($id_rubrique,$set); |
|
| 316 | + return rubrique_modifier($id_rubrique,$set); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -332,5 +332,5 @@ discard block |
||
| 332 | 332 | * Chaîne : Texte du message d'erreur |
| 333 | 333 | **/ |
| 334 | 334 | function instituer_rubrique($id_rubrique, $c) { |
| 335 | - return rubrique_instituer($id_rubrique, $c); |
|
| 335 | + return rubrique_instituer($id_rubrique, $c); |
|
| 336 | 336 | } |
@@ -17,49 +17,49 @@ |
||
| 17 | 17 | * @return void |
| 18 | 18 | */ |
| 19 | 19 | function action_confirmer_inscription_dist() { |
| 20 | - $jeton = _request('jeton'); |
|
| 21 | - $email = _request('email'); |
|
| 20 | + $jeton = _request('jeton'); |
|
| 21 | + $email = _request('email'); |
|
| 22 | 22 | |
| 23 | - include_spip('action/inscrire_auteur'); |
|
| 24 | - if ($auteur = auteur_verifier_jeton($jeton) |
|
| 25 | - AND $auteur['email']==$email |
|
| 26 | - AND $auteur['statut']=='nouveau'){ |
|
| 23 | + include_spip('action/inscrire_auteur'); |
|
| 24 | + if ($auteur = auteur_verifier_jeton($jeton) |
|
| 25 | + AND $auteur['email']==$email |
|
| 26 | + AND $auteur['statut']=='nouveau'){ |
|
| 27 | 27 | |
| 28 | - // OK c'est un nouvel inscrit qui confirme : |
|
| 29 | - // on le loge => ca va confirmer son statut et c'est plus sympa |
|
| 30 | - include_spip('inc/auth'); |
|
| 31 | - auth_loger($auteur); |
|
| 28 | + // OK c'est un nouvel inscrit qui confirme : |
|
| 29 | + // on le loge => ca va confirmer son statut et c'est plus sympa |
|
| 30 | + include_spip('inc/auth'); |
|
| 31 | + auth_loger($auteur); |
|
| 32 | 32 | |
| 33 | - // et on efface son jeton |
|
| 34 | - auteur_effacer_jeton($auteur['id_auteur']); |
|
| 33 | + // et on efface son jeton |
|
| 34 | + auteur_effacer_jeton($auteur['id_auteur']); |
|
| 35 | 35 | |
| 36 | - // si pas de redirection demandee, rediriger vers public ou prive selon le statut de l'auteur |
|
| 37 | - // TODO: ne semble pas marcher si inscrit non visiteur, a debug |
|
| 38 | - if (!_request('redirect')){ |
|
| 39 | - // on passe id_auteur explicite pour forcer une lecture en base de toutes les infos |
|
| 40 | - if (autoriser('ecrire','','',$auteur['id_auteur'])){ |
|
| 41 | - // poser un cookie admin aussi |
|
| 42 | - $cookie = charger_fonction('cookie','action'); |
|
| 43 | - $cookie("@".$GLOBALS['visiteur_session']['login']); |
|
| 44 | - $GLOBALS['redirect'] = _DIR_RESTREINT_ABS; |
|
| 45 | - } |
|
| 46 | - else |
|
| 47 | - $GLOBALS['redirect'] = $GLOBALS['meta']['adresse_site']; |
|
| 48 | - } |
|
| 49 | - } |
|
| 50 | - else { |
|
| 51 | - // lien perime : |
|
| 52 | - if ($GLOBALS['visiteur_session']['id_auteur']){ |
|
| 53 | - // on passe id_auteur explicite pour forcer une lecture en base de toutes les infos |
|
| 54 | - if (autoriser('ecrire','','',$GLOBALS['visiteur_session']['id_auteur'])) |
|
| 55 | - $GLOBALS['redirect'] = _DIR_RESTREINT_ABS; |
|
| 56 | - else |
|
| 57 | - $GLOBALS['redirect'] = $GLOBALS['meta']['adresse_site']; |
|
| 58 | - } |
|
| 59 | - else |
|
| 60 | - // rediriger vers la page de login si pas encore loge |
|
| 61 | - $GLOBALS['redirect'] = parametre_url(generer_url_public('login','',false),'url',_request('redirect')); |
|
| 62 | - } |
|
| 36 | + // si pas de redirection demandee, rediriger vers public ou prive selon le statut de l'auteur |
|
| 37 | + // TODO: ne semble pas marcher si inscrit non visiteur, a debug |
|
| 38 | + if (!_request('redirect')){ |
|
| 39 | + // on passe id_auteur explicite pour forcer une lecture en base de toutes les infos |
|
| 40 | + if (autoriser('ecrire','','',$auteur['id_auteur'])){ |
|
| 41 | + // poser un cookie admin aussi |
|
| 42 | + $cookie = charger_fonction('cookie','action'); |
|
| 43 | + $cookie("@".$GLOBALS['visiteur_session']['login']); |
|
| 44 | + $GLOBALS['redirect'] = _DIR_RESTREINT_ABS; |
|
| 45 | + } |
|
| 46 | + else |
|
| 47 | + $GLOBALS['redirect'] = $GLOBALS['meta']['adresse_site']; |
|
| 48 | + } |
|
| 49 | + } |
|
| 50 | + else { |
|
| 51 | + // lien perime : |
|
| 52 | + if ($GLOBALS['visiteur_session']['id_auteur']){ |
|
| 53 | + // on passe id_auteur explicite pour forcer une lecture en base de toutes les infos |
|
| 54 | + if (autoriser('ecrire','','',$GLOBALS['visiteur_session']['id_auteur'])) |
|
| 55 | + $GLOBALS['redirect'] = _DIR_RESTREINT_ABS; |
|
| 56 | + else |
|
| 57 | + $GLOBALS['redirect'] = $GLOBALS['meta']['adresse_site']; |
|
| 58 | + } |
|
| 59 | + else |
|
| 60 | + // rediriger vers la page de login si pas encore loge |
|
| 61 | + $GLOBALS['redirect'] = parametre_url(generer_url_public('login','',false),'url',_request('redirect')); |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | 64 | } |
| 65 | 65 | |
@@ -15,47 +15,47 @@ |
||
| 15 | 15 | |
| 16 | 16 | // http://doc.spip.org/@action_preferer_dist |
| 17 | 17 | function action_preferer_dist() { |
| 18 | - // |
|
| 19 | - // Preferences de presentation de l'espace prive |
|
| 20 | - // |
|
| 21 | - if ($_GET['arg'] !== 'display:4') { |
|
| 22 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 23 | - $arg = $securiser_action(); |
|
| 24 | - } else $arg = $_GET['arg']; |
|
| 25 | - |
|
| 26 | - if (!preg_match(",^(.+):(.*)$,", $arg, $r)) |
|
| 27 | - spip_log("action_preferer_dist: $arg pas compris"); |
|
| 28 | - else { |
|
| 29 | - $prefs_mod = false; |
|
| 30 | - |
|
| 31 | - list(, $op, $val) = $r; |
|
| 32 | - if ($op == 'couleur') { |
|
| 33 | - $GLOBALS['visiteur_session']['prefs']['couleur'] = $val; |
|
| 34 | - $prefs_mod = true; |
|
| 35 | - } |
|
| 36 | - elseif ($op == 'display') { |
|
| 37 | - $GLOBALS['visiteur_session']['prefs']['display'] = $val; |
|
| 38 | - $prefs_mod = true; |
|
| 39 | - } |
|
| 40 | - elseif ($op == 'display_outils') { |
|
| 41 | - $GLOBALS['visiteur_session']['prefs']['display_outils'] = $val; |
|
| 42 | - $prefs_mod = true; |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - if ($prefs_mod AND intval($GLOBALS['visiteur_session']['id_auteur'])) |
|
| 46 | - sql_updateq('spip_auteurs', array('prefs' => serialize($GLOBALS['visiteur_session']['prefs'])), "id_auteur=" .intval($GLOBALS['visiteur_session']['id_auteur'])); |
|
| 18 | + // |
|
| 19 | + // Preferences de presentation de l'espace prive |
|
| 20 | + // |
|
| 21 | + if ($_GET['arg'] !== 'display:4') { |
|
| 22 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 23 | + $arg = $securiser_action(); |
|
| 24 | + } else $arg = $_GET['arg']; |
|
| 25 | + |
|
| 26 | + if (!preg_match(",^(.+):(.*)$,", $arg, $r)) |
|
| 27 | + spip_log("action_preferer_dist: $arg pas compris"); |
|
| 28 | + else { |
|
| 29 | + $prefs_mod = false; |
|
| 30 | + |
|
| 31 | + list(, $op, $val) = $r; |
|
| 32 | + if ($op == 'couleur') { |
|
| 33 | + $GLOBALS['visiteur_session']['prefs']['couleur'] = $val; |
|
| 34 | + $prefs_mod = true; |
|
| 35 | + } |
|
| 36 | + elseif ($op == 'display') { |
|
| 37 | + $GLOBALS['visiteur_session']['prefs']['display'] = $val; |
|
| 38 | + $prefs_mod = true; |
|
| 39 | + } |
|
| 40 | + elseif ($op == 'display_outils') { |
|
| 41 | + $GLOBALS['visiteur_session']['prefs']['display_outils'] = $val; |
|
| 42 | + $prefs_mod = true; |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + if ($prefs_mod AND intval($GLOBALS['visiteur_session']['id_auteur'])) |
|
| 46 | + sql_updateq('spip_auteurs', array('prefs' => serialize($GLOBALS['visiteur_session']['prefs'])), "id_auteur=" .intval($GLOBALS['visiteur_session']['id_auteur'])); |
|
| 47 | 47 | |
| 48 | - if ($op == 'spip_ecran') { |
|
| 49 | - // Poser un cookie, |
|
| 50 | - // car ce reglage depend plus du navigateur que de l'utilisateur |
|
| 51 | - $GLOBALS['spip_ecran'] = $val; |
|
| 52 | - include_spip('inc/cookie'); |
|
| 53 | - spip_setcookie('spip_ecran', $val, time() + 365 * 24 * 3600); |
|
| 54 | - } |
|
| 55 | - |
|
| 56 | - // Si modif des couleurs en ajax, redirect inutile on a change de CSS |
|
| 57 | - if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') exit; |
|
| 58 | - |
|
| 59 | - } |
|
| 48 | + if ($op == 'spip_ecran') { |
|
| 49 | + // Poser un cookie, |
|
| 50 | + // car ce reglage depend plus du navigateur que de l'utilisateur |
|
| 51 | + $GLOBALS['spip_ecran'] = $val; |
|
| 52 | + include_spip('inc/cookie'); |
|
| 53 | + spip_setcookie('spip_ecran', $val, time() + 365 * 24 * 3600); |
|
| 54 | + } |
|
| 55 | + |
|
| 56 | + // Si modif des couleurs en ajax, redirect inutile on a change de CSS |
|
| 57 | + if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') exit; |
|
| 58 | + |
|
| 59 | + } |
|
| 60 | 60 | } |
| 61 | 61 | ?> |
@@ -16,75 +16,75 @@ |
||
| 16 | 16 | |
| 17 | 17 | // http://doc.spip.org/@gerer_deplacements |
| 18 | 18 | function gerer_deplacements($deplacements){ |
| 19 | - foreach(explode("\n",$deplacements) as $dep){ |
|
| 20 | - $mouvement=explode(":",$dep); |
|
| 21 | - list($quoi,$id_quoi) = explode("-",$mouvement[0]); |
|
| 22 | - list($cible, $id_cible) =explode("-",$mouvement[1]); |
|
| 23 | - $f = 'reorganiser_' . $quoi . '_' . $cible; |
|
| 24 | - if (function_exists($f)) |
|
| 25 | - $f(intval($id_quoi), intval($id_cible)); |
|
| 26 | - else spip_log("reorganiser $dep: incompris"); |
|
| 27 | - } |
|
| 19 | + foreach(explode("\n",$deplacements) as $dep){ |
|
| 20 | + $mouvement=explode(":",$dep); |
|
| 21 | + list($quoi,$id_quoi) = explode("-",$mouvement[0]); |
|
| 22 | + list($cible, $id_cible) =explode("-",$mouvement[1]); |
|
| 23 | + $f = 'reorganiser_' . $quoi . '_' . $cible; |
|
| 24 | + if (function_exists($f)) |
|
| 25 | + $f(intval($id_quoi), intval($id_cible)); |
|
| 26 | + else spip_log("reorganiser $dep: incompris"); |
|
| 27 | + } |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | // http://doc.spip.org/@reorganiser_article_rubrique |
| 31 | 31 | function reorganiser_article_rubrique($id_article, $id_rubrique) |
| 32 | 32 | { |
| 33 | - if ($id_rubrique |
|
| 34 | - AND autoriser('modifier','rubrique',$id_rubrique) |
|
| 35 | - AND autoriser('modifier','article',$id_article)) { |
|
| 36 | - |
|
| 37 | - include_spip('action/editer_article'); |
|
| 38 | - include_spip('inc/rubriques'); |
|
| 39 | - $s = sql_fetsel("statut, id_rubrique", "spip_articles", "id_article=$id_article"); |
|
| 40 | - editer_article_heritage($id_article, |
|
| 41 | - $s['id_rubrique'], |
|
| 42 | - $s['statut'], |
|
| 43 | - array('id_rubrique' => $id_rubrique)); |
|
| 44 | - } |
|
| 33 | + if ($id_rubrique |
|
| 34 | + AND autoriser('modifier','rubrique',$id_rubrique) |
|
| 35 | + AND autoriser('modifier','article',$id_article)) { |
|
| 36 | + |
|
| 37 | + include_spip('action/editer_article'); |
|
| 38 | + include_spip('inc/rubriques'); |
|
| 39 | + $s = sql_fetsel("statut, id_rubrique", "spip_articles", "id_article=$id_article"); |
|
| 40 | + editer_article_heritage($id_article, |
|
| 41 | + $s['id_rubrique'], |
|
| 42 | + $s['statut'], |
|
| 43 | + array('id_rubrique' => $id_rubrique)); |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // http://doc.spip.org/@reorganiser_rubrique_rubrique |
| 48 | 48 | function reorganiser_rubrique_rubrique($id_quoi, $id_cible) |
| 49 | 49 | { |
| 50 | - if (($id_quoi != $id_cible) |
|
| 51 | - AND autoriser('modifier','rubrique',$id_cible) |
|
| 52 | - AND autoriser('modifier','rubrique',$id_quoi)) { |
|
| 53 | - if (!$id_cible) |
|
| 54 | - $id_secteur = $id_quoi; |
|
| 55 | - else { |
|
| 56 | - $id_secteur = sql_getfetsel("id_secteur", "spip_rubriques", "id_rubrique=$id_cible"); |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - $s = sql_fetsel("statut, id_parent, id_secteur", "spip_rubriques", "id_rubrique=".intval($id_quoi)); |
|
| 60 | - |
|
| 61 | - sql_updateq('spip_rubriques', array('id_parent' => $id_cible, 'id_secteur'=>$id_secteur), "id_rubrique=".intval($id_quoi)); |
|
| 62 | - |
|
| 63 | - include_spip('inc/rubriques'); |
|
| 64 | - // propager les secteurs si besoin |
|
| 65 | - if ($s['id_secteur']!=$id_secteur) |
|
| 66 | - propager_les_secteurs(); |
|
| 67 | - // changer le statut de la rubrique source |
|
| 68 | - if ($s['statut'] == 'publie') |
|
| 69 | - calculer_rubriques_if($s['id_parent'], |
|
| 70 | - array('id_rubrique' => $id_cible), |
|
| 71 | - 'publie'); |
|
| 72 | - } |
|
| 50 | + if (($id_quoi != $id_cible) |
|
| 51 | + AND autoriser('modifier','rubrique',$id_cible) |
|
| 52 | + AND autoriser('modifier','rubrique',$id_quoi)) { |
|
| 53 | + if (!$id_cible) |
|
| 54 | + $id_secteur = $id_quoi; |
|
| 55 | + else { |
|
| 56 | + $id_secteur = sql_getfetsel("id_secteur", "spip_rubriques", "id_rubrique=$id_cible"); |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + $s = sql_fetsel("statut, id_parent, id_secteur", "spip_rubriques", "id_rubrique=".intval($id_quoi)); |
|
| 60 | + |
|
| 61 | + sql_updateq('spip_rubriques', array('id_parent' => $id_cible, 'id_secteur'=>$id_secteur), "id_rubrique=".intval($id_quoi)); |
|
| 62 | + |
|
| 63 | + include_spip('inc/rubriques'); |
|
| 64 | + // propager les secteurs si besoin |
|
| 65 | + if ($s['id_secteur']!=$id_secteur) |
|
| 66 | + propager_les_secteurs(); |
|
| 67 | + // changer le statut de la rubrique source |
|
| 68 | + if ($s['statut'] == 'publie') |
|
| 69 | + calculer_rubriques_if($s['id_parent'], |
|
| 70 | + array('id_rubrique' => $id_cible), |
|
| 71 | + 'publie'); |
|
| 72 | + } |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // http://doc.spip.org/@action_reorganiser_dist |
| 76 | 76 | function action_reorganiser_dist(){ |
| 77 | 77 | |
| 78 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 79 | - $securiser_action(); |
|
| 78 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 79 | + $securiser_action(); |
|
| 80 | 80 | |
| 81 | - if (_request('deplacements')!==NULL) |
|
| 82 | - gerer_deplacements(_request('deplacements')); |
|
| 81 | + if (_request('deplacements')!==NULL) |
|
| 82 | + gerer_deplacements(_request('deplacements')); |
|
| 83 | 83 | |
| 84 | - $redirect = _request('redirect'); |
|
| 85 | - if ($redirect==NULL) $redirect=""; |
|
| 84 | + $redirect = _request('redirect'); |
|
| 85 | + if ($redirect==NULL) $redirect=""; |
|
| 86 | 86 | |
| 87 | - redirige_par_entete(str_replace("&","&",urldecode($redirect))); |
|
| 87 | + redirige_par_entete(str_replace("&","&",urldecode($redirect))); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
@@ -17,83 +17,83 @@ |
||
| 17 | 17 | |
| 18 | 18 | // http://doc.spip.org/@action_cookie_dist |
| 19 | 19 | function action_cookie_dist($set_cookie_admin=null, $change_session = null) { |
| 20 | - $redirect_echec = $redirect = null; |
|
| 21 | - $test_echec_cookie = null; |
|
| 22 | - $url = ""; |
|
| 23 | - if (is_null($set_cookie_admin)){ |
|
| 24 | - $set_cookie_admin = _request('cookie_admin'); |
|
| 25 | - $change_session = _request('change_session'); |
|
| 26 | - $test_echec_cookie = _request('test_echec_cookie'); |
|
| 20 | + $redirect_echec = $redirect = null; |
|
| 21 | + $test_echec_cookie = null; |
|
| 22 | + $url = ""; |
|
| 23 | + if (is_null($set_cookie_admin)){ |
|
| 24 | + $set_cookie_admin = _request('cookie_admin'); |
|
| 25 | + $change_session = _request('change_session'); |
|
| 26 | + $test_echec_cookie = _request('test_echec_cookie'); |
|
| 27 | 27 | |
| 28 | - // La cible de notre operation de connexion |
|
| 29 | - $url = securiser_redirect_action(_request('url')); |
|
| 30 | - $redirect = $url ? $url : generer_url_ecrire('accueil'); |
|
| 31 | - $redirect_echec = _request('url_echec'); |
|
| 32 | - if (!isset($redirect_echec)) { |
|
| 33 | - if (strpos($redirect,_DIR_RESTREINT_ABS)!==false) |
|
| 34 | - $redirect_echec = generer_url_public('login','',true); |
|
| 35 | - else |
|
| 36 | - $redirect_echec = $redirect; |
|
| 37 | - } |
|
| 38 | - } |
|
| 28 | + // La cible de notre operation de connexion |
|
| 29 | + $url = securiser_redirect_action(_request('url')); |
|
| 30 | + $redirect = $url ? $url : generer_url_ecrire('accueil'); |
|
| 31 | + $redirect_echec = _request('url_echec'); |
|
| 32 | + if (!isset($redirect_echec)) { |
|
| 33 | + if (strpos($redirect,_DIR_RESTREINT_ABS)!==false) |
|
| 34 | + $redirect_echec = generer_url_public('login','',true); |
|
| 35 | + else |
|
| 36 | + $redirect_echec = $redirect; |
|
| 37 | + } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | |
| 41 | - // rejoue le cookie pour renouveler spip_session |
|
| 42 | - if ($change_session == 'oui') { |
|
| 43 | - $session = charger_fonction('session', 'inc'); |
|
| 44 | - $session(true); |
|
| 45 | - spip_log("statut 204 pour " . $_SERVER['REQUEST_URI']); |
|
| 46 | - http_status(204); // No Content |
|
| 47 | - return; |
|
| 48 | - } |
|
| 41 | + // rejoue le cookie pour renouveler spip_session |
|
| 42 | + if ($change_session == 'oui') { |
|
| 43 | + $session = charger_fonction('session', 'inc'); |
|
| 44 | + $session(true); |
|
| 45 | + spip_log("statut 204 pour " . $_SERVER['REQUEST_URI']); |
|
| 46 | + http_status(204); // No Content |
|
| 47 | + return; |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - // tentative de connexion en auth_http |
|
| 51 | - if (_request('essai_auth_http') AND !$GLOBALS['ignore_auth_http']) { |
|
| 52 | - include_spip('inc/auth'); |
|
| 53 | - if (@$_SERVER['PHP_AUTH_USER'] |
|
| 54 | - AND @$_SERVER['PHP_AUTH_PW'] |
|
| 55 | - AND $auteur = lire_php_auth($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])){ |
|
| 56 | - auth_loger($auteur); |
|
| 57 | - redirige_par_entete(parametre_url($redirect,'t',time(),'&')); |
|
| 58 | - } |
|
| 59 | - else { |
|
| 60 | - ask_php_auth(_T('info_connexion_refusee'), |
|
| 61 | - _T('login_login_pass_incorrect'), |
|
| 62 | - _T('login_retour_site'), |
|
| 63 | - "url=".rawurlencode($redirect), |
|
| 64 | - _T('login_nouvelle_tentative'), |
|
| 65 | - (strpos($url,_DIR_RESTREINT_ABS)!==false)); |
|
| 66 | - } |
|
| 67 | - } |
|
| 68 | - else { |
|
| 50 | + // tentative de connexion en auth_http |
|
| 51 | + if (_request('essai_auth_http') AND !$GLOBALS['ignore_auth_http']) { |
|
| 52 | + include_spip('inc/auth'); |
|
| 53 | + if (@$_SERVER['PHP_AUTH_USER'] |
|
| 54 | + AND @$_SERVER['PHP_AUTH_PW'] |
|
| 55 | + AND $auteur = lire_php_auth($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])){ |
|
| 56 | + auth_loger($auteur); |
|
| 57 | + redirige_par_entete(parametre_url($redirect,'t',time(),'&')); |
|
| 58 | + } |
|
| 59 | + else { |
|
| 60 | + ask_php_auth(_T('info_connexion_refusee'), |
|
| 61 | + _T('login_login_pass_incorrect'), |
|
| 62 | + _T('login_retour_site'), |
|
| 63 | + "url=".rawurlencode($redirect), |
|
| 64 | + _T('login_nouvelle_tentative'), |
|
| 65 | + (strpos($url,_DIR_RESTREINT_ABS)!==false)); |
|
| 66 | + } |
|
| 67 | + } |
|
| 68 | + else { |
|
| 69 | 69 | |
| 70 | - // en cas de login sur bonjour=oui, on tente de poser un cookie |
|
| 71 | - // puis de passer au login qui diagnostiquera l'echec de cookie |
|
| 72 | - // le cas echeant. |
|
| 73 | - if ($test_echec_cookie == 'oui') { |
|
| 74 | - spip_setcookie('spip_session', 'test_echec_cookie'); |
|
| 75 | - if ($redirect) |
|
| 76 | - $redirect = parametre_url(parametre_url($redirect_echec,'var_echec_cookie','oui','&'),'url',rawurlencode($redirect),'&'); |
|
| 77 | - } |
|
| 78 | - else { |
|
| 70 | + // en cas de login sur bonjour=oui, on tente de poser un cookie |
|
| 71 | + // puis de passer au login qui diagnostiquera l'echec de cookie |
|
| 72 | + // le cas echeant. |
|
| 73 | + if ($test_echec_cookie == 'oui') { |
|
| 74 | + spip_setcookie('spip_session', 'test_echec_cookie'); |
|
| 75 | + if ($redirect) |
|
| 76 | + $redirect = parametre_url(parametre_url($redirect_echec,'var_echec_cookie','oui','&'),'url',rawurlencode($redirect),'&'); |
|
| 77 | + } |
|
| 78 | + else { |
|
| 79 | 79 | |
| 80 | - $cook = isset($_COOKIE['spip_admin']) ? $_COOKIE['spip_admin'] : ''; |
|
| 81 | - // Suppression cookie d'admin ? |
|
| 82 | - if ($set_cookie_admin == "non") { |
|
| 83 | - if ($cook) |
|
| 84 | - spip_setcookie('spip_admin', $cook, time() - 3600 * 24); |
|
| 85 | - } |
|
| 86 | - // Ajout de cookie d'admin |
|
| 87 | - else if ($set_cookie_admin) { |
|
| 88 | - spip_setcookie('spip_admin', $set_cookie_admin, |
|
| 89 | - time() + 14 * 24 * 3600); |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - } |
|
| 80 | + $cook = isset($_COOKIE['spip_admin']) ? $_COOKIE['spip_admin'] : ''; |
|
| 81 | + // Suppression cookie d'admin ? |
|
| 82 | + if ($set_cookie_admin == "non") { |
|
| 83 | + if ($cook) |
|
| 84 | + spip_setcookie('spip_admin', $cook, time() - 3600 * 24); |
|
| 85 | + } |
|
| 86 | + // Ajout de cookie d'admin |
|
| 87 | + else if ($set_cookie_admin) { |
|
| 88 | + spip_setcookie('spip_admin', $set_cookie_admin, |
|
| 89 | + time() + 14 * 24 * 3600); |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - // Redirection finale |
|
| 95 | - if ($redirect) |
|
| 96 | - redirige_par_entete($redirect, true); |
|
| 94 | + // Redirection finale |
|
| 95 | + if ($redirect) |
|
| 96 | + redirige_par_entete($redirect, true); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | ?> |
@@ -18,142 +18,142 @@ |
||
| 18 | 18 | |
| 19 | 19 | function action_menu_rubriques_dist() { |
| 20 | 20 | |
| 21 | - // si pas acces a ecrire, pas acces au menu |
|
| 22 | - // on renvoi un 401 qui fait echouer la requete ajax silencieusement |
|
| 23 | - if (!autoriser('ecrire')){ |
|
| 24 | - $retour = "<ul class='cols_1'><li class='toutsite'><a href='".generer_url_ecrire('accueil')."'>"._T('public:lien_connecter')."</a></li></ul>"; |
|
| 25 | - include_spip('inc/actions'); |
|
| 26 | - ajax_retour($retour); |
|
| 27 | - exit; |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - if ($date = intval(_request('date'))) |
|
| 31 | - header("Last-Modified: ".gmdate("D, d M Y H:i:s", $date)." GMT"); |
|
| 32 | - |
|
| 33 | - $r = gen_liste_rubriques(); |
|
| 34 | - if (!$r |
|
| 35 | - AND isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) |
|
| 36 | - AND !strstr($_SERVER['SERVER_SOFTWARE'],'IIS/')) { |
|
| 37 | - include_spip('inc/headers'); |
|
| 38 | - header('Content-Type: text/html; charset='. $GLOBALS['meta']['charset']); |
|
| 39 | - http_status(304); |
|
| 40 | - exit; |
|
| 41 | - } else { |
|
| 42 | - include_spip('inc/actions'); |
|
| 43 | - $ret = menu_rubriques(); |
|
| 44 | - ajax_retour($ret); |
|
| 45 | - } |
|
| 21 | + // si pas acces a ecrire, pas acces au menu |
|
| 22 | + // on renvoi un 401 qui fait echouer la requete ajax silencieusement |
|
| 23 | + if (!autoriser('ecrire')){ |
|
| 24 | + $retour = "<ul class='cols_1'><li class='toutsite'><a href='".generer_url_ecrire('accueil')."'>"._T('public:lien_connecter')."</a></li></ul>"; |
|
| 25 | + include_spip('inc/actions'); |
|
| 26 | + ajax_retour($retour); |
|
| 27 | + exit; |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + if ($date = intval(_request('date'))) |
|
| 31 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s", $date)." GMT"); |
|
| 32 | + |
|
| 33 | + $r = gen_liste_rubriques(); |
|
| 34 | + if (!$r |
|
| 35 | + AND isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) |
|
| 36 | + AND !strstr($_SERVER['SERVER_SOFTWARE'],'IIS/')) { |
|
| 37 | + include_spip('inc/headers'); |
|
| 38 | + header('Content-Type: text/html; charset='. $GLOBALS['meta']['charset']); |
|
| 39 | + http_status(304); |
|
| 40 | + exit; |
|
| 41 | + } else { |
|
| 42 | + include_spip('inc/actions'); |
|
| 43 | + $ret = menu_rubriques(); |
|
| 44 | + ajax_retour($ret); |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | function menu_rubriques($complet = true){ |
| 49 | - $ret = "<li class='toutsite'><a href='".generer_url_ecrire('plan')."'>"._T('info_tout_site')."</a></li>"; |
|
| 50 | - |
|
| 51 | - if (!$complet) { |
|
| 52 | - return "<ul class='cols_1'>$ret\n</ul>\n"; |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - if (!isset($GLOBALS['db_art_cache'])){ |
|
| 56 | - gen_liste_rubriques(); |
|
| 57 | - } |
|
| 58 | - $arr_low = extraire_article(0, $GLOBALS['db_art_cache']); |
|
| 59 | - |
|
| 60 | - $total_lignes = $i = sizeof($arr_low); |
|
| 61 | - |
|
| 62 | - if ($i > 0) { |
|
| 63 | - $nb_col = min(8,ceil($total_lignes / 30)); |
|
| 64 | - if ($nb_col <= 1) $nb_col = ceil($total_lignes / 10); |
|
| 65 | - foreach( $arr_low as $id_rubrique => $titre_rubrique) { |
|
| 66 | - if (autoriser('voir','rubrique',$id_rubrique)){ |
|
| 67 | - $ret .= bandeau_rubrique($id_rubrique, $titre_rubrique, $i); |
|
| 68 | - $i++; |
|
| 69 | - } |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - $ret = "<ul class='cols_$nb_col'>" |
|
| 73 | - . $ret |
|
| 74 | - . "\n</ul>\n"; |
|
| 75 | - } |
|
| 76 | - else |
|
| 77 | - $ret = "<ul class='cols_1'>$ret\n</ul>\n"; |
|
| 49 | + $ret = "<li class='toutsite'><a href='".generer_url_ecrire('plan')."'>"._T('info_tout_site')."</a></li>"; |
|
| 50 | + |
|
| 51 | + if (!$complet) { |
|
| 52 | + return "<ul class='cols_1'>$ret\n</ul>\n"; |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + if (!isset($GLOBALS['db_art_cache'])){ |
|
| 56 | + gen_liste_rubriques(); |
|
| 57 | + } |
|
| 58 | + $arr_low = extraire_article(0, $GLOBALS['db_art_cache']); |
|
| 59 | + |
|
| 60 | + $total_lignes = $i = sizeof($arr_low); |
|
| 61 | + |
|
| 62 | + if ($i > 0) { |
|
| 63 | + $nb_col = min(8,ceil($total_lignes / 30)); |
|
| 64 | + if ($nb_col <= 1) $nb_col = ceil($total_lignes / 10); |
|
| 65 | + foreach( $arr_low as $id_rubrique => $titre_rubrique) { |
|
| 66 | + if (autoriser('voir','rubrique',$id_rubrique)){ |
|
| 67 | + $ret .= bandeau_rubrique($id_rubrique, $titre_rubrique, $i); |
|
| 68 | + $i++; |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + $ret = "<ul class='cols_$nb_col'>" |
|
| 73 | + . $ret |
|
| 74 | + . "\n</ul>\n"; |
|
| 75 | + } |
|
| 76 | + else |
|
| 77 | + $ret = "<ul class='cols_1'>$ret\n</ul>\n"; |
|
| 78 | 78 | |
| 79 | - return $ret; |
|
| 79 | + return $ret; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // http://doc.spip.org/@bandeau_rubrique |
| 83 | 83 | function bandeau_rubrique($id_rubrique, $titre_rubrique, $zdecal) { |
| 84 | - static $zmax = 6; |
|
| 85 | - |
|
| 86 | - $nav = "<a href='" |
|
| 87 | - . generer_url_entite($id_rubrique,'rubrique','','',false) |
|
| 88 | - . "'>" |
|
| 89 | - . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) |
|
| 90 | - . "</a>\n"; |
|
| 91 | - |
|
| 92 | - // Limiter volontairement le nombre de sous-menus |
|
| 93 | - if (!(--$zmax)) { |
|
| 94 | - $zmax++; |
|
| 95 | - return "\n<li>$nav</li>"; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - $arr_rub = extraire_article($id_rubrique, $GLOBALS['db_art_cache']); |
|
| 99 | - $i = sizeof($arr_rub); |
|
| 100 | - if (!$i) { |
|
| 101 | - $zmax++; |
|
| 102 | - return "\n<li>$nav</li>"; |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - |
|
| 106 | - $nb_col = 1; |
|
| 107 | - if ($nb_rub = count($arr_rub)) { |
|
| 108 | - $nb_col = min(10,max(1,ceil($nb_rub / 10))); |
|
| 109 | - } |
|
| 110 | - $ret = "<li class='haschild'>$nav<ul class='cols_$nb_col'>"; |
|
| 111 | - foreach( $arr_rub as $id_rub => $titre_rub) { |
|
| 112 | - if (autoriser('voir','rubrique',$id_rub)){ |
|
| 113 | - $titre = supprimer_numero(typo($titre_rub)); |
|
| 114 | - $ret .= bandeau_rubrique($id_rub, $titre, $zdecal+$i); |
|
| 115 | - $i++; |
|
| 116 | - } |
|
| 117 | - } |
|
| 118 | - $ret .= "</ul></li>\n"; |
|
| 119 | - $zmax++; |
|
| 120 | - return $ret; |
|
| 84 | + static $zmax = 6; |
|
| 85 | + |
|
| 86 | + $nav = "<a href='" |
|
| 87 | + . generer_url_entite($id_rubrique,'rubrique','','',false) |
|
| 88 | + . "'>" |
|
| 89 | + . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) |
|
| 90 | + . "</a>\n"; |
|
| 91 | + |
|
| 92 | + // Limiter volontairement le nombre de sous-menus |
|
| 93 | + if (!(--$zmax)) { |
|
| 94 | + $zmax++; |
|
| 95 | + return "\n<li>$nav</li>"; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + $arr_rub = extraire_article($id_rubrique, $GLOBALS['db_art_cache']); |
|
| 99 | + $i = sizeof($arr_rub); |
|
| 100 | + if (!$i) { |
|
| 101 | + $zmax++; |
|
| 102 | + return "\n<li>$nav</li>"; |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + |
|
| 106 | + $nb_col = 1; |
|
| 107 | + if ($nb_rub = count($arr_rub)) { |
|
| 108 | + $nb_col = min(10,max(1,ceil($nb_rub / 10))); |
|
| 109 | + } |
|
| 110 | + $ret = "<li class='haschild'>$nav<ul class='cols_$nb_col'>"; |
|
| 111 | + foreach( $arr_rub as $id_rub => $titre_rub) { |
|
| 112 | + if (autoriser('voir','rubrique',$id_rub)){ |
|
| 113 | + $titre = supprimer_numero(typo($titre_rub)); |
|
| 114 | + $ret .= bandeau_rubrique($id_rub, $titre, $zdecal+$i); |
|
| 115 | + $i++; |
|
| 116 | + } |
|
| 117 | + } |
|
| 118 | + $ret .= "</ul></li>\n"; |
|
| 119 | + $zmax++; |
|
| 120 | + return $ret; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | // http://doc.spip.org/@extraire_article |
| 125 | 125 | function extraire_article($id_p, $t) { |
| 126 | - return array_key_exists($id_p, $t) ? $t[$id_p]: array(); |
|
| 126 | + return array_key_exists($id_p, $t) ? $t[$id_p]: array(); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // http://doc.spip.org/@gen_liste_rubriques |
| 130 | 130 | function gen_liste_rubriques() { |
| 131 | 131 | |
| 132 | - include_spip('inc/config'); |
|
| 133 | - // ici, un petit fichier cache ne fait pas de mal |
|
| 134 | - $last = lire_config('date_calcul_rubriques', 0); |
|
| 135 | - if (lire_fichier(_CACHE_RUBRIQUES, $cache)) { |
|
| 136 | - list($date,$GLOBALS['db_art_cache']) = @unserialize($cache); |
|
| 137 | - if ($date == $last) return false; // c'etait en cache :-) |
|
| 138 | - } |
|
| 139 | - // se restreindre aux rubriques utilisees recemment +secteurs |
|
| 132 | + include_spip('inc/config'); |
|
| 133 | + // ici, un petit fichier cache ne fait pas de mal |
|
| 134 | + $last = lire_config('date_calcul_rubriques', 0); |
|
| 135 | + if (lire_fichier(_CACHE_RUBRIQUES, $cache)) { |
|
| 136 | + list($date,$GLOBALS['db_art_cache']) = @unserialize($cache); |
|
| 137 | + if ($date == $last) return false; // c'etait en cache :-) |
|
| 138 | + } |
|
| 139 | + // se restreindre aux rubriques utilisees recemment +secteurs |
|
| 140 | 140 | |
| 141 | - $where = sql_in_select("id_rubrique", "id_rubrique", "spip_rubriques", "", "", "id_parent=0 DESC, date DESC", _CACHE_RUBRIQUES_MAX); |
|
| 141 | + $where = sql_in_select("id_rubrique", "id_rubrique", "spip_rubriques", "", "", "id_parent=0 DESC, date DESC", _CACHE_RUBRIQUES_MAX); |
|
| 142 | 142 | |
| 143 | - // puis refaire la requete pour avoir l'ordre alphabetique |
|
| 143 | + // puis refaire la requete pour avoir l'ordre alphabetique |
|
| 144 | 144 | |
| 145 | - $res = sql_select("id_rubrique, titre, id_parent", "spip_rubriques", $where, '', 'id_parent, 0+titre, titre'); |
|
| 145 | + $res = sql_select("id_rubrique, titre, id_parent", "spip_rubriques", $where, '', 'id_parent, 0+titre, titre'); |
|
| 146 | 146 | |
| 147 | - // il ne faut pas filtrer le autoriser voir ici |
|
| 148 | - // car on met le resultat en cache, commun a tout le monde |
|
| 149 | - $GLOBALS['db_art_cache'] = array(); |
|
| 150 | - while ($r = sql_fetch($res)) { |
|
| 151 | - $t = sinon($r['titre'], _T('ecrire:info_sans_titre')); |
|
| 152 | - $GLOBALS['db_art_cache'][$r['id_parent']][$r['id_rubrique']] = supprimer_numero(typo($t)); |
|
| 153 | - } |
|
| 147 | + // il ne faut pas filtrer le autoriser voir ici |
|
| 148 | + // car on met le resultat en cache, commun a tout le monde |
|
| 149 | + $GLOBALS['db_art_cache'] = array(); |
|
| 150 | + while ($r = sql_fetch($res)) { |
|
| 151 | + $t = sinon($r['titre'], _T('ecrire:info_sans_titre')); |
|
| 152 | + $GLOBALS['db_art_cache'][$r['id_parent']][$r['id_rubrique']] = supprimer_numero(typo($t)); |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - $t = array($last ? $last : time(), $GLOBALS['db_art_cache']); |
|
| 156 | - ecrire_fichier(_CACHE_RUBRIQUES, serialize($t)); |
|
| 157 | - return true; |
|
| 155 | + $t = array($last ? $last : time(), $GLOBALS['db_art_cache']); |
|
| 156 | + ecrire_fichier(_CACHE_RUBRIQUES, serialize($t)); |
|
| 157 | + return true; |
|
| 158 | 158 | } |
| 159 | 159 | ?> |
@@ -22,42 +22,42 @@ |
||
| 22 | 22 | * @return string |
| 23 | 23 | */ |
| 24 | 24 | function action_instituer_langue_objet_dist($objet, $id, $id_rubrique, $changer_lang, $serveur='') { |
| 25 | - if ($changer_lang) { |
|
| 26 | - $table_objet_sql = table_objet_sql($objet); |
|
| 27 | - $id_table_objet = id_table_objet($objet); |
|
| 28 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 29 | - $desc = $trouver_table($table_objet_sql, $serveur); |
|
| 25 | + if ($changer_lang) { |
|
| 26 | + $table_objet_sql = table_objet_sql($objet); |
|
| 27 | + $id_table_objet = id_table_objet($objet); |
|
| 28 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 29 | + $desc = $trouver_table($table_objet_sql, $serveur); |
|
| 30 | 30 | |
| 31 | - $set = array(); |
|
| 32 | - if (isset($desc['field']['langue_choisie'])){ |
|
| 33 | - $set['langue_choisie'] = 'oui'; |
|
| 34 | - } |
|
| 31 | + $set = array(); |
|
| 32 | + if (isset($desc['field']['langue_choisie'])){ |
|
| 33 | + $set['langue_choisie'] = 'oui'; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - if ($changer_lang != "herit") { |
|
| 37 | - $set['lang'] = $changer_lang; |
|
| 38 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id),'',$serveur); |
|
| 39 | - include_spip('inc/rubriques'); // pour calculer_langues_rubriques et calculer_langues_utilisees |
|
| 40 | - if ($table_objet_sql == 'spip_rubriques') { |
|
| 41 | - calculer_langues_rubriques(); |
|
| 42 | - } |
|
| 43 | - $langues = calculer_langues_utilisees($serveur); |
|
| 44 | - ecrire_meta('langues_utilisees', $langues); |
|
| 45 | - } |
|
| 46 | - else { |
|
| 47 | - $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=" . intval($id_rubrique)); |
|
| 48 | - if (!$langue_parent) |
|
| 49 | - $langue_parent = $GLOBALS['meta']['langue_site']; |
|
| 50 | - $changer_lang = $langue_parent; |
|
| 51 | - $set['lang'] = $changer_lang; |
|
| 52 | - if (isset($set['langue_choisie'])){ |
|
| 53 | - $set['langue_choisie'] = 'non'; |
|
| 54 | - } |
|
| 55 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id),'',$serveur); |
|
| 56 | - if ($table_objet_sql == 'spip_rubriques') { |
|
| 57 | - include_spip('inc/rubriques'); |
|
| 58 | - calculer_langues_rubriques(); |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - return $changer_lang; |
|
| 36 | + if ($changer_lang != "herit") { |
|
| 37 | + $set['lang'] = $changer_lang; |
|
| 38 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id),'',$serveur); |
|
| 39 | + include_spip('inc/rubriques'); // pour calculer_langues_rubriques et calculer_langues_utilisees |
|
| 40 | + if ($table_objet_sql == 'spip_rubriques') { |
|
| 41 | + calculer_langues_rubriques(); |
|
| 42 | + } |
|
| 43 | + $langues = calculer_langues_utilisees($serveur); |
|
| 44 | + ecrire_meta('langues_utilisees', $langues); |
|
| 45 | + } |
|
| 46 | + else { |
|
| 47 | + $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=" . intval($id_rubrique)); |
|
| 48 | + if (!$langue_parent) |
|
| 49 | + $langue_parent = $GLOBALS['meta']['langue_site']; |
|
| 50 | + $changer_lang = $langue_parent; |
|
| 51 | + $set['lang'] = $changer_lang; |
|
| 52 | + if (isset($set['langue_choisie'])){ |
|
| 53 | + $set['langue_choisie'] = 'non'; |
|
| 54 | + } |
|
| 55 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id),'',$serveur); |
|
| 56 | + if ($table_objet_sql == 'spip_rubriques') { |
|
| 57 | + include_spip('inc/rubriques'); |
|
| 58 | + calculer_langues_rubriques(); |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + return $changer_lang; |
|
| 63 | 63 | } |
@@ -15,38 +15,38 @@ discard block |
||
| 15 | 15 | // http://doc.spip.org/@action_editer_auteur_dist |
| 16 | 16 | function action_editer_auteur_dist($arg=null) { |
| 17 | 17 | |
| 18 | - if (is_null($arg)){ |
|
| 19 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 20 | - $arg = $securiser_action(); |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - |
|
| 24 | - // si id_auteur n'est pas un nombre, c'est une creation |
|
| 25 | - if (!$id_auteur = intval($arg)) { |
|
| 26 | - |
|
| 27 | - if (($id_auteur = auteur_inserer()) > 0){ |
|
| 28 | - |
|
| 29 | - # cf. GROS HACK |
|
| 30 | - # recuperer l'eventuel logo charge avant la creation |
|
| 31 | - # ils ont un id = 0-id_auteur de la session |
|
| 32 | - $id_hack = 0 - $GLOBALS['visiteur_session']['id_auteur']; |
|
| 33 | - $chercher_logo = charger_fonction('chercher_logo', 'inc'); |
|
| 34 | - if (list($logo) = $chercher_logo($id_hack, 'id_auteur', 'on')) |
|
| 35 | - rename($logo, str_replace($id_hack, $id_auteur, $logo)); |
|
| 36 | - if (list($logo) = $chercher_logo($id_hack, 'id_auteur', 'off')) |
|
| 37 | - rename($logo, str_replace($id_hack, $id_auteur, $logo)); |
|
| 38 | - } |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - // Enregistre l'envoi dans la BD |
|
| 42 | - $err = ""; |
|
| 43 | - if ($id_auteur > 0) |
|
| 44 | - $err = auteur_modifier($id_auteur); |
|
| 45 | - |
|
| 46 | - if ($err) |
|
| 47 | - spip_log("echec editeur auteur: $err",_LOG_ERREUR); |
|
| 48 | - |
|
| 49 | - return array($id_auteur,$err); |
|
| 18 | + if (is_null($arg)){ |
|
| 19 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 20 | + $arg = $securiser_action(); |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + |
|
| 24 | + // si id_auteur n'est pas un nombre, c'est une creation |
|
| 25 | + if (!$id_auteur = intval($arg)) { |
|
| 26 | + |
|
| 27 | + if (($id_auteur = auteur_inserer()) > 0){ |
|
| 28 | + |
|
| 29 | + # cf. GROS HACK |
|
| 30 | + # recuperer l'eventuel logo charge avant la creation |
|
| 31 | + # ils ont un id = 0-id_auteur de la session |
|
| 32 | + $id_hack = 0 - $GLOBALS['visiteur_session']['id_auteur']; |
|
| 33 | + $chercher_logo = charger_fonction('chercher_logo', 'inc'); |
|
| 34 | + if (list($logo) = $chercher_logo($id_hack, 'id_auteur', 'on')) |
|
| 35 | + rename($logo, str_replace($id_hack, $id_auteur, $logo)); |
|
| 36 | + if (list($logo) = $chercher_logo($id_hack, 'id_auteur', 'off')) |
|
| 37 | + rename($logo, str_replace($id_hack, $id_auteur, $logo)); |
|
| 38 | + } |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + // Enregistre l'envoi dans la BD |
|
| 42 | + $err = ""; |
|
| 43 | + if ($id_auteur > 0) |
|
| 44 | + $err = auteur_modifier($id_auteur); |
|
| 45 | + |
|
| 46 | + if ($err) |
|
| 47 | + spip_log("echec editeur auteur: $err",_LOG_ERREUR); |
|
| 48 | + |
|
| 49 | + return array($id_auteur,$err); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -56,34 +56,34 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | function auteur_inserer($source=null) { |
| 58 | 58 | |
| 59 | - // Ce qu'on va demander comme modifications |
|
| 60 | - $champs = array(); |
|
| 61 | - $champs['source'] = $source?$source:'spip'; |
|
| 62 | - |
|
| 63 | - $champs['login'] = ''; |
|
| 64 | - $champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue |
|
| 65 | - $champs['webmestre'] = 'non'; |
|
| 66 | - |
|
| 67 | - // Envoyer aux plugins |
|
| 68 | - $champs = pipeline('pre_insertion', |
|
| 69 | - array( |
|
| 70 | - 'args' => array( |
|
| 71 | - 'table' => 'spip_auteurs', |
|
| 72 | - ), |
|
| 73 | - 'data' => $champs |
|
| 74 | - ) |
|
| 75 | - ); |
|
| 76 | - $id_auteur = sql_insertq("spip_auteurs", $champs); |
|
| 77 | - pipeline('post_insertion', |
|
| 78 | - array( |
|
| 79 | - 'args' => array( |
|
| 80 | - 'table' => 'spip_auteurs', |
|
| 81 | - 'id_objet' => $id_auteur |
|
| 82 | - ), |
|
| 83 | - 'data' => $champs |
|
| 84 | - ) |
|
| 85 | - ); |
|
| 86 | - return $id_auteur; |
|
| 59 | + // Ce qu'on va demander comme modifications |
|
| 60 | + $champs = array(); |
|
| 61 | + $champs['source'] = $source?$source:'spip'; |
|
| 62 | + |
|
| 63 | + $champs['login'] = ''; |
|
| 64 | + $champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue |
|
| 65 | + $champs['webmestre'] = 'non'; |
|
| 66 | + |
|
| 67 | + // Envoyer aux plugins |
|
| 68 | + $champs = pipeline('pre_insertion', |
|
| 69 | + array( |
|
| 70 | + 'args' => array( |
|
| 71 | + 'table' => 'spip_auteurs', |
|
| 72 | + ), |
|
| 73 | + 'data' => $champs |
|
| 74 | + ) |
|
| 75 | + ); |
|
| 76 | + $id_auteur = sql_insertq("spip_auteurs", $champs); |
|
| 77 | + pipeline('post_insertion', |
|
| 78 | + array( |
|
| 79 | + 'args' => array( |
|
| 80 | + 'table' => 'spip_auteurs', |
|
| 81 | + 'id_objet' => $id_auteur |
|
| 82 | + ), |
|
| 83 | + 'data' => $champs |
|
| 84 | + ) |
|
| 85 | + ); |
|
| 86 | + return $id_auteur; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
@@ -99,55 +99,55 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | function auteur_modifier($id_auteur, $set = null, $force_update=false) { |
| 101 | 101 | |
| 102 | - include_spip('inc/modifier'); |
|
| 103 | - include_spip('inc/filtres'); |
|
| 104 | - $c = collecter_requests( |
|
| 105 | - // white list |
|
| 106 | - objet_info('auteur','champs_editables'), |
|
| 107 | - // black list |
|
| 108 | - $force_update?array():array('webmestre','pass','login'), |
|
| 109 | - // donnees eventuellement fournies |
|
| 110 | - $set |
|
| 111 | - ); |
|
| 112 | - |
|
| 113 | - if ($err = objet_modifier_champs('auteur', $id_auteur, |
|
| 114 | - array( |
|
| 115 | - 'data' => $set, |
|
| 116 | - 'nonvide' => array('nom' => _T('ecrire:item_nouvel_auteur')) |
|
| 117 | - ), |
|
| 118 | - $c)) |
|
| 119 | - return $err; |
|
| 120 | - $session = $c; |
|
| 121 | - |
|
| 122 | - $err = ''; |
|
| 123 | - if (!$force_update){ |
|
| 124 | - // Modification de statut, changement de rubrique ? |
|
| 125 | - $c = collecter_requests( |
|
| 126 | - // white list |
|
| 127 | - array( |
|
| 128 | - 'statut', 'new_login','new_pass','login','pass','webmestre','restreintes','id_parent' |
|
| 129 | - ), |
|
| 130 | - // black list |
|
| 131 | - array(), |
|
| 132 | - // donnees eventuellement fournies |
|
| 133 | - $set |
|
| 134 | - ); |
|
| 135 | - if (isset($c['new_login']) AND !isset($c['login'])) |
|
| 136 | - $c['login'] = $c['new_login']; |
|
| 137 | - if (isset($c['new_pass']) AND !isset($c['pass'])) |
|
| 138 | - $c['pass'] = $c['new_pass']; |
|
| 139 | - $err = auteur_instituer($id_auteur, $c); |
|
| 140 | - $session = array_merge($session,$c); |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - // .. mettre a jour les sessions de cet auteur |
|
| 144 | - include_spip('inc/session'); |
|
| 145 | - $session['id_auteur'] = $id_auteur; |
|
| 146 | - unset($session['new_login']); |
|
| 147 | - unset($session['new_pass']); |
|
| 148 | - actualiser_sessions($session); |
|
| 149 | - |
|
| 150 | - return $err; |
|
| 102 | + include_spip('inc/modifier'); |
|
| 103 | + include_spip('inc/filtres'); |
|
| 104 | + $c = collecter_requests( |
|
| 105 | + // white list |
|
| 106 | + objet_info('auteur','champs_editables'), |
|
| 107 | + // black list |
|
| 108 | + $force_update?array():array('webmestre','pass','login'), |
|
| 109 | + // donnees eventuellement fournies |
|
| 110 | + $set |
|
| 111 | + ); |
|
| 112 | + |
|
| 113 | + if ($err = objet_modifier_champs('auteur', $id_auteur, |
|
| 114 | + array( |
|
| 115 | + 'data' => $set, |
|
| 116 | + 'nonvide' => array('nom' => _T('ecrire:item_nouvel_auteur')) |
|
| 117 | + ), |
|
| 118 | + $c)) |
|
| 119 | + return $err; |
|
| 120 | + $session = $c; |
|
| 121 | + |
|
| 122 | + $err = ''; |
|
| 123 | + if (!$force_update){ |
|
| 124 | + // Modification de statut, changement de rubrique ? |
|
| 125 | + $c = collecter_requests( |
|
| 126 | + // white list |
|
| 127 | + array( |
|
| 128 | + 'statut', 'new_login','new_pass','login','pass','webmestre','restreintes','id_parent' |
|
| 129 | + ), |
|
| 130 | + // black list |
|
| 131 | + array(), |
|
| 132 | + // donnees eventuellement fournies |
|
| 133 | + $set |
|
| 134 | + ); |
|
| 135 | + if (isset($c['new_login']) AND !isset($c['login'])) |
|
| 136 | + $c['login'] = $c['new_login']; |
|
| 137 | + if (isset($c['new_pass']) AND !isset($c['pass'])) |
|
| 138 | + $c['pass'] = $c['new_pass']; |
|
| 139 | + $err = auteur_instituer($id_auteur, $c); |
|
| 140 | + $session = array_merge($session,$c); |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + // .. mettre a jour les sessions de cet auteur |
|
| 144 | + include_spip('inc/session'); |
|
| 145 | + $session['id_auteur'] = $id_auteur; |
|
| 146 | + unset($session['new_login']); |
|
| 147 | + unset($session['new_pass']); |
|
| 148 | + actualiser_sessions($session); |
|
| 149 | + |
|
| 150 | + return $err; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | * @return string |
| 166 | 166 | */ |
| 167 | 167 | function auteur_associer($id_auteur,$objets, $qualif = null){ |
| 168 | - include_spip('action/editer_liens'); |
|
| 169 | - return objet_associer(array('auteur'=>$id_auteur), $objets, $qualif); |
|
| 168 | + include_spip('action/editer_liens'); |
|
| 169 | + return objet_associer(array('auteur'=>$id_auteur), $objets, $qualif); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | * @return string |
| 178 | 178 | */ |
| 179 | 179 | function auteur_referent($id_auteur,$c){ |
| 180 | - return auteur_associer($id_auteur,$c); |
|
| 180 | + return auteur_associer($id_auteur,$c); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -192,8 +192,8 @@ discard block |
||
| 192 | 192 | * @return string |
| 193 | 193 | */ |
| 194 | 194 | function auteur_dissocier($id_auteur,$objets){ |
| 195 | - include_spip('action/editer_liens'); |
|
| 196 | - return objet_dissocier(array('auteur'=>$id_auteur), $objets); |
|
| 195 | + include_spip('action/editer_liens'); |
|
| 196 | + return objet_dissocier(array('auteur'=>$id_auteur), $objets); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
@@ -210,8 +210,8 @@ discard block |
||
| 210 | 210 | * @return bool|int |
| 211 | 211 | */ |
| 212 | 212 | function auteur_qualifier($id_auteur,$objets,$qualif){ |
| 213 | - include_spip('action/editer_liens'); |
|
| 214 | - return objet_qualifier_liens(array('auteur'=>$id_auteur), $objets, $qualif); |
|
| 213 | + include_spip('action/editer_liens'); |
|
| 214 | + return objet_qualifier_liens(array('auteur'=>$id_auteur), $objets, $qualif); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
@@ -224,114 +224,114 @@ discard block |
||
| 224 | 224 | * @return bool|string |
| 225 | 225 | */ |
| 226 | 226 | function auteur_instituer($id_auteur, $c, $force_webmestre = false) { |
| 227 | - if (!$id_auteur=intval($id_auteur)) |
|
| 228 | - return false; |
|
| 229 | - $erreurs = array(); // contiendra les differentes erreurs a traduire par _T() |
|
| 230 | - $champs = array(); |
|
| 231 | - |
|
| 232 | - // les memoriser pour les faire passer dans le pipeline pre_edition |
|
| 233 | - if (isset($c['login']) AND strlen($c['login'])) |
|
| 234 | - $champs['login'] = $c['login']; |
|
| 235 | - if (isset($c['pass']) AND strlen($c['pass'])) |
|
| 236 | - $champs['pass'] = $c['pass']; |
|
| 237 | - |
|
| 238 | - $statut = $statut_ancien = sql_getfetsel('statut','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 227 | + if (!$id_auteur=intval($id_auteur)) |
|
| 228 | + return false; |
|
| 229 | + $erreurs = array(); // contiendra les differentes erreurs a traduire par _T() |
|
| 230 | + $champs = array(); |
|
| 231 | + |
|
| 232 | + // les memoriser pour les faire passer dans le pipeline pre_edition |
|
| 233 | + if (isset($c['login']) AND strlen($c['login'])) |
|
| 234 | + $champs['login'] = $c['login']; |
|
| 235 | + if (isset($c['pass']) AND strlen($c['pass'])) |
|
| 236 | + $champs['pass'] = $c['pass']; |
|
| 237 | + |
|
| 238 | + $statut = $statut_ancien = sql_getfetsel('statut','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 239 | 239 | |
| 240 | - if (isset($c['statut']) |
|
| 241 | - AND (autoriser('modifier', 'auteur', $id_auteur,null, array('statut' => $c['statut'])))) |
|
| 242 | - $statut = $champs['statut'] = $c['statut']; |
|
| 243 | - |
|
| 244 | - // Restreindre avant de declarer l'auteur |
|
| 245 | - // (section critique sur les droits) |
|
| 246 | - if ($c['id_parent']) { |
|
| 247 | - if (is_array($c['restreintes'])) |
|
| 248 | - $c['restreintes'][] = $c['id_parent']; |
|
| 249 | - else |
|
| 250 | - $c['restreintes'] = array($c['id_parent']); |
|
| 251 | - } |
|
| 252 | - |
|
| 253 | - if (isset($c['webmestre']) |
|
| 254 | - AND ($force_webmestre OR autoriser('modifier', 'auteur', $id_auteur,null, array('webmestre' => '?')))) |
|
| 255 | - $champs['webmestre'] = $c['webmestre']=='oui'?'oui':'non'; |
|
| 240 | + if (isset($c['statut']) |
|
| 241 | + AND (autoriser('modifier', 'auteur', $id_auteur,null, array('statut' => $c['statut'])))) |
|
| 242 | + $statut = $champs['statut'] = $c['statut']; |
|
| 243 | + |
|
| 244 | + // Restreindre avant de declarer l'auteur |
|
| 245 | + // (section critique sur les droits) |
|
| 246 | + if ($c['id_parent']) { |
|
| 247 | + if (is_array($c['restreintes'])) |
|
| 248 | + $c['restreintes'][] = $c['id_parent']; |
|
| 249 | + else |
|
| 250 | + $c['restreintes'] = array($c['id_parent']); |
|
| 251 | + } |
|
| 252 | + |
|
| 253 | + if (isset($c['webmestre']) |
|
| 254 | + AND ($force_webmestre OR autoriser('modifier', 'auteur', $id_auteur,null, array('webmestre' => '?')))) |
|
| 255 | + $champs['webmestre'] = $c['webmestre']=='oui'?'oui':'non'; |
|
| 256 | 256 | |
| 257 | - // Envoyer aux plugins |
|
| 258 | - $champs = pipeline('pre_edition', |
|
| 259 | - array( |
|
| 260 | - 'args' => array( |
|
| 261 | - 'table' => 'spip_auteurs', |
|
| 262 | - 'id_objet' => $id_auteur, |
|
| 263 | - 'action' => 'instituer', |
|
| 264 | - 'statut_ancien' => $statut_ancien, |
|
| 265 | - ), |
|
| 266 | - 'data' => $champs |
|
| 267 | - ) |
|
| 268 | - ); |
|
| 257 | + // Envoyer aux plugins |
|
| 258 | + $champs = pipeline('pre_edition', |
|
| 259 | + array( |
|
| 260 | + 'args' => array( |
|
| 261 | + 'table' => 'spip_auteurs', |
|
| 262 | + 'id_objet' => $id_auteur, |
|
| 263 | + 'action' => 'instituer', |
|
| 264 | + 'statut_ancien' => $statut_ancien, |
|
| 265 | + ), |
|
| 266 | + 'data' => $champs |
|
| 267 | + ) |
|
| 268 | + ); |
|
| 269 | 269 | |
| 270 | - if (is_array($c['restreintes']) |
|
| 271 | - AND autoriser('modifier', 'auteur', $id_auteur, NULL, array('restreint'=>$c['restreintes']))) { |
|
| 272 | - $rubriques = array_map('intval',$c['restreintes']); |
|
| 273 | - $rubriques = array_unique($rubriques); |
|
| 274 | - $rubriques = array_diff($rubriques,array(0)); |
|
| 275 | - auteur_dissocier($id_auteur, array('rubrique'=>'*')); |
|
| 276 | - auteur_associer($id_auteur,array('rubrique'=>$rubriques)); |
|
| 277 | - } |
|
| 278 | - |
|
| 279 | - $flag_ecrire_acces = false; |
|
| 280 | - // commencer par traiter les cas particuliers des logins et pass |
|
| 281 | - // avant les autres ecritures en base |
|
| 282 | - if (isset($champs['login']) OR isset($champs['pass'])){ |
|
| 283 | - $auth_methode = sql_getfetsel('source','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 284 | - include_spip('inc/auth'); |
|
| 285 | - if (isset($champs['login']) AND strlen($champs['login'])) |
|
| 286 | - if (!auth_modifier_login($auth_methode, $champs['login'], $id_auteur)) |
|
| 287 | - $erreurs[] = 'ecrire:impossible_modifier_login_auteur'; |
|
| 288 | - if (isset($champs['pass']) AND strlen($champs['pass'])){ |
|
| 289 | - $champs['login'] = sql_getfetsel('login','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 290 | - if (!auth_modifier_pass($auth_methode, $champs['login'], $champs['pass'], $id_auteur)) |
|
| 291 | - $erreurs[] = 'ecrire:impossible_modifier_pass_auteur'; |
|
| 292 | - } |
|
| 293 | - unset($champs['login']); |
|
| 294 | - unset($champs['pass']); |
|
| 295 | - $flag_ecrire_acces = true; |
|
| 296 | - } |
|
| 297 | - |
|
| 298 | - if (!count($champs)) return implode(' ', array_map('_T', $erreurs)); |
|
| 299 | - sql_updateq('spip_auteurs', $champs , 'id_auteur='.$id_auteur); |
|
| 300 | - |
|
| 301 | - // .. mettre a jour les fichiers .htpasswd et .htpasswd-admin |
|
| 302 | - if ($flag_ecrire_acces |
|
| 303 | - OR isset($champs['statut']) |
|
| 304 | - ) { |
|
| 305 | - include_spip('inc/acces'); |
|
| 306 | - ecrire_acces(); |
|
| 307 | - } |
|
| 308 | - |
|
| 309 | - // Invalider les caches |
|
| 310 | - include_spip('inc/invalideur'); |
|
| 311 | - suivre_invalideur("id='auteur/$id_auteur'"); |
|
| 270 | + if (is_array($c['restreintes']) |
|
| 271 | + AND autoriser('modifier', 'auteur', $id_auteur, NULL, array('restreint'=>$c['restreintes']))) { |
|
| 272 | + $rubriques = array_map('intval',$c['restreintes']); |
|
| 273 | + $rubriques = array_unique($rubriques); |
|
| 274 | + $rubriques = array_diff($rubriques,array(0)); |
|
| 275 | + auteur_dissocier($id_auteur, array('rubrique'=>'*')); |
|
| 276 | + auteur_associer($id_auteur,array('rubrique'=>$rubriques)); |
|
| 277 | + } |
|
| 278 | + |
|
| 279 | + $flag_ecrire_acces = false; |
|
| 280 | + // commencer par traiter les cas particuliers des logins et pass |
|
| 281 | + // avant les autres ecritures en base |
|
| 282 | + if (isset($champs['login']) OR isset($champs['pass'])){ |
|
| 283 | + $auth_methode = sql_getfetsel('source','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 284 | + include_spip('inc/auth'); |
|
| 285 | + if (isset($champs['login']) AND strlen($champs['login'])) |
|
| 286 | + if (!auth_modifier_login($auth_methode, $champs['login'], $id_auteur)) |
|
| 287 | + $erreurs[] = 'ecrire:impossible_modifier_login_auteur'; |
|
| 288 | + if (isset($champs['pass']) AND strlen($champs['pass'])){ |
|
| 289 | + $champs['login'] = sql_getfetsel('login','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 290 | + if (!auth_modifier_pass($auth_methode, $champs['login'], $champs['pass'], $id_auteur)) |
|
| 291 | + $erreurs[] = 'ecrire:impossible_modifier_pass_auteur'; |
|
| 292 | + } |
|
| 293 | + unset($champs['login']); |
|
| 294 | + unset($champs['pass']); |
|
| 295 | + $flag_ecrire_acces = true; |
|
| 296 | + } |
|
| 297 | + |
|
| 298 | + if (!count($champs)) return implode(' ', array_map('_T', $erreurs)); |
|
| 299 | + sql_updateq('spip_auteurs', $champs , 'id_auteur='.$id_auteur); |
|
| 300 | + |
|
| 301 | + // .. mettre a jour les fichiers .htpasswd et .htpasswd-admin |
|
| 302 | + if ($flag_ecrire_acces |
|
| 303 | + OR isset($champs['statut']) |
|
| 304 | + ) { |
|
| 305 | + include_spip('inc/acces'); |
|
| 306 | + ecrire_acces(); |
|
| 307 | + } |
|
| 308 | + |
|
| 309 | + // Invalider les caches |
|
| 310 | + include_spip('inc/invalideur'); |
|
| 311 | + suivre_invalideur("id='auteur/$id_auteur'"); |
|
| 312 | 312 | |
| 313 | - // Pipeline |
|
| 314 | - pipeline('post_edition', |
|
| 315 | - array( |
|
| 316 | - 'args' => array( |
|
| 317 | - 'table' => 'spip_auteurs', |
|
| 318 | - 'id_objet' => $id_auteur, |
|
| 319 | - 'action' => 'instituer', |
|
| 320 | - 'statut_ancien' => $statut_ancien, |
|
| 321 | - ), |
|
| 322 | - 'data' => $champs |
|
| 323 | - ) |
|
| 324 | - ); |
|
| 325 | - |
|
| 326 | - |
|
| 327 | - // Notifications |
|
| 328 | - if ($notifications = charger_fonction('notifications', 'inc')) { |
|
| 329 | - $notifications('instituerauteur', $id_auteur, |
|
| 330 | - array('statut' => $statut, 'statut_ancien' => $statut_ancien) |
|
| 331 | - ); |
|
| 332 | - } |
|
| 333 | - |
|
| 334 | - return implode(' ', array_map('_T', $erreurs)); |
|
| 313 | + // Pipeline |
|
| 314 | + pipeline('post_edition', |
|
| 315 | + array( |
|
| 316 | + 'args' => array( |
|
| 317 | + 'table' => 'spip_auteurs', |
|
| 318 | + 'id_objet' => $id_auteur, |
|
| 319 | + 'action' => 'instituer', |
|
| 320 | + 'statut_ancien' => $statut_ancien, |
|
| 321 | + ), |
|
| 322 | + 'data' => $champs |
|
| 323 | + ) |
|
| 324 | + ); |
|
| 325 | + |
|
| 326 | + |
|
| 327 | + // Notifications |
|
| 328 | + if ($notifications = charger_fonction('notifications', 'inc')) { |
|
| 329 | + $notifications('instituerauteur', $id_auteur, |
|
| 330 | + array('statut' => $statut, 'statut_ancien' => $statut_ancien) |
|
| 331 | + ); |
|
| 332 | + } |
|
| 333 | + |
|
| 334 | + return implode(' ', array_map('_T', $erreurs)); |
|
| 335 | 335 | |
| 336 | 336 | } |
| 337 | 337 | |
@@ -339,17 +339,17 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | |
| 341 | 341 | function insert_auteur($source=null) { |
| 342 | - return auteur_inserer($source); |
|
| 342 | + return auteur_inserer($source); |
|
| 343 | 343 | } |
| 344 | 344 | function auteurs_set($id_auteur, $set = null) { |
| 345 | - return auteur_modifier($id_auteur,$set); |
|
| 345 | + return auteur_modifier($id_auteur,$set); |
|
| 346 | 346 | } |
| 347 | 347 | function instituer_auteur($id_auteur, $c, $force_webmestre = false) { |
| 348 | - return auteur_instituer($id_auteur,$c,$force_webmestre); |
|
| 348 | + return auteur_instituer($id_auteur,$c,$force_webmestre); |
|
| 349 | 349 | } |
| 350 | 350 | // http://doc.spip.org/@revision_auteur |
| 351 | 351 | function revision_auteur($id_auteur, $c=false) { |
| 352 | - return auteur_modifier($id_auteur,$c); |
|
| 352 | + return auteur_modifier($id_auteur,$c); |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | ?> |