From 2e920a5e56b7358b0fd988d3b8b35be0e2e2602a Mon Sep 17 00:00:00 2001 From: pascalc Date: Mon, 4 Mar 2013 19:46:06 +0100 Subject: [PATCH] =?UTF-8?q?enl=C3=A8ve=20les=20appels=20=C3=A0=20get=5Fser?= =?UTF-8?q?ver=5Fname()=20partout=20sauf=20dans=20un=20appel=20=C3=A0=20se?= =?UTF-8?q?ndMail(),=20r=C3=A9=C3=A9criture=20de=20la=20fonction=20pour=20?= =?UTF-8?q?cet=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminstuds.php | 244 ++++++++++++++++++++++++------------------------- bandeaux.php | 79 ++++++++-------- exportpdf.php | 10 +- fonctions.php | 48 ++++------ index.php | 12 +-- 5 files changed, 190 insertions(+), 203 deletions(-) diff --git a/adminstuds.php b/adminstuds.php index bd7adce..019f791 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -10,10 +10,10 @@ //Ce logiciel est régi par la licence CeCILL-B soumise au droit français et //respectant les principes de diffusion des logiciels libres. Vous pouvez //utiliser, modifier et/ou redistribuer ce programme sous les conditions -//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA //sur le site "http://www.cecill.info". // -//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez //pris connaissance de la licence CeCILL-B, et que vous en avez accepté les //termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. // @@ -26,10 +26,10 @@ //borghesi@unistra.fr // //This software is governed by the CeCILL-B license under French law and -//abiding by the rules of distribution of free software. You can use, +//abiding by the rules of distribution of free software. You can use, //modify and/ or redistribute the software under the terms of the CeCILL-B //license as circulated by CEA, CNRS and INRIA at the following URL -//"http://www.cecill.info". +//"http://www.cecill.info". // //The fact that you are presently reading this means that you have had //knowledge of the CeCILL-B license and that you accept its terms. You can @@ -62,12 +62,12 @@ if (preg_match(";[\w\d]{24};i", $numsondageadmin)) { $sql = 'SELECT * FROM sondage WHERE id_sondage_admin = '.$connect->Param('numsondageadmin'); $sql = $connect->Prepare($sql); $sondage = $connect->Execute($sql, array($numsondageadmin)); - + if ($sondage !== false) { $sql = 'SELECT * FROM sujet_studs WHERE id_sondage = '.$connect->Param('numsondage'); $sql = $connect->Prepare($sql); $sujets = $connect->Execute($sql, array($numsondage)); - + $sql = 'SELECT * FROM user_studs WHERE id_sondage = '.$connect->Param('numsondage').' order by id_users'; $sql = $connect->Prepare($sql); $user_studs = $connect->Execute($sql, array($numsondage)); @@ -82,8 +82,8 @@ if (!$sondage || $sondage->RecordCount() != 1){ logo(); bandeau_tete(); bandeau_titre(_("Error!")); - - + + echo '
'."\n"; print "

" . _("This poll doesn't exist !") . "



"."\n"; print "" . _("Back to the homepage of ") . " ".NOMAPPLICATION.". "."\n"; @@ -91,7 +91,7 @@ if (!$sondage || $sondage->RecordCount() != 1){ echo '
'."\n"; # sur_bandeau_pied(); bandeau_pied(); - + echo''."\n"; echo ''."\n"; die(); @@ -112,7 +112,7 @@ if (isset($_POST["boutonnouveautitre"]) || isset($_POST["boutonnouveautitre_x"]) $nouveautitre = htmlentities(html_entity_decode($_POST['nouveautitre'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); $sql = 'UPDATE sondage SET titre = '.$connect->Param('nouveautitre').' WHERE id_sondage = '.$connect->Param('numsondage'); $sql = $connect->Prepare($sql); - + //envoi du mail pour prevenir l'admin de sondage if ($connect->Execute($sql, array($nouveautitre, $numsondage))) { sendEmail( $adresseadmin, @@ -123,18 +123,18 @@ if (isset($_POST["boutonnouveautitre"]) || isset($_POST["boutonnouveautitre_x"]) } } } - + // si le bouton est activé, quelque soit la valeur du champ textarea if (isset($_POST["boutonnouveauxcommentaires"]) || isset($_POST["boutonnouveauxcommentaires_x"])) { if(issetAndNoEmpty('nouveautitre') === false) { $err |= COMMENT_EMPTY; } else { $commentaires = htmlentities(html_entity_decode($_POST['nouveauxcommentaires'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); - + //modification de la base SQL avec les nouveaux commentaires $sql = 'UPDATE sondage SET commentaires = '.$connect->Param('commentaires').' WHERE id_sondage = '.$connect->Param('numsondage'); $sql = $connect->Prepare($sql); - + if ($connect->Execute($sql, array($commentaires, $numsondage))) { //envoi du mail pour prevenir l'admin de sondage sendEmail( $adresseadmin, @@ -152,11 +152,11 @@ if (isset($_POST["boutonnouvelleadresse"]) || isset($_POST["boutonnouvelleadress $err |= INVALID_EMAIL; } else { $nouvelleadresse = htmlentities(html_entity_decode($_POST['nouvelleadresse'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); - + //modification de la base SQL avec la nouvelle adresse $sql = 'UPDATE sondage SET mail_admin = '.$connect->Param('nouvelleadresse').' WHERE id_sondage = '.$connect->Param('numsondage'); $sql = $connect->Prepare($sql); - + if ($connect->Execute($sql, array($nouvelleadresse, $numsondage))) { //envoi du mail pour prevenir l'admin de sondage sendEmail( $_POST['nouvelleadresse'], @@ -180,24 +180,24 @@ if (isset($_POST["ajoutsujet"]) || isset($_POST["ajoutsujet_x"])) { bandeau_tete(); bandeau_titre(_("Make your polls")); sous_bandeau(); - + //on recupere les données et les sujets du sondage - + echo '
'."\n"; - + echo '
'."\n"; - + echo '
'."\n"; echo "

" . _("Column's adding") . "



"."\n"; - + if ($dsondage->format=="A"||$dsondage->format=="A+"){ echo _("Add a new column") .' :
'; echo '

'; echo ''."\n"; echo ''."\n"; } else { - //ajout d'une date avec creneau horaire + //ajout d'une date avec creneau horaire echo _("You can add a new scheduling date to your poll.
If you just want to add a new hour to an existant date, put the same date and choose a new hour.") .'

'."\n"; echo _("Add a date") .' :

'."\n"; echo ''."\n"; - + echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; - + //affichage des mois $colspan = 1; for ($i = 0; $i < count($toutsujet); $i++) { $current = $toutsujet[$i]; - + if (strpos($toutsujet[$i], '@') !== false) { $current = substr($toutsujet[$i], 0, strpos($toutsujet[$i], '@')); } - + if (isset($toutsujet[$i+1]) && strpos($toutsujet[$i+1], '@') !== false) { $next = substr($toutsujet[$i+1], 0, strpos($toutsujet[$i+1], '@')); } elseif (isset($toutsujet[$i+1])) { $next = $toutsujet[$i+1]; } - + if (isset($toutsujet[$i+1]) && strftime("%B", $current) == strftime("%B", $next) && strftime("%Y", $current) == strftime("%Y", $next)){ $colspan++; } else { @@ -834,32 +834,32 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") { } else { echo ''.strftime("%B",$current).''."\n"; } - + $colspan=1; } } - + echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; - + //affichage des jours $colspan = 1; for ($i = 0; $i < count($toutsujet); $i++) { $current = $toutsujet[$i]; - + if (strpos($toutsujet[$i], '@') !== false) { $current = substr($toutsujet[$i], 0, strpos($toutsujet[$i], '@')); } - + if (isset($toutsujet[$i+1]) && strpos($toutsujet[$i+1], '@') !== false) { $next = substr($toutsujet[$i+1], 0, strpos($toutsujet[$i+1], '@')); } elseif (isset($toutsujet[$i+1])) { $next = $toutsujet[$i+1]; } - + if (isset($toutsujet[$i+1]) && strftime("%a %e",$current)==strftime("%a %e",$next)&&strftime("%B",$current)==strftime("%B",$next)){ $colspan++; } else { @@ -868,20 +868,20 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") { } else { echo ''.strftime("%a %e",$current).''."\n"; } - + $colspan=1; } } - + echo ''."\n"; echo ''."\n"; - + //affichage des horaires if (strpos($dsujet->sujet,'@') !== false) { echo ''."\n"; echo ''."\n"; echo ''."\n"; - + for ($i = 0; isset($toutsujet[$i]); $i++) { $heures=explode("@", $toutsujet[$i]); if (isset($heures[1])) { @@ -890,22 +890,22 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") { echo ''."\n"; } } - + echo ''."\n"; echo ''."\n"; } } else { $toutsujet=str_replace("°","'",$toutsujet); - + //affichage des sujets du sondage echo ''."\n"; echo ''."\n"; echo ''."\n"; - + for ($i = 0; isset($toutsujet[$i]); $i++) { echo ''.stripslashes($toutsujet[$i]).''."\n"; } - + echo ''."\n"; echo ''."\n"; } @@ -917,14 +917,14 @@ $compteur = 0; while ($data = $user_studs->FetchNextObject(false)) { $ensemblereponses = $data->reponses; - + echo ''."\n"; echo ''."\n"; - + //affichage du nom $nombase=str_replace("°","'",$data->nom); echo ''.stripslashes($nombase).''."\n"; - + //si la ligne n'est pas a changer, on affiche les données if (!$testligneamodifier) { for ($k = 0; $k < $nbcolonnes; $k++) { @@ -940,7 +940,7 @@ while ($data = $user_studs->FetchNextObject(false)) { } } } else { //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs - + //si c'est bien la ligne a modifier on met les checkbox if ($compteur == "$ligneamodifier") { for ($j = 0; $j < $nbcolonnes; $j++) { @@ -954,7 +954,7 @@ while ($data = $user_studs->FetchNextObject(false)) { } else { //sinon on affiche les lignes normales for ($k = 0; $k < $nbcolonnes; $k++) { $car = substr($ensemblereponses, $k, 1); - + if ($car == "1") { echo 'OK'."\n"; if (isset($somme[$k]) === false) { @@ -967,12 +967,12 @@ while ($data = $user_studs->FetchNextObject(false)) { } } } - + //a la fin de chaque ligne se trouve les boutons modifier if (!$testligneamodifier=="true") { echo ''."\n"; } - + //demande de confirmation pour modification de ligne for ($i = 0; $i < $nblignes; $i++) { if (isset($_POST["modifierligne$i"]) || isset($_POST['modifierligne'.$i.'_x'])) { @@ -981,7 +981,7 @@ while ($data = $user_studs->FetchNextObject(false)) { } } } - + $compteur++; echo ''."\n"; } @@ -1009,7 +1009,7 @@ for ($i = 0; $i < $nbcolonnes + 1; $i++) { if ($i == "0") { $meilleurecolonne = $somme[$i]; } - + if (isset($somme[$i]) && $somme[$i] > $meilleurecolonne){ $meilleurecolonne = $somme[$i]; } @@ -1028,11 +1028,11 @@ for ($i = 0; $i < $nbcolonnes; $i++) { } else { $affichesomme = ''; } - + if ($affichesomme == "") { $affichesomme = "0"; } - + if (isset($somme[$i]) === true && isset($meilleurecolonne) === true && $somme[$i] == $meilleurecolonne){ echo ''.$affichesomme.''."\n"; } else { @@ -1098,10 +1098,10 @@ $meilleursujet = ''; for ($i = 0; $i < $nbcolonnes; $i++) { if (isset($somme[$i]) === true && isset($meilleurecolonne) === true && $somme[$i] == $meilleurecolonne){ $meilleursujet.=", "; - + if ($dsondage->format == "D" || $dsondage->format == "D+") { $meilleursujetexport = $toutsujet[$i]; - + if (strpos($toutsujet[$i], '@') !== false) { $toutsujetdate = explode("@", $toutsujet[$i]); if ($_SESSION["langue"] == "EN") { @@ -1119,7 +1119,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) { } else { $meilleursujet.=$toutsujet[$i]; } - + $compteursujet++; } } @@ -1181,13 +1181,13 @@ $sql = $connect->Prepare($sql); $comment_user = $connect->Execute($sql, array($numsondage)); if ($comment_user->RecordCount() != 0) { print "
" . _("Comments") . " :
\n"; - + $i = 0; while ( $dcomment=$comment_user->FetchNextObject(false)) { print " ". stripslashes($dcomment->usercomment) ." : ".stripslashes($dcomment->comment) ."
"; $i++; } - + echo '
'; } @@ -1208,7 +1208,7 @@ echo _("Remove your poll") .' : '."\n"; if ($dsondage->format == "D" || $dsondage->format == "D+") { - echo ''."\n"; + echo ''."\n"; echo _("Generate the convocation letter (.PDF), choose the place to meet and validate") .'
'; echo ''; echo ''; diff --git a/bandeaux.php b/bandeaux.php index 7f2af3e..bcd2b20 100644 --- a/bandeaux.php +++ b/bandeaux.php @@ -1,4 +1,4 @@ - '."\n";; - echo ''."\n"; - include_once($_SERVER['DOCUMENT_ROOT']."/framanav/nav.inc.html"); - echo ' '."\n"; + echo "\n".' '."\n";; + echo ''."\n"; + include_once($_SERVER['DOCUMENT_ROOT']."/framanav/nav.inc.html"); + echo ' '."\n"; } } @@ -73,7 +72,7 @@ function gAnalytics() { function logo () { if(defined('LOGOBANDEAU')) { - echo ''."\n"; + echo ''."\n"; } } @@ -83,11 +82,11 @@ function bandeau_tete() { if ( IMAGE_TITRE ) { - echo '
'.NOMAPPLICATION.'
'."\n"; + echo '
'.NOMAPPLICATION.'
'."\n"; } else { - echo ''."\n"; + echo ''."\n"; } ; @@ -104,12 +103,12 @@ function bandeau_titre($titre) function liste_lang() { global $ALLOWED_LANGUAGES; - + $str = ''; foreach ($ALLOWED_LANGUAGES as $k => $v ) { $str .= '' . $v . '' . "\n" ; } - + return $str; } @@ -118,12 +117,12 @@ function liste_lang() function sous_bandeau() { /*echo '
' . - ''. _("Home") .'' . + ''. _("Home") .'' . ''. _("Example") .'' . - ''. _("Contact") .'' . - //''. _("Sources") .'' . //not implemented - ''. _("About") .'' . - ''. _("Admin") .'' . + ''. _("Contact") .'' . + //''. _("Sources") .'' . //not implemented + ''. _("About") .'' . + ''. _("Admin") .'' . '' . liste_lang() . ''. '
' . "\n";*/ @@ -133,25 +132,25 @@ function sous_bandeau() function sous_bandeau_admin() { echo '
' . - ''. _("Home") .''; - + ''. _("Home") .''; + if(is_readable('logs_studs.txt')) { - echo ''. _("Logs") .''; + echo ''. _("Logs") .''; } - - echo ''. _("Cleaning") .'' . + + echo ''. _("Cleaning") .'' . '' . liste_lang() . ''. '
'."\n"; - - gAnalytics(); + + gAnalytics(); } function sous_bandeau_choix() { /*echo ''."\n";*/ } @@ -168,16 +167,16 @@ function bandeau_pied() //echo '
'. _("Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009") .'
'."\n"; echo '
 
'; echo '
' . - ''. _("Home") .'' . + ''. _("Home") .'' . ''. _("Example") .'' . - ''. _("Contact") .'' . - //''. _("Sources") .'' . //not implemented - ''. _("About") .'' . - //''. _("Admin") .'' . + ''. _("Contact") .'' . + //''. _("Sources") .'' . //not implemented + ''. _("About") .'' . + //''. _("Admin") .'' . '' . liste_lang() . ''. '
' . "\n"; - gAnalytics(); + gAnalytics(); } @@ -187,14 +186,14 @@ function bandeau_pied_mobile() '
'. _("Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009") .'
'."\n";*/ echo '
 
'; echo '
' . - ''. _("Home") .'' . + ''. _("Home") .'' . ''. _("Example") .'' . - ''. _("Contact") .'' . - //''. _("Sources") .'' . //not implemented - ''. _("About") .'' . - //''. _("Admin") .'' . + ''. _("Contact") .'' . + //''. _("Sources") .'' . //not implemented + ''. _("About") .'' . + //''. _("Admin") .'' . '' . liste_lang() . ''. '
' . "\n"; - gAnalytics(); + gAnalytics(); } diff --git a/exportpdf.php b/exportpdf.php index 68d5edf..2f37f7e 100644 --- a/exportpdf.php +++ b/exportpdf.php @@ -10,10 +10,10 @@ //Ce logiciel est régi par la licence CeCILL-B soumise au droit français et //respectant les principes de diffusion des logiciels libres. Vous pouvez //utiliser, modifier et/ou redistribuer ce programme sous les conditions -//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA //sur le site "http://www.cecill.info". // -//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez //pris connaissance de la licence CeCILL-B, et que vous en avez accepté les //termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. // @@ -26,10 +26,10 @@ //borghesi@unistra.fr // //This software is governed by the CeCILL-B license under French law and -//abiding by the rules of distribution of free software. You can use, +//abiding by the rules of distribution of free software. You can use, //modify and/ or redistribute the software under the terms of the CeCILL-B //license as circulated by CEA, CNRS and INRIA at the following URL -//"http://www.cecill.info". +//"http://www.cecill.info". // //The fact that you are presently reading this means that you have had //knowledge of the CeCILL-B license and that you accept its terms. You can @@ -78,7 +78,7 @@ $PDF->Text(140,240,utf8_decode($dsondage->nom_admin)); $PDF->SetFont('Arial','B',8); // TODO: translate -$PDF->Text(35,275,"Cette lettre de convocation a été générée automatiquement par ".NOMAPPLICATION." sur ".get_server_name()); +$PDF->Text(35,275,"Cette lettre de convocation a été générée automatiquement par ".NOMAPPLICATION." sur ". $_SERVER['SERVER_NAME']); //Sortie $PDF->Output(); diff --git a/fonctions.php b/fonctions.php index db738a4..7f25b44 100644 --- a/fonctions.php +++ b/fonctions.php @@ -10,10 +10,10 @@ //Ce logiciel est régi par la licence CeCILL-B soumise au droit français et //respectant les principes de diffusion des logiciels libres. Vous pouvez //utiliser, modifier et/ou redistribuer ce programme sous les conditions -//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA //sur le site "http://www.cecill.info". // -//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez //pris connaissance de la licence CeCILL-B, et que vous en avez accepté les //termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. // @@ -26,10 +26,10 @@ //borghesi@unistra.fr // //This software is governed by the CeCILL-B license under French law and -//abiding by the rules of distribution of free software. You can use, +//abiding by the rules of distribution of free software. You can use, //modify and/ or redistribute the software under the terms of the CeCILL-B //license as circulated by CEA, CNRS and INRIA at the following URL -//"http://www.cecill.info". +//"http://www.cecill.info". // //The fact that you are presently reading this means that you have had //knowledge of the CeCILL-B license and that you accept its terms. You can @@ -53,47 +53,35 @@ function connexion_base() return $DB; } - function get_server_name() { - $scheme = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? 'https' : 'http'; - - $get = explode('/', dirname($_SERVER["SCRIPT_NAME"])); - $folder = explode('/', str_replace('\\', '/', dirname(__FILE__))); - $communs = array_intersect($get, $folder); - $base = implode('/', $communs); - $url = sprintf("%s://%s%s", $scheme, STUDS_URL, $base); - - if (!preg_match("|/$|", $url)) { - $url = $url."/"; - } - - return $url; + $scheme = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http'; + return $scheme . '//' . $_SERVER['SERVER_NAME'] . '/'; } function get_sondage_from_id($id) { global $connect; - + // Ouverture de la base de données if(preg_match(";^[\w\d]{16}$;i",$id)) { $sql = 'SELECT sondage.*,sujet_studs.sujet FROM sondage LEFT OUTER JOIN sujet_studs ON sondage.id_sondage = sujet_studs.id_sondage WHERE sondage.id_sondage = '.$connect->Param('id_sondage'); - + $sql = $connect->Prepare($sql); $sondage=$connect->Execute($sql, array($id)); - + if ($sondage === false) { return false; } - + $psondage = $sondage->FetchObject(false); $psondage->date_fin = strtotime($psondage->date_fin); return $psondage; } - + return false; } @@ -104,7 +92,7 @@ function is_error($cerr) if ( $err == 0 ) { return false; } - + return (($err & $cerr) != 0 ); } @@ -129,9 +117,9 @@ function print_header($js = false, $nom_sondage = '') '.NOMAPPLICATION.''; } echo ' - - '; - + + '; + echo ''; } @@ -157,7 +145,7 @@ function check_table_sondage() function validateEmail($email) { $pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD'; - + return (bool)preg_match($pattern, $email); } @@ -206,7 +194,7 @@ function issetAndNoEmpty($name, $tableau = null) if ($tableau === null) { $tableau = $_POST; } - + return (isset($tableau[$name]) === true && empty($tableau[$name]) === false); } @@ -232,7 +220,7 @@ function getUrlSondage($id, $admin = false) $url = get_server_name().'studs.php?sondage='.$id; } } - + return $url; } diff --git a/index.php b/index.php index adb6a6e..e81c2cf 100644 --- a/index.php +++ b/index.php @@ -10,10 +10,10 @@ //Ce logiciel est régi par la licence CeCILL-B soumise au droit français et //respectant les principes de diffusion des logiciels libres. Vous pouvez //utiliser, modifier et/ou redistribuer ce programme sous les conditions -//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +//de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA //sur le site "http://www.cecill.info". // -//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +//Le fait que vous puissiez accéder à cet en-tête signifie que vous avez //pris connaissance de la licence CeCILL-B, et que vous en avez accepté les //termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. // @@ -26,10 +26,10 @@ //borghesi@unistra.fr // //This software is governed by the CeCILL-B license under French law and -//abiding by the rules of distribution of free software. You can use, +//abiding by the rules of distribution of free software. You can use, //modify and/ or redistribute the software under the terms of the CeCILL-B //license as circulated by CEA, CNRS and INRIA at the following URL -//"http://www.cecill.info". +//"http://www.cecill.info". // //The fact that you are presently reading this means that you have had //knowledge of the CeCILL-B license and that you accept its terms. You can @@ -72,7 +72,7 @@ echo '
'."\n"; #echo '

'. _("Making polls to schedule meetings or events, quickly and easily.
You can also run polls to determine what will be your next meeting place, the meeting topic or anything like the country you would like to visit during your next holidays.") .'

'."\n".'
'."\n"; #echo '
'. _("Make a poll") .''; # '' . -# '' . _('Make a poll') . '' . +# '' . _('Make a poll') . '' . # ''; #echo '
' . "\n"; @@ -97,4 +97,4 @@ echo ''."\n"; bandeau_pied(); echo ''."\n"; -echo ''."\n"; \ No newline at end of file +echo ''."\n";