* Copyright (C) 2003 Éric Seigne * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ */ require("./pre.inc.php"); if (!$user->admin) accessforbidden(); llxHeader(); print_titre("Configuration du lien vers le calendrier"); print '
'; $def = array(); // positionne la variable pour le test d'affichage de l'icone if ($action == 'save') { if(trim($phpwebcalendar_pass) == trim($phpwebcalendar_pass2)) { $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_URL', value='".$phpwebcalendar_url."', visible=0"; $sql1 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_HOST', value='".$phpwebcalendar_host."', visible=0"; $sql2 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_DBNAME', value='".$phpwebcalendar_dbname."', visible=0"; $sql3 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_USER', value='".$phpwebcalendar_user."', visible=0"; $sql4 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_PASS', value='".$phpwebcalendar_pass."', visible=0"; if ($db->query($sql) && $db->query($sql1) && $db->query($sql2) && $db->query($sql3) && $db->query($sql4)) { // la constante qui a été lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage cohérent print "

ok bien enregistré

\n"; print "

dans quelques jours je rajoute un test de connexion à la base de données de webcal pour être certain que tout est OK

\n"; define("PHPWEBCALENDAR_URL", $phpwebcalendar_url); } else print "erreur d'enregistement !"; } else { print "

erreur, votre mot de passe n'est pas vérifié, merci de retourner à la page de saisie pour corriger votre erreur

\n"; } } /* * Affichage du formulaire de saisie */ print "\n
\n"; clearstatcache(); print "
Paramètre Valeur
Adresse URL d'accès au calendrier
Serveur où la base du calendrier est hébergée
Nom de la base de données
Identifiant d'accès à la base
Mot de passe d'accès à la base
Mot de passe (vérification)
\n"; /* * * */ $db->close(); llxFooter(); ?>