function reply($thread_ID, $corps, $new = 0) { global $lvlUser, $nuked, $user; $thread = recupThread($thread_ID); if (empty($thread["id"])) { ?> <div style="text-align:center;"><h2><?php echo _TICKETDONTEXIST; ?> </h2> <br /><br /><a href="javascript:history.back()"><b>[ <?php echo _BACK; ?> ]</b></a><br /></div><?php $new = 0; redirect("javascript:history.back()", 5); } else { if ($lvlUser == 0 || $thread["auteur_id"] != $user[0]) { ?> <div style="text-align:center;"><h2><?php echo _PASPROPRIOTICKET; ?> </h2> <br /><br /><a href="javascript:history.back()"><b>[ <?php echo _BACK; ?> ]</b></a><br /></div><?php $new = 0; redirect("javascript:history.back()", 5); } else { if (empty($corps)) { ?> <div style="text-align:center;"><h2><?php echo _UNKSUJETCORPS; ?> </h2> <br /><br /><a href="javascript:history.back()"><b>[ <?php echo _BACK; ?> ]</b></a><br /></div><?php $new = 0; redirect("javascript:history.back()", 5); } else { $requete = "INSERT INTO " . mysql_real_escape_string($nuked["prefix"]) . "_support_messages (texte, date, auteur, auteur_id, auteur_ip, thread_id, admin) VALUES ('" . mysql_real_escape_string(secu_html(html_entity_decode($corps, ENT_QUOTES))) . "', '" . time() . "', '" . mysql_real_escape_string(secu_html(html_entity_decode($user[2], ENT_QUOTES))) . "', '" . mysql_real_escape_string($user[0]) . "', '" . mysql_real_escape_string($user[3]) . "', '" . mysql_real_escape_string($thread_ID) . "', '0')"; $sql2 = mysql_query($requete); if (!$sql2) { ?> <div style="text-align:center;"><h2><?php echo _ERREUR . " " . mysql_error($sql2); ?> </h2></div><?php } else { if ($new == 0) { ?> <div style="text-align:center;"> <h2><?php echo _SUPPORT; ?> </h2> <h3><?php echo $thread["titre"]; ?> </h3> <br /><br /> <?php echo _REPLYSUCCESS; ?> <br /><br /><a href="javascript:history.back()"><b>[ <?php echo _BACK; ?> ]</b></a><br /> </div> <?php redirect("javascript:history.back()", 2); } } } } } }
function sendmail($auteur, $sujet, $id, $mail) { global $nuked, $user_ip, $nuked; $time = time(); $date = strftime("%x %H:%M", $time); $url_site = mysql_query("SELECT name, value FROM " . mysql_real_escape_string($nuked["prefix"]) . "_config WHERE name = 'url' LIMIT 0,1"); if ($url_site) { $url_site = mysql_fetch_assoc($url_site); $auteur = trim($auteur); $mail = trim($mail); $sujet = trim($sujet); $corps = "<p>Bonjour,<br />vous avez reçu une réponse à votre ticket de support \"<b>{$sujet}</b>\" de la part de {$auteur}.<br /><br />Vous pouvez consulter la réponse à l'adresse : <a href=\"" . $url_site["value"] . "index.php?file=Support&op=view&id={$id}\">" . $url_site["value"] . "index.php?file=Support&op=view&id={$id}</p>"; $subjet = $nuked['name'] . " - Notification de réponse au ticket : " . $sujet; $corp = $corps . "\r\n\r\n\r\n" . $nuked['name'] . " - " . $nuked['slogan']; $from = "From: " . $nuked["name"] . " - Notifications <" . $nuked['mail'] . ">\r\nReply-To: " . $nuked['mail'] . "\r\n"; $from .= "Content-Type: text/html\r\n\r\n"; $corp = secu_html(html_entity_decode($corp)); mail($mail, $subjet, $corp, $from); echo "<br /><br /><div style=\"text-align: center;\">" . _SENDCMAIL . "</div><br /><br />"; } else { echo "<br /><br /><div style=\"text-align: center;\">" . _SENDFMAIL . "</div><br /><br />"; } redirect("index.php?file=Support&page=admin", 3); }