| 1 |
<?php /*
|
| 2 |
|
| 3 |
Originally written by Stefano Fabri <bluefuture@nospam@email.it>
|
| 4 |
Copyright 2004, Stefano Fabri
|
| 5 |
|
| 6 |
This program is free software; you can redistribute it and/or modify
|
| 7 |
it under the terms of the GNU General Public License as published by
|
| 8 |
the Free Software Foundation; either version 2 of the License, or
|
| 9 |
(at your option) any later version.
|
| 10 |
|
| 11 |
This program is distributed in the hope that it will be useful,
|
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
GNU General Public License for more details.
|
| 15 |
|
| 16 |
You should have received a copy of the GNU General Public License
|
| 17 |
along with this program; if not, write to the Free Software
|
| 18 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 19 |
*/
|
| 20 |
if (array_key_exists("id",$_GET) and is_numeric($_GET[id])) {
|
| 21 |
header("Content-Type: text/plain");
|
| 22 |
$db = @pg_connect("dbname=dehs") or die("Db error: Alioth postgres overloaded?");
|
| 23 |
$sql="SELECT wwiz,watch, up_changes FROM pkgs where id=" . $_GET[id];
|
| 24 |
$rsql=pg_exec($db, $sql);
|
| 25 |
$res_array=pg_fetch_array($rsql);
|
| 26 |
if (pg_numrows($rsql)==0) {
|
| 27 |
print "Packages Id -> $_GET[id] - not found" ;
|
| 28 |
pg_close($db);
|
| 29 |
exit;
|
| 30 |
}
|
| 31 |
if (array_key_exists("type",$_GET)) {
|
| 32 |
if ($_GET[type]=="up_changes") print $res_array['up_changes'];
|
| 33 |
if ($_GET[type]=="watch") {
|
| 34 |
if ($res_array[watch]) print $res_array[watch];
|
| 35 |
else print $res_array['wwiz'];
|
| 36 |
}
|
| 37 |
}
|
| 38 |
pg_close($db);
|
| 39 |
}
|
| 40 |
else print "Error in submitted id field";
|
| 41 |
?>
|