2005-11-13 15:05:03 +00:00
|
|
|
<?php
|
2012-01-28 13:46:53 +00:00
|
|
|
|
2005-11-13 15:05:03 +00:00
|
|
|
$error = null;
|
|
|
|
|
|
|
|
function get_members_from_sql () {
|
|
|
|
global $error;
|
|
|
|
|
|
|
|
if (is_readable ("/home/admin/secret/anonvoting")) {
|
|
|
|
include ("/home/admin/secret/anonvoting");
|
|
|
|
} else {
|
|
|
|
$error = "Can not get the authentication data.";
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
$members_table = "foundationmembers";
|
|
|
|
|
|
|
|
$handle = mysql_connect ("$mysql_host", "$mysql_user", "$mysql_password");
|
|
|
|
if (!$handle) {
|
|
|
|
$error = "Can not connect to the database.";
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-06-28 12:22:57 +00:00
|
|
|
$result = mysql_query ("SET NAMES 'utf8'", $handle);
|
|
|
|
if (!$result) {
|
|
|
|
die ("Unable to run query: ".mysql_error ($handle));
|
|
|
|
}
|
2005-11-13 15:05:03 +00:00
|
|
|
|
|
|
|
$select_base = mysql_select_db ($mysql_db, $handle);
|
|
|
|
if (!$select_base) {
|
|
|
|
mysql_close ($handle);
|
|
|
|
$error = "Can not select the database.";
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-09-17 21:42:11 +00:00
|
|
|
$query = "SELECT firstname, lastname, email, last_renewed_on FROM ".$members_table;
|
2005-11-13 15:05:03 +00:00
|
|
|
$query .= " WHERE DATE_SUB(CURDATE(), INTERVAL 2 YEAR) <= last_renewed_on";
|
|
|
|
$query .= " ORDER BY lastname, firstname";
|
|
|
|
|
|
|
|
$result = mysql_query ($query, $handle);
|
|
|
|
|
|
|
|
if ($result === FALSE) {
|
|
|
|
$error = mysql_error ($handle);
|
|
|
|
$retval = FALSE;
|
|
|
|
} else {
|
|
|
|
$result_array = array ();
|
|
|
|
while ($buffer = mysql_fetch_assoc ($result)) {
|
|
|
|
$result_array[] = $buffer;
|
|
|
|
}
|
|
|
|
$retval = $result_array;
|
|
|
|
}
|
|
|
|
|
|
|
|
mysql_close ($handle);
|
|
|
|
return $retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
$members = get_members_from_sql ();
|
|
|
|
|
2012-01-28 13:46:53 +00:00
|
|
|
|
|
|
|
if (isset ($_GET['format'])) {
|
|
|
|
$format = $_GET['format'];
|
|
|
|
} else {
|
|
|
|
$format = 'html';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($format == 'json') {
|
|
|
|
if ($members === FALSE) {
|
|
|
|
echo json_encode (array ('error' => $error));
|
|
|
|
} else {
|
|
|
|
echo json_encode ($members);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>GNOME Foundation Membership List</title>
|
|
|
|
<meta name="cvsdate" content="$Date$" />
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h1>GNOME Foundation Membership List</h1>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Send comments, questions, and updates to <a
|
|
|
|
href="mailto:membership-committee@gnome.org">membership-committee@gnome.org</a>.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2005-11-13 15:05:03 +00:00
|
|
|
if ($members === FALSE) {
|
|
|
|
echo "<p>Error: ".$error.".</p>\n";
|
|
|
|
} else {
|
|
|
|
echo " <ul>\n";
|
|
|
|
$antispam = array(".", "@");
|
|
|
|
|
|
|
|
foreach ($members as $member) {
|
2005-11-13 15:12:20 +00:00
|
|
|
$email = str_replace($antispam, " ", $member["email"]);
|
2007-09-17 22:05:21 +00:00
|
|
|
echo " <li title='Last Renewed On: ".$member['last_renewed_on']."'>".$member["firstname"]." ".$member["lastname"]." <".$email."></li>\n";
|
2005-11-13 15:05:03 +00:00
|
|
|
}
|
|
|
|
echo " </ul>\n";
|
|
|
|
}
|
|
|
|
?>
|
2003-11-02 05:06:55 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|