| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
require_once("../class/config.php"); |
|---|
| 31 |
|
|---|
| 32 |
if (!$admin->enabled) { |
|---|
| 33 |
__("This page is restricted to authorized staff"); |
|---|
| 34 |
exit(); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
include("head.php"); |
|---|
| 38 |
?> |
|---|
| 39 |
</head> |
|---|
| 40 |
<body> |
|---|
| 41 |
<h3>Envoye d'email à tous les comptes</h3> |
|---|
| 42 |
<?php |
|---|
| 43 |
@set_time_limit(1200); |
|---|
| 44 |
|
|---|
| 45 |
$message = ''; |
|---|
| 46 |
$subject = ''; |
|---|
| 47 |
|
|---|
| 48 |
if ( isset($_POST['submit']) ) |
|---|
| 49 |
{ |
|---|
| 50 |
$subject = stripslashes(trim($_POST['subject'])); |
|---|
| 51 |
$message = stripslashes(trim($_POST['message'])); |
|---|
| 52 |
|
|---|
| 53 |
$error = FALSE; |
|---|
| 54 |
$error_msg = ''; |
|---|
| 55 |
|
|---|
| 56 |
if ( empty($subject) ) |
|---|
| 57 |
{ |
|---|
| 58 |
$error = true; |
|---|
| 59 |
$error_msg .= ( !empty($error_msg) ) ? '<br /><p class="error">Vous devez spécifié un sujet pour le mail !</p>' : '<p class="error">vous devez spécifié un sujet pour le mail !</p>'; |
|---|
| 60 |
} |
|---|
| 61 |
|
|---|
| 62 |
if ( empty($message) ) |
|---|
| 63 |
{ |
|---|
| 64 |
$error = true; |
|---|
| 65 |
$error_msg .= ( !empty($error_msg) ) ? '<br /><p class="error">Votre mail doit contenir un message !</p>' : '<p class="error">Votre mail doit contenir un message !</p>'; |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
$sql = "SELECT mail FROM membres WHERE uid <> 2000"; |
|---|
| 69 |
$resultat = mysql_query($sql); |
|---|
| 70 |
if ( $row = @mysql_fetch_array($resultat) ) |
|---|
| 71 |
{ |
|---|
| 72 |
do |
|---|
| 73 |
{ |
|---|
| 74 |
$headers = 'From: root@' . $_SERVER['HTTP_HOST'] . "\r\n"; |
|---|
| 75 |
|
|---|
| 76 |
mail($row['mail'], $subject, $message, $headers); |
|---|
| 77 |
} |
|---|
| 78 |
while ( $row = @mysql_fetch_array($resultat) ); |
|---|
| 79 |
@mysql_free_result($resultat); |
|---|
| 80 |
} |
|---|
| 81 |
$error = true; |
|---|
| 82 |
$error_msg .= '<p class="error">envoyé avec succès.</p>'; |
|---|
| 83 |
} |
|---|
| 84 |
|
|---|
| 85 |
if ($error) |
|---|
| 86 |
{ |
|---|
| 87 |
echo "$error_msg"; |
|---|
| 88 |
} |
|---|
| 89 |
?> |
|---|
| 90 |
<form method="post" action="adm_email.php"> |
|---|
| 91 |
|
|---|
| 92 |
<table cellspacing="1" cellpadding="4" border="0" align="center"> |
|---|
| 93 |
<tr> |
|---|
| 94 |
<th colspan="2">Envoye d'un mail à tous les utilisateurs</th> |
|---|
| 95 |
</tr> |
|---|
| 96 |
<tr> |
|---|
| 97 |
<td align="right"><b>Sujet</b></td> |
|---|
| 98 |
<td><span><input type="text" name="subject" size="45" maxlength="100" tabindex="2" value="" /></span></td> |
|---|
| 99 |
</tr> |
|---|
| 100 |
<tr> |
|---|
| 101 |
<td align="right" valign="top"> <span><b>Message</b></span> |
|---|
| 102 |
<td><span> <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3"></textarea></span> |
|---|
| 103 |
</tr> |
|---|
| 104 |
<tr> |
|---|
| 105 |
<td class="catBottom" align="center" colspan="2"><input type="submit" value="Envoyer le mail" name="submit" /></td> |
|---|
| 106 |
</tr> |
|---|
| 107 |
</table> |
|---|
| 108 |
|
|---|
| 109 |
</form> |
|---|
| 110 |
|
|---|
| 111 |
</body> |
|---|
| 112 |
</html> |
|---|