From e7cf0e99f41ab8ba3bab8aed516123c6f4ff3979 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Thu, 5 Jul 2018 00:34:06 +0200 Subject: Version final-03-27-12h --- final/app/include/connect.inc.php | 4 ++-- final/app/include/je.inc.php | 5 +++-- final/app/include/ju.inc.php | 10 ++++++--- final/app/include/ludo/auth.inc.php | 31 +++++++++++++++++++--------- final/app/include/ludo/config.inc.php | 10 +++++++-- final/app/include/ludo/fonctions.inc.php | 8 +++---- final/app/include/ludo/html_elements.inc.php | 23 +++++++++++---------- 7 files changed, 57 insertions(+), 34 deletions(-) (limited to 'final/app/include') diff --git a/final/app/include/connect.inc.php b/final/app/include/connect.inc.php index 0bc0a10..469ebd1 100644 --- a/final/app/include/connect.inc.php +++ b/final/app/include/connect.inc.php @@ -4,9 +4,9 @@ */ // $bd représente le nom de la database à utiliser -$bd = "awor"; +$bd = "awor_final"; // mysql_connect(, , ); -$link = @mysql_connect('localhost', 'awor', 'blagnac'); +$link = @mysql_connect('localhost', 'lud_restricted', 'maille_ess_ku_elle'); @mysql_select_db($bd , $link); diff --git a/final/app/include/je.inc.php b/final/app/include/je.inc.php index d7d1081..5205b47 100644 --- a/final/app/include/je.inc.php +++ b/final/app/include/je.inc.php @@ -163,7 +163,7 @@ require_once ('include/connect.inc.php'); if ($row['estPrivee'] == 'oui' || $row['idP_Createur']==$idP) echo "\"Supprimer\n" ; else echo "\n"; if ($row['estPrivee'] == 'oui') echo "Privée" ; else echo "Public"; echo "\n"; - echo ""; + echo ""; echo htmlentities($row['libelleL'], ENT_QUOTES); echo "\n"; echo "\n"; @@ -237,5 +237,6 @@ require_once ('include/connect.inc.php'); } } echo ''; - } +} + ?> \ No newline at end of file diff --git a/final/app/include/ju.inc.php b/final/app/include/ju.inc.php index 4bb9330..4ab1a1c 100644 --- a/final/app/include/ju.inc.php +++ b/final/app/include/ju.inc.php @@ -153,9 +153,13 @@ function traiter_formulaire_maj_profil() { require_once ('include/tools.inc.php'); $requete = "UPDATE AWOR_Personne SET courrielP = '".addslashes_if_needed($_POST["courrielP"])."', loginP = '".addslashes_if_needed($_POST["loginP"])."', nomP = '".addslashes_if_needed($_POST["nomP"])."', prenomP = '".addslashes_if_needed($_POST["prenomP"])."', methodeAuth = '".addslashes_if_needed($_POST["methodeAuth"])."' WHERE idP = '".$_SESSION['session_idP']."'"; - if(mysql_query($requete) == false) return "Une erreur MySQL est survenu : ".mysql_error(); - $_SESSION['session_prenomP'] = $_POST["prenomP"]; - $_SESSION['session_nomP'] = $_POST["nomP"]; + if(mysql_query($requete) === false) return false;// "Une erreur MySQL est survenu : ".mysql_error(); + else + { + $_SESSION['session_prenomP'] = $_POST["prenomP"]; + $_SESSION['session_nomP'] = $_POST["nomP"]; + return true; + } //print_r($_POST); } diff --git a/final/app/include/ludo/auth.inc.php b/final/app/include/ludo/auth.inc.php index 2491203..516bd45 100644 --- a/final/app/include/ludo/auth.inc.php +++ b/final/app/include/ludo/auth.inc.php @@ -13,24 +13,33 @@ define("ERR_BAD_PARAMS", -100); // Fonction d'authentification pop3 function pop3_auth_simple($mail, $upw) { - if ( ($ret = ereg ( "(^.*)@([[:alnum:]]+\.[[:alnum:]]+)", $mail, $re_tokens ) ) ) + //~ echo "DEBUG : function pop3_auth_simple($mail, $upw)\n"; + //~ if ( ($ret = ereg ( "(^.*)@([[:alnum:]]+\.[[:alnum:]]+)", $mail, $re_tokens ) ) ) + if ( ($ret = ereg ( "(^.*)@(.+)", $mail, $re_tokens ) ) ) { /* $re_tokens [] * [0] : email complet * [1] : nom_mail * [2] : serveur_mail */ - require_once('config.inc.php'); - $srv_conf = $CONFIG['AUTH']['POP']['SERVERS'][strtolower($re_tokens[2])]; - if ( is_array($srv_conf) ) + $server_mail=strtolower($re_tokens[2]); + include('config.inc.php'); + + if ( isset($CONFIG['AUTH']['POP']['SERVERS'][$server_mail]) ) { - $server=$srv_conf['subdomain']; - $port=$srv_conf['port']; - if ( $srv_conf['username_is_full_mail'] ) - { $user = $mail; } else { $user = $re_tokens[1]; } - return pop3_auth ($server, $port, $user, $upw); + $srv_conf = $CONFIG['AUTH']['POP']['SERVERS'][$server_mail]; + if ( is_array($srv_conf) ) + { + $server=$srv_conf['subdomain']; + $port=$srv_conf['port']; + if ( $srv_conf['username_is_full_mail'] ) + { $user = $mail; } else { $user = $re_tokens[1]; } + return pop3_auth ($server, $port, $user, $upw); + } } - } + //~ else { print_r($CONFIG); echo "\nDEBUG : \$server_mail==$server_mail\n";} + }//else echo "Pb EREG\n"; + /* DEBUG echo $mail . "\n" . $ret . "\n";; print_r($re_tokens); @@ -40,6 +49,8 @@ function pop3_auth_simple($mail, $upw) function pop3_auth ($server, $port, $user, $upw) { + //~ echo "function pop3_auth ($server, $port, $user, $upw)\n"; + //echo "DEBUG : fsockopen($server, $port, $errno, $errstr, 10);"; $sock = @fsockopen($server, $port, $errno, $errstr, 10); if ( $sock === false) diff --git a/final/app/include/ludo/config.inc.php b/final/app/include/ludo/config.inc.php index c016342..92be407 100644 --- a/final/app/include/ludo/config.inc.php +++ b/final/app/include/ludo/config.inc.php @@ -9,6 +9,12 @@ $CONFIG = array ( 'SERVERS' => array ( + 'etu.iut-blagnac.fr' => array + ( + 'subdomain' => 'mail.google.com', + 'port' => 110, + 'username_is_full_mail' => true + ), 'wanadoo.fr' => array ( 'subdomain' => 'pop.orange.fr', @@ -31,8 +37,8 @@ $CONFIG = array ( // 'nom à afficher' => 'nom_fichier_sans_extension' 'standard' => 'ice', - 'Glace (ancien)' => 'ice_moche', - 'bleu' => 'style1' + 'vertical demo' => 'ice_moche' + //'bleu' => 'style1' ) ), 'MAIL' => array diff --git a/final/app/include/ludo/fonctions.inc.php b/final/app/include/ludo/fonctions.inc.php index 3361827..1dd9117 100644 --- a/final/app/include/ludo/fonctions.inc.php +++ b/final/app/include/ludo/fonctions.inc.php @@ -145,7 +145,7 @@ function generate_html_array_personnes_crenaux($idR) if ( $is_admin ) { echo ' ' . "\n"; + echo '&idL=' . $idL_interne . '&idP_orga=' . $idP_orga . '\',\'poppersonne\',true);popon(\'poppersonne\');loadid(\'help/reunion_admin_participants.php.hlp\',\'help\',false)">' . "\n"; echo ' Ajouter une personne' . "\n"; echo '  '; } @@ -185,7 +185,7 @@ function generate_html_array_personnes_crenaux($idR) { ?> - + Editer les creneaux @@ -275,7 +275,7 @@ function generate_html_array_personnes_crenaux($idR) ' . "\n"; + echo '&idL=' . $idL_interne . '&idP_orga=' . $idP_orga . '\',\'poppersonne\',true);popon(\'poppersonne\');loadid(\'help/reunion_admin_participants.php.hlp\',\'help\',false)">' . "\n"; ?> Ajouter une personne @@ -443,7 +443,7 @@ function generate_html_reunion_detail2($idR) echo '(Editer)\n"; + echo "','details_reunion',false);loadid('help/reunion_admin_info.php.hlp','help',false)\">(Editer)\n"; } $objetR=htmlentities($objetR, ENT_QUOTES); $ordreJourR=htmlentities($ordreJourR, ENT_QUOTES); diff --git a/final/app/include/ludo/html_elements.inc.php b/final/app/include/ludo/html_elements.inc.php index 35eaa68..a252662 100644 --- a/final/app/include/ludo/html_elements.inc.php +++ b/final/app/include/ludo/html_elements.inc.php @@ -16,9 +16,9 @@ echo ''."\n" '."\n" } echo ' ' . "\n"; echo ' ' . "\n"; - +/* if ( isset($CONFIG['CSS']['CHOOSER_LIST']) ) { foreach ( $CONFIG['CSS']['CHOOSER_LIST'] as $cssname => $cssfile ) @@ -39,6 +39,7 @@ echo ''."\n" } } } +*/ ?> @@ -101,15 +102,15 @@ function generate_html_div_css_chooser() if ( ! is_array($CONFIG['CSS']['CHOOSER_LIST']) ) { return false; } - if ( isset($_COOKIE['aworcustom_css'] ) ) { $css_selected=$_COOKIE['aworcustom_css']; }else{$css_selected='';}; + if ( isset($_COOKIE['aworchoose_css'] ) ) { $css_selected=$_COOKIE['aworchoose_css']; }else{$css_selected='';}; echo '
' . "\n"; //print_r($_COOKIE); echo ' '. "\n"; echo '
'. "\n"; @@ -120,10 +121,10 @@ function generate_html_div_footer() ?> -- cgit v1.2.3