[30] | 1 | <?php |
---|
| 2 | |
---|
| 3 | /***************************************************************************\ |
---|
| 4 | * SPIP, Systeme de publication pour l'internet * |
---|
| 5 | * * |
---|
| 6 | * Copyright (c) 2001-2006 * |
---|
| 7 | * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
---|
| 8 | * * |
---|
| 9 | * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
---|
| 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
---|
| 11 | \***************************************************************************/ |
---|
| 12 | |
---|
| 13 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
| 14 | |
---|
| 15 | include_spip('inc/filtres'); |
---|
| 16 | include_spip('base/abstract_sql'); |
---|
| 17 | |
---|
| 18 | // http://doc.spip.org/@action_instituer_groupe_mots_dist |
---|
| 19 | function action_instituer_groupe_mots_dist() |
---|
| 20 | { |
---|
| 21 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
---|
| 22 | $securiser_action(); |
---|
| 23 | |
---|
| 24 | $arg = _request('arg'); |
---|
| 25 | |
---|
| 26 | if (!preg_match(",^(-?\d+)$,", $arg, $r)) { |
---|
| 27 | spip_log("action_instituer_groupe_mots_dist $arg pas compris"); |
---|
| 28 | } else action_instituer_groupe_mots_post($r); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | // http://doc.spip.org/@action_instituer_groupe_mots_post |
---|
| 33 | function action_instituer_groupe_mots_post($r) |
---|
| 34 | { |
---|
| 35 | global $acces_comite, $acces_forum, $acces_minirezo, $new, $articles, $breves, $change_type, $descriptif, $id_groupe, $obligatoire, $rubriques, $syndic, $evenements, $pim_agenda, $texte, $unseul; |
---|
| 36 | |
---|
| 37 | $id_groupe = $r[1]; |
---|
| 38 | |
---|
| 39 | if ($id_groupe < 0){ |
---|
| 40 | spip_query("DELETE FROM spip_groupes_mots WHERE id_groupe=" . (0- $id_groupe)); |
---|
| 41 | } else { |
---|
| 42 | $change_type = (corriger_caracteres($change_type)); |
---|
| 43 | $texte = (corriger_caracteres($texte)); |
---|
| 44 | $descriptif = (corriger_caracteres($descriptif)); |
---|
| 45 | |
---|
| 46 | if ($id_groupe) { // modif groupe |
---|
| 47 | spip_query("UPDATE spip_mots SET type=" . _q($change_type) . " WHERE id_groupe=$id_groupe"); |
---|
| 48 | |
---|
| 49 | spip_query("UPDATE spip_groupes_mots SET titre=" . _q($change_type) . ", texte=" . _q($texte) . ", descriptif=" . _q($descriptif) . ", unseul=" . _q($unseul) . ", obligatoire=" . _q($obligatoire) . ", articles=" . _q($articles) . ", breves=" . _q($breves) . ", rubriques=" . _q($rubriques) . ", syndic=" . _q($syndic) . ", evenements=" . _q($evenements) . ", minirezo=" . _q($acces_minirezo) . ", comite=" . _q($acces_comite) . ", forum=" . _q($acces_forum) . " WHERE id_groupe=$id_groupe"); |
---|
| 50 | |
---|
| 51 | } else { // creation groupe |
---|
| 52 | spip_abstract_insert('spip_groupes_mots', "(titre, texte, descriptif, unseul, obligatoire, articles, breves, rubriques, syndic, evenements, minirezo, comite, forum)", "(" . _q($change_type) . ", " . _q($texte) . " , " . _q($descriptif) . " , " . _q($unseul) . " , " . _q($obligatoire) . " , " . _q($articles) . " ," . _q($breves) . " , " . _q($rubriques) . " , " . _q($syndic) . " , " . _q($evenements) . " , " . _q($acces_minirezo) . " , " . _q($acces_comite) . " , " . _q($acces_forum) . " )"); |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | } |
---|
| 56 | ?> |
---|