summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimone Rota <sip@crux.nu>2006-12-01 13:14:13 +0100
committerSimone Rota <sip@crux.nu>2006-12-01 13:14:13 +0100
commitd97e38d2943932b45be095299852f073de2f707e (patch)
tree5697a35c34f737f867f6dd969efb3cceab766f28
parent463c355cfc7e9f089d28af023fa65ce89f212d70 (diff)
downloadwebtools-d97e38d2943932b45be095299852f073de2f707e.tar.gz
webtools-d97e38d2943932b45be095299852f073de2f707e.tar.xz
portdb: update email address, cleaned up unused cruft
-rwxr-xr-xportdb/portdb/index.php69
1 files changed, 1 insertions, 68 deletions
diff --git a/portdb/portdb/index.php b/portdb/portdb/index.php
index 1d7a30d..6cee69e 100755
--- a/portdb/portdb/index.php
+++ b/portdb/portdb/index.php
@@ -4,11 +4,9 @@ require('DB.php');
# Written by Simone Rota <sip@crux.nu>
$dsn = 'sqlite:////home/crux/public_html/local/portdb.db';
-$admin = 'viper@hometux.de';
function sanitize($str) {
return $str;
- //return ereg_replace("[^[:alnum:]]","",$str);
}
function nospam($mail) {
@@ -45,7 +43,6 @@ function printFooter() {
}
function printNav() {
-# echo '<div class="content"><b>Sections: </b><a href="?a=index">Repositories</a> :: <a href="?a=search">Search</a> :: <a href="?a=register">Register</a> :: <a href="?a=dups">Duplicates</a> :: <a href="?a=dupm">DupMeister</a>';
echo '<div class="content"><b>Sections: </b><a href="?a=index">Repositories</a> :: <a href="?a=search">Search</a> :: <a href="?a=register">Register</a> :: <a href="?a=dups">Duplicates</a>';
}
@@ -135,7 +132,7 @@ function showSearch($singlerepo) {
function showRegister() {
$query = sanitize($_GET['q']);
echo "<h2>Register your ports repository</h2>";
- echo "<p>You can register your personal HttpUp repository sending an email with the following information to <i>viper at hometux dot de</i>:</p>";
+ echo "<p>You can register your personal HttpUp repository sending an email with the following information to <i>contrib-admin at crux dot nu</i>:</p>";
echo '<ul><li>Repository Name <small>(e.g. myports)</small></li>
<li>Root URL <small>(e.g. http://mypage.se/ports/)</small></li>
<li>Your name</li>
@@ -143,20 +140,6 @@ function showRegister() {
echo "<p>A CRUX team member will put your repository into our database. Please give us some time to do this. Once it is active it is synced once a day. <b>Please do not submit .httpup files, only the URL for the repository. This means the URL to the repository itself, not portspage or other indexes.</b>";
}
-#function showSendMail() {
-# $name = $_POST['name'];
-# $url = $_POST['url'];
-# $mail = $_POST['mail'];
-# $maint = $_POST['maint'];
-# echo "<h2>Registration results</h2>";
-# if (sendMail($name, $url, $mail, $maint)) {
-# echo "<p>Your data was sent to the responsible CRUX member. Thanks for your contribution!</p>";
-# } else {
-# echo "<p>Your mail could not be sent. Please contact a CRUX Team member.</p>";
-# }
-#
-#}
-
function showDuplicates() {
global $db;
$sql = "select portname, count(*) as dup from ports
@@ -179,50 +162,6 @@ function showDuplicates() {
echo "</table>";
}
-function showDupMeister() {
- global $db;
- $sql = "select p1.collection as coll, p1.portname, count(*) as dups from ports as p1
- join ports as p2 on (p1.portname=p2.portname and p1.collection!=p2.collection)
- where (p1.collection<>'contrib' and p1.collection<>'opt' and p1.collection<>'core')
- group by coll
- order by dups desc";
- $res =& $db->Query($sql);
- if (DB::isError($res)) die("Query error");
- echo "<h2>Duplicates by repository</h2>\n";
- echo '<table class="listing">';
- echo '<thead><tr><th>Collection</th><th># of duplicates</th></tr></thead>';
- $i=0;
- while ($port =& $res->fetchRow()) {
- $cl = "row".$i%2;
- echo '<tr class="'.$cl.'">
- <td><a href="?a=repo&q='.$port['coll'].'">'.$port['coll']."</a></td>\n"
- .'<td>'.$port['dups']."</td>\n";
- $i++;
- }
- echo "</table>";
-}
-
-function sendMail($name, $url, $mail, $maint) {
- require_once('Mail.php');
- global $admin;
- if ($maint == "" || $name == "" || $url == "" || $mail == "")
- return false;
- $headers = array();
- $headers["From"] = "CRUX Team <crux@crux.nu>";
- $headers["Subject"] = "[crux-portdb] New httpup repository $name";
- $msg = "New httpup repository:\n\n";
- $msg .= "Repo Name : $name\n";
- $msg .= "Root URL : $url\n";
- $msg .= "Maintainer : $maint\n";
- $msg .= "Email : $mail\n";
- $msg .= "\nConfig line: \"$name|$maint <$mail>|httpup|$url\",\n\n";
- $msg .= "REMOTE_ADDR: " . $_SERVER["REMOTE_ADDR"] . "\n";
- $msg .= "USER_AGENT : " . $_SERVER["HTTP_USER_AGENT"] . "\n";
- $params["host"] = "localhost";
- $mail_obj = &Mail::factory("smtp", $params);
- return $mail_obj->send($admin, $headers, $msg);
-}
-
function getUp() {
global $db;
$query = sanitize($_GET['q']);
@@ -274,15 +213,9 @@ switch ($action) {
case "register":
showRegister();
break;
-# case "send":
-# showSendMail();
-# break;
case "dups":
showDuplicates();
break;
-# case "dupm":
-# showDupMeister();
-# break;
default:
showCollections();
}

Generated by cgit