8 use vars qw($dbhost $dbname $dbuser $dbpass $dbport $notifyapp);
10 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
11 #require "BuildFarmWeb.pl";
13 my $dsn="dbi:Pg:dbname=$dbname";
14 $dsn .= ";host=$dbhost" if $dbhost;
15 $dsn .= ";port=$dbport" if $dbport;
18 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
19 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
20 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
22 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
23 <title>PostgreSQL BuildFarm Application</title>
24 <link rel="icon" type="image/png" href="/elephant-icon.png" />
25 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
26 <style type="text/css"><!--
27 li#register a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; }
28 li#register { background: url(/inc/b/l.png) no-repeat 0% -20px; }
31 <body class="application">
34 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
37 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
38 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
39 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
40 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
41 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
42 <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</a></li>
52 <p style="text-align: center;">
53 Hosting for the PostgreSQL Buildfarm is generously
55 <a href="http://www.commandprompt.com">CommandPrompt,
56 The PostgreSQL Company</a>
58 </div><!-- wrapper -->
65 my $params = $query->Vars;
67 my ($os, $osv, $comp, $compv, $arch, $email, $owner) = @{$params}{
68 qw(os osv comp compv arch email owner)};
70 unless ($os && $osv && $comp && $compv && $arch && $email && $owner)
72 print "Content-Type: text/html\n\n",
74 "<p>You need to complete all the form items. <a href=\"/register.html\">Please try again.</a></p>\n",
79 # some idiot has a script that tries to talk to me
80 # this should catch and dispose of him
81 if (grep {/\@pgbuildfarm\.org|Content-Type:/} $os,$osv,$comp,$compv,$arch,$email,$owner)
84 "Status: 403 Forbidden - go away idiot\n",
85 "Content-Type: text/plain\n\n";
91 my $dummyname=""; # we'll select an animal name when we approve it.
94 # 8 random chars is enough for the dummy name
95 $secret .= substr("0123456789abcdefghijklmnopqrstuvwxyz",int(rand(36)),1);
96 $dummyname .= substr("0123456789abcdef",int(rand(16)),1);
100 $secret .= substr("0123456789abcdef",int(rand(16)),1);
103 my $db = DBI->connect($dsn,$dbuser,$dbpass);
105 my $statement = <<EOS;
107 insert into buildsystems
108 (name, secret, operating_system, os_version, compiler, compiler_version,
109 architecture, status, sys_owner, owner_email)
110 values(?,?,?,?,?,?,?,'pending',?,?)
115 my $sth=$db->prepare($statement);
116 my $rv=$sth->execute($dummyname,$secret,$os,$osv,$comp,$compv,
117 $arch,$owner,$email);
119 print "Content-type: text/html\n\n";
121 , "<h1>PostgreSQL BuildFarm Application received</h1>\n"
122 , "<p>Thank you. You should hear from us shortly.</p>"
132 my $msg = new Mail::Send;
136 my $host = `hostname`;
138 $msg->set('From',"PG Build Farm <$me\@$host>");
140 $msg->to(@$notifyapp);
141 $msg->subject('New Buildfarm Application');
143 print $fh "\n\nName: $dummyname\n",
146 "Comp: $comp: $compv\n",
147 "Owner: $owner <$email>\n";