Commit 5fe01369 authored by Skia's avatar Skia
Browse files

Add mailing page

parent 41c5f468
<?php
require_once($topdir. "include/mysql.inc.php");
require_once($topdir. "include/mysqlae.inc.php");
if ( isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "on" )
{
echo "ERROR HTTPS REQUIRED";
exit();
}
$db = new mysqlae ();
if ( !$db->dbh )
{
echo "ERROR DB UNAVAILABLE";
exit();
}
$valid = new requete($db,
"SELECT `key` ".
"FROM `sso_api_keys` ".
"WHERE `key` = '".mysql_real_escape_string($_REQUEST["key"])."'");
if ( $valid->lines != 1 )
{
echo "ERROR KEY NOT VALID\n";
exit();
}
$req = new requete($db,"SELECT * FROM mailing");
while ( $row = $req->get_row() )
{
if ($row["role"] >= 2) {
$ml_bureau[$row["nom_unix_asso"]] .= $row["email_utl"] . " ";
}
$ml_membre[$row["nom_unix_asso"]] .= $row["email_utl"] . " ";
}
foreach ($ml_bureau as $k => $v) {
echo $k . ".bureau: ".$v;
echo "\n";
}
foreach ($ml_membre as $k => $v) {
echo $k . ".membres: ".$v;
echo "\n";
}
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment