]> git.pld-linux.org Git - projects/buildlogs.git/blame - obsolete/buildlogs/index.php
- allow easy checkboxes toggle in advanced search
[projects/buildlogs.git] / obsolete / buildlogs / index.php
CommitLineData
2a73daad 1<?php
7fe3a3a0 2$buildlogs_server = "buildlogs.pld-linux.org";
2a73daad
MM
3$url = "index.php";
4$addr = array(
23e4e929 5 "/th/SRPMS",
23e4e929 6 "/th/i486",
7 "/th/i686",
8 "/th/athlon",
cd4751b6 9 "/th/x86_64",
23e4e929 10 "/th/ia64",
11 "/th/alpha",
23e4e929 12 "/th/ppc",
cabfc1c2 13 "/th/sparc",
6f2b4c70 14 "/ac/SRPMS",
1da506e5 15 "/ac/i386",
16 "/ac/i586",
17 "/ac/i686",
18 "/ac/athlon",
0de45836 19 "/ac/amd64",
1da506e5 20 "/ac/alpha",
1da506e5 21 "/ac/ppc",
cabfc1c2 22 "/ac/sparc",
36783b89 23 "/ac/sparc64"/*,
2a73daad
MM
24 "/ra/i386",
25 "/ra/i586",
26 "/ra/i686",
1b49e545 27 "/ra/alpha",
6601cee2 28 "/ra/ppc",
cabfc1c2 29 "/ra/sparc",
23e4e929 30 "/nest/i486",
1da506e5 31 "/nest/i686",
ad31f87a 32 "/nest/alpha",
1da506e5 33 "/nest/ppc"
36783b89 34*/
2a73daad 35);
b018fce6 36$qa_addr = array(
23e4e929 37 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-SRPMS.txt",
23e4e929 38 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i486.txt",
39 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i686.txt",
40 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-athlon.txt",
cd4751b6 41 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-x86_64.txt",
23e4e929 42 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-ia64.txt",
43 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-alpha.txt",
23e4e929 44 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-ppc.txt",
cabfc1c2 45 "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-sparc.txt",
46 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-SRPMS.txt",
47 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i386.txt",
ae2b56fa 48 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i586.txt",
cabfc1c2 49 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i686.txt",
50 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-athlon.txt",
51 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-amd64.txt",
52 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-alpha.txt",
53 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-ppc.txt",
54 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc.txt",
36783b89 55 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc64.txt"/*,
42b98936 56 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i386.txt",
57 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i586.txt",
58 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i686.txt",
5f0c6bce 59 "http://ftp.pld-linux.org/dists/ra/.stat/builder/fly/rpmqa-ra-alpha.txt",
5f0c6bce 60 "http://ftp.pld-linux.org/dists/ra/.stat/builder/an2/rpmqa-ra-ppc.txt",
cabfc1c2 61 "http://ftp.pld-linux.org/dists/ra/.stat/builder/ares/rpmqa-ra-sparc.txt",
23e4e929 62 "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i486.txt",
f91d0306 63 "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i686.txt",
f91d0306
AM
64 "http://ftp.nest.pld-linux.org/.stat/builder/alpha/rpmqa-nest-alpha.txt",
65 "http://ftp.nest.pld-linux.org/.stat/builder/an2/rpmqa-nest-ppc.txt"
36783b89 66*/
b018fce6 67);
e86d1be4 68$local = 1; /* $local=0 for FTP */
1a5b89fd 69$root_directory = "/home/services/ftp/pub/pld-buildlogs";
c8c26d5e 70$ftp_conn = 0;
e86d1be4 71/* It should be set */
72
d304116f 73$langs["en_US"]["charset"]="ISO-8859-1";
74$langs["pl_PL"]["charset"]="ISO-8859-2";
75
76$lang="en_US";
77if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]))
78{
79 $rows=explode(";",$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
80 $rows=explode(",",$rows[0]);
81 $lang_detected=rtrim($rows[0]);
82} else if (preg_match("/opera/i",$_SERVER["HTTP_USER_AGENT"]))
83{
84 $lang_detected=preg_replace("/.*\[(.*)\].*/i","\\1",$_SERVER["HTTP_USER_AGENT"]);
85}
86
87// FIXME - some array
88$lang_detected=preg_replace("/^pl$/i","pl_PL",$lang_detected);
89
90if (isset($lang_detected) && isset($langs[$lang_detected]))
91{
92 $lang=$lang_detected;
93}
94
95if (isset($_GET["lang"]))$_SESSION["lang"]=$_GET["lang"];
96if (isset($_SESSION["lang"]))$lang=$_SESSION["lang"];
97
98putenv("LANG=$lang");
99setlocale(LC_ALL,$lang);
100bindtextdomain("messages","locale");
101textdomain("messages");
102
23f2f6e7 103if (isset($_GET["idx"]))$idx=$_GET["idx"];
9d3156ea 104if (isset($_GET["dist"]))
105{
106 $dist=$_GET["dist"];
107 if (isset($_GET["arch"]))
108 {
109 $arch=$_GET["arch"];
110 for ($i = 0; $i < count($addr); $i++)
111 {
112 if ($addr[$i]=="/".$dist."/".$arch)
113 $idx=$i;
114 }
115 }
116}
23f2f6e7 117if (isset($_GET["ok"]))$ok=$_GET["ok"];
5d5a01de 118else $ok="";
23f2f6e7 119if (isset($_GET["ns"]))$ns=$_GET["ns"];
5d5a01de 120else $ns="";
23f2f6e7 121if (isset($_GET["cnt"]))$cnt=$_GET["cnt"];
122if (isset($_GET["action"]))$action=$_GET["action"];
5d5a01de 123else $action="";
ab1439e7 124if (isset($_GET["off"]))$off=$_GET["off"];
125if (isset($_GET["id"]))$id=$_GET["id"];
23f2f6e7 126
f47b2a29 127if (isset($_POST["str"]))$str=$_POST["str"];
128if (isset($_POST["idx"]))$idx=$_POST["idx"];
23f2f6e7 129if (isset($_POST["action"]))$action=$_POST["action"];
2a73daad
MM
130
131function myheader()
132{
d0e7c65a
AF
133echo '<' . '?xml version="1.0" encoding="' . _("ISO-8859-1") .'"?' . ">\n";
134echo '<' . '?xml-stylesheet href="#internalStyle" type="text/css"?' . ">\n";
2a73daad
MM
135?>
136<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
137 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
138<html xmlns="http://www.w3.org/1999/xhtml">
139 <head>
140 <title>PLD Build Logs</title>
f3eff925 141 <?php echo '<meta http-equiv="Content-type" content="text/html; charset=' . _("ISO-8859-1") .'"/>' ."\n";?>
142 <style type="text/css"><!--
2a73daad
MM
143A { text-decoration: none; }
144A:hover { text-decoration: underline; }
145H1 { font-family: arial,helvetica,sans-serif;
146 font-size: 20pt;
147 font-weight: bold;}
148H2 { font-family: arial,helvetica,sans-serif;
149 font-size: 18pt;
150 font-weight: bold;}
151BODY,TD { font-family: arial,helvetica,sans-serif;
152 font-size: 13pt; }
153TH { font-family: arial,helvetica,sans-serif;
154 font-size: 13pt;
155 font-weight: bold; }
156//-->
157</style>
158 </head>
159 <!-- Diffrent color for visited link doesn't make much sense here...
160 this page is autogenerated and it might be misleading after some
161 build log changes. -->
162 <body bgcolor="#ffffff" text="#000000" link="#5f26cd" vlink="#5f26cd">
163<?php
164}
165
166function start_pre()
167{
fca9b4c4 168 echo "<table cellpadding=\"10\"><tr><td bgcolor=\"#000000\">".
69ad69d6 169 "<font color=\"#cccccc\"><pre style=\"width: 2048px;overflow: scroll\">";
2a73daad
MM
170}
171
172function end_pre()
173{
174 echo "</pre></font></td></tr></table>\n";
175}
176
177function trailer()
178{
179 echo "</body></html>";
180}
181
182
183function mydie($msg)
184{
185 echo "Fatal error: $msg";
186}
187
58c74097 188function open_ftp($pidx="", $pok="")
2a73daad
MM
189{
190 global $idx, $addr, $buildlogs_server, $ok;
191 global $ftp_conn, $big_url, $url, $ns;
ca0f7067 192 global $off, $cnt;
58c74097 193
194 if ($pidx==="")$pidx=$idx;
195 if ($pok==="")$pok=$ok;
c8c26d5e 196
58c74097 197 if (!isset($pidx) || !isset($addr[$pidx]))
2a73daad 198 return false;
c8c26d5e 199
58c74097 200 if ($pok != 1)
201 $pok = 0;
2a73daad
MM
202 if ($ns != 1)
203 $ns = 0;
c8c26d5e 204
58c74097 205 if ($pok == 1) {
206 $a = "$addr[$pidx]/OK";
2a73daad 207 } else {
58c74097 208 $a = "$addr[$pidx]/FAIL";
2a73daad 209 }
c8c26d5e 210
ca0f7067
MM
211 if (!isset($off))
212 $off = 0;
213 if (!isset($cnt))
214 $cnt = 16;
c8c26d5e 215
f3eff925 216 $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
c8c26d5e 217
2a73daad 218 $ftp = ftp_connect($buildlogs_server);
c8c26d5e 219
2a73daad 220 if ($ftp == false) {
d304116f 221 mydie(_("cannot connect to")." $buildlogs_server");
2a73daad
MM
222 return false;
223 }
224
225 if (ftp_login($ftp, "anonymous",
7fe3a3a0 226 "buildlogs-iface@pld-linux.org") == false) {
2a73daad 227 ftp_quit($ftp);
d304116f 228 mydie(_("cannot ftp login to")." $buildlogs_server");
2a73daad
MM
229 return false;
230 }
231
232 $list = ftp_nlist($ftp, $a);
233 if ($list == false) {
234 ftp_quit($ftp);
d304116f 235 mydie(_("cannot list")." $a");
2a73daad
MM
236 return false;
237 }
238
239 $ftp_conn = $ftp;
c8c26d5e 240
2a73daad
MM
241 return $list;
242}
243
58c74097 244function directory_list($pidx="",$pok="")
e86d1be4 245{
246 global $idx, $addr, $buildlogs_server, $ok;
247 global $root_directory, $big_url, $url, $ns;
248 global $off, $cnt;
c8c26d5e 249
58c74097 250 if ($pidx==="")$pidx=$idx;
251 if ($pok==="")$pok=$ok;
252 if (!isset($pidx) || !isset($addr[$pidx]))
e86d1be4 253 return false;
c8c26d5e 254
58c74097 255 if ($pok != 1)
256 $pok = 0;
e86d1be4 257 if ($ns != 1)
258 $ns = 0;
c8c26d5e 259
58c74097 260 if ($pok == 1) {
261 $a = "$addr[$pidx]/OK";
e86d1be4 262 } else {
58c74097 263 $a = "$addr[$pidx]/FAIL";
e86d1be4 264 }
c8c26d5e 265
e86d1be4 266 if (!isset($off))
267 $off = 0;
268 if (!isset($cnt))
269 $cnt = 16;
c8c26d5e 270
f3eff925 271 $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
c8c26d5e 272
e86d1be4 273 $dir = opendir("$root_directory$a");
274 $i = 0;
5d5a01de 275 $list = array ();
e86d1be4 276 while ($file = readdir($dir)) {
277 if (($file != ".") && ($file != "..")) {
36783b89 278 $list[$i] = array("$a/$file", filemtime("$root_directory$a/$file"));
e86d1be4 279 $i++;
280 }
281 }
282 closedir($dir);
283 return $list;
284}
285
2a73daad
MM
286function list_logs()
287{
288 global $idx, $addr, $ok;
c8c26d5e 289 global $ftp_conn, $big_url, $ns, $qa_addr;
290 global $off, $cnt, $local, $root_directory;
2a73daad 291
c8c26d5e 292 if ($local) {
293 $list = directory_list();
294 } else {
295 $list = open_ftp();
296 }
2a73daad
MM
297 if ($list == false)
298 return;
c8c26d5e 299
2a73daad 300 if ($ok == 1) {
d304116f 301 echo "<h1>"._("Listing of")." $addr[$idx]/OK "
3fe241e6 302 ."(<a href=\"$big_url&amp;ok=0\">"._("fail")."</a>)</h1>\n";
2a73daad 303 } else {
d304116f 304 echo "<h1>"._("Listing of")." $addr[$idx]/FAIL "
3fe241e6 305 ."(<a href=\"$big_url&amp;ok=1\">"._("ok")."</a>)</h1>\n";
2a73daad 306 }
c8c26d5e 307
3048cac7 308 echo "<div align=\"center\"><table cols=\"4\" border=\"0\" cellspacing=\"1\" ".
fca9b4c4 309 "cellpadding=\"3\" bgcolor=\"#000000\" width=\"90%\">\n";
3fe241e6 310 echo "<tr><th bgcolor=\"#CCCCFF\" align=\"right\" width=\"1%\">"._("No.")."</th>".
8efdceec 311 "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"80%\">"._("Log File").
f3eff925 312 "[<a href=\"$big_url&amp;ns=1\">"._("sort")."</a>]</th>".
9beed3cc 313 "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
fca9b4c4 314 "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
f3eff925 315 "[<a href=\"$big_url&amp;ns=0\">"._("sort")."</a>]</th>".
3048cac7 316 "</tr>";
2a73daad 317
c8c26d5e 318 function cmp($f1, $f2) {
319 global $ftp_conn, $root_directory, $local;
320 if ($local)
36783b89 321 return $f2[1] - $f1[1];//filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
2a73daad
MM
322 return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
323 }
324
36783b89 325 function cmp2($f1, $f2) {
326 return strcmp($f1[0], $f2[0]);
327 }
328
2a73daad
MM
329 if ($ns != 1) {
330 $ns = 0;
5d5a01de 331 usort($list, "cmp");
ca0f7067 332 } else {
36783b89 333 usort($list, "cmp2");
2a73daad 334 }
c8c26d5e 335
2a73daad 336 $now = time();
ca0f7067 337 for ($i = $off; $i < $cnt + $off; $i++) {
36783b89 338 $filename = $list[$i][0];
339 if (!isset($filename))
ca0f7067 340 continue;
36783b89 341 $h = bin2hex(mhash(MHASH_MD5, $filename));
342 $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $filename);
2a73daad 343 $f = preg_replace("/\.(bz2|gz)$/", "", $f);
c8c26d5e 344 if ($local) {
36783b89 345 $s = filesize("$root_directory$filename");
346 $t = $now - $list[$i][1];
2a73daad 347 } else {
c8c26d5e 348 $s = ftp_size($ftp_conn, $list[$i]);
349 $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
2a73daad 350 }
e86d1be4 351 $t /= 60;
352 if ($t >= 60) {
353 $t /= 60;
354 if ($t >= 24) {
355 $t /= 24;
8abba06f 356 $t = round($t);
6a739fdd 357 $t = $t . "&nbsp;" . ngettext("day","days",$t);
e86d1be4 358 } else {
8abba06f 359 $t = round($t);
6a739fdd 360 $t = $t . "&nbsp;" . ngettext("hour","hours",$t);
e86d1be4 361 }
362 } else {
8abba06f 363 $t = round($t);
6a739fdd 364 $t = $t . "&nbsp;" . ngettext("minute","minutes",$t);
e86d1be4 365 }
f3eff925 366 $u = "$big_url&amp;off=$off&amp;id=$h";
1ded5d5e 367 echo "<tr><td bgcolor=\"#CCCCCC\" align=\"right\">".($i+1).".</td>".
9beed3cc 368 "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$f</a> ".
f3eff925 369 "[<a href=\"$u&amp;action=text\">"._("text")."</a> | ".
370 "<a href=\"$u&amp;action=tail\">"._("tail")."</a>]".
fca9b4c4
AF
371 "</td><td bgcolor=\"#CCCCCC\" align=\"right\">".
372 "$s</td><td bgcolor=\"#CCCCCC\">$t</td></tr>\n";
e86d1be4 373 }
374 echo "</table></div>\n";
375
d326cd64 376 $backarr = "&lt;&lt;&lt;&nbsp;";
d304116f 377 $back = _("Page back");
378 $forward = _("Page forward");
d326cd64 379 $forwardarr = "&nbsp;&gt;&gt;&gt;";
e86d1be4 380
fca9b4c4 381 echo "<p><table width=\"90%\" align=\"center\"><tr><td align=\"left\" width=\"1%\">";
e86d1be4 382
383 if ($off > 0) {
384 $noff = $off - $cnt;
385 if ($noff < 0)
386 $noff = 0;
f3eff925 387 $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
fca9b4c4 388 echo "$hrefurl$backarr</a></td><td align=\"left\">$hrefurl$back</a>";
e86d1be4 389 } else {
fca9b4c4 390 echo "$backarr</td><td align=\"left\">$back";
e86d1be4 391 }
f93aa6bf 392
fca9b4c4 393 echo "</td>\n<td align=\"center\">";
f93aa6bf 394
bb3ae015 395 if ($qa_addr[$idx] != "") {
f3eff925 396 echo "[<a href=\"$big_url&amp;action=qa\">"._("View <quot>rpm&nbsp;-qa</quot> of builder")."</a>]";
f93aa6bf 397 } else {
398 echo "&nbsp;";
c8c26d5e 399 }
400
f3eff925 401 echo "</td>\n<td align=right>";
e86d1be4 402 if ($off + $cnt < count($list)) {
403 $noff = $off + $cnt;
404 if ($noff < 0)
405 $noff = 0;
f3eff925 406 $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
407 echo "$hrefurl$forward</a></td><td align=right width=1%>$hrefurl$forwardarr</a>";
e86d1be4 408 } else {
f3eff925 409 echo "$forward</td><td align=right width=1%>$forwardarr";
e86d1be4 410 }
d326cd64 411 echo "</td>\n</tr></table></p>";
c8c26d5e 412 if ($local == 0) {
2a73daad 413 ftp_quit($ftp_conn);
c8c26d5e 414 $ftp_conn = 0;
2a73daad 415 }
2a73daad
MM
416}
417
c8c26d5e 418function file_name()
e86d1be4 419{
420 global $idx, $addr, $ok;
c8c26d5e 421 global $ftp_conn, $root_directory, $big_url, $ns, $id;
422 global $buildlogs_server, $local;
e86d1be4 423
424 if (!isset($id))
425 return false;
c8c26d5e 426 if ($local) {
427 $list = directory_list();
428 } else {
429 $list = open_ftp();
430 }
e86d1be4 431 if ($list == false)
432 return false;
433
434 $f = false;
435 for ($i = 0; $i < count($list); $i++) {
36783b89 436 $h = bin2hex(mhash(MHASH_MD5, $list[$i][0]));
e86d1be4 437 if ($h == $id) {
36783b89 438 $f = $list[$i][0];
e86d1be4 439 }
440 }
441
442 if ($f == false) {
d304116f 443 mydie(_("cannot find specified file:")." $id");
c8c26d5e 444 if ($local == 0)
445 ftp_quit($ftp_conn);
e86d1be4 446 return false;
447 }
448
449 return $f;
450}
451
ca0f7067 452function dump_log($tail)
2a73daad
MM
453{
454 global $idx, $addr, $ok, $url;
c8c26d5e 455 global $ftp_conn, $root_directory, $big_url, $ns, $id, $cnt, $off;
456 global $buildlogs_server, $local, $qa_addr;
2a73daad
MM
457
458 $f = file_name();
459
460 if ($f == false)
461 return;
462
463 $df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
464 $df = preg_replace("/\.(bz2|gz)$/", "", $df);
c8c26d5e 465
2a73daad
MM
466 echo "<h1>$df</h1>";
467
fca9b4c4 468 echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\">";
2a73daad
MM
469
470 function one_item($h, $t) {
fca9b4c4
AF
471 echo "<tr><td bgcolor=\"#ccccff\">$h:</td>".
472 "<td bgcolor=\"#cccccc\">$t</td></tr>";
2a73daad
MM
473 }
474
475 function href($h, $c) {
476 return "<a href=\"$h\">$c</a>";
477 }
c8c26d5e 478
58c74097 479 one_item(_("Status"), ($ok == 1 ?
aa3cba6e
AM
480 "<font color=\"green\"><b>"._("OK")."</b></font>" :
481 "<font color=\"red\"><b>"._("Failed")."</b></a>"));
58c74097 482 one_item(_("Source URL"),
2a73daad
MM
483 href("ftp://$buildlogs_server$f",
484 "ftp://$buildlogs_server$f"));
ca0f7067 485
f3eff925 486 $bu = "$big_url&amp;off=$off";
c8c26d5e 487
58c74097 488 one_item(_("text/plain URL"),
f3eff925 489 href("$bu&amp;id=$id&amp;action=text",
58c74097 490 _("View!")));
ca0f7067 491 if ($tail) {
58c74097 492 one_item(_("full text"),
f3eff925 493 href("$bu&amp;id=$id",
ca0f7067
MM
494 "View!"));
495 }
f93aa6bf 496
d381dfdf 497 if ($qa_addr[$idx] != "") {
f3eff925 498 one_item(_("rpm -qa of builder"), href("$bu&amp;action=qa", _("View!")));
f93aa6bf 499 } else {
d304116f 500 one_item(_("rpm -qa of builder"), _("Not available"));
f93aa6bf 501 }
c8c26d5e 502 if ($local) {
503 one_item("Data", date("Y/m/d H:i:s", filemtime("$root_directory$f")));
504 } else {
505 one_item("Data", date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)));
506 }
2a73daad
MM
507 /*
508 echo "<tr><td>Here:</td><td>" .
f3eff925 509 "<a href=\"$url?idx=$idx&amp;ok=$ok&amp;id=$id\">".
2a73daad 510 "http://" . getenv("SERVER_NAME") .
f3eff925 511 getenv("SCRIPT_NAME") . "?idx=$idx&amp;ok=$ok&amp;id=$id</a>" .
2a73daad
MM
512 "</td></tr>"; */
513
d304116f 514 echo "</table><h2>"._("Content:")."</h2>";
2a73daad 515
c8c26d5e 516 if ($local == 0) {
517 ftp_quit($ftp_conn);
518 $ftp_conn = 0;
e86d1be4 519 }
e86d1be4 520
e86d1be4 521
e86d1be4 522 # what can I say beside PHP suxx? how the fuck should I create
523 # bidirectional pipe? gotta use wget
c8c26d5e 524
e86d1be4 525 if (preg_match("/\.bz2$/", $f)) {
c8c26d5e 526 $filter = "bzcat";
e86d1be4 527 } elseif (preg_match("/\.gz$/", $f)) {
c8c26d5e 528 $filter = "zcat";
e86d1be4 529 } else {
c8c26d5e 530 $filter = "cat";
e86d1be4 531 }
532
c8c26d5e 533 if ($local) {
534 $cmd = "$filter $root_directory$f";
535 } else {
536 $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
537 }
e86d1be4 538 if ($tail)
539 $cmd = "$cmd | tail -n 100";
540 $fd = popen($cmd, "r");
541 start_pre();
aa3cba6e 542 while (($s = fgets($fd, 102400)) != false) {
a37373e7 543 if (strlen($s) > 800) {
d3225945
AM
544 $s = chunk_split($s, 800, "\n ");
545 $s = trim($s);
546 }
e86d1be4 547 $s = htmlspecialchars($s);
548 echo $s;
549 }
550 end_pre();
551 pclose($fd);
552
553?>
fca9b4c4 554 <table width="100%">
e86d1be4 555 <tr>
f3eff925 556 <td align=left>
d304116f 557 [<a href="<?php echo $bu; ?>"><?=_("Back to list of logs")?></a>]
e86d1be4 558 </td>
f3eff925 559 <td align=right>
560 [<a href="<?php echo "$bu&amp;action=qa"
d304116f 561 ?>"><?=_("View rpm -qa of builder")?></a>]
e86d1be4 562 </td>
563 </tr>
51aa6406 564 </table>
e86d1be4 565<?php
566
567}
568
2a73daad
MM
569function dump_text()
570{
c8c26d5e 571 global $ftp_conn, $root_directory;
572 global $buildlogs_server, $local;
573
2a73daad
MM
574 header("Content-type: text/plain");
575
576 $f = file_name();
577
578 if ($f == false)
579 return;
580
581 echo "# src : ftp://$buildlogs_server$f\n";
c8c26d5e 582 if ($local) {
583 echo "# date : " .
584 date("Y/m/d H:i:s", filemtime("$root_directory$f")) . "\n";
2a73daad 585 } else {
c8c26d5e 586 echo "# date : " .
587 date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)) . "\n";
588 ftp_quit($ftp_conn);
589 $ftp_conn = 0;
2a73daad 590 }
e86d1be4 591
592 if (preg_match("/\.bz2$/", $f)) {
c8c26d5e 593 $filter = "bzcat";
e86d1be4 594 } elseif (preg_match("/\.gz$/", $f)) {
c8c26d5e 595 $filter = "zcat";
e86d1be4 596 } else {
c8c26d5e 597 $filter = "cat";
e86d1be4 598 }
599
c8c26d5e 600 if ($local) {
601 $cmd = "$filter $root_directory$f";
602 } else {
603 $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
604 }
605 $fd = popen($cmd, "r");
e86d1be4 606 while (($s = fgets($fd, 1000)) != false) {
607 echo $s;
608 }
609 pclose($fd);
610}
611
2a73daad
MM
612function list_archs()
613{
5d5a01de 614 global $addr, $url, $idx, $cnt,$ok,$ns;
398665bf 615
616 if (!isset($cnt))
617 $cnt = 16;
2a73daad 618
f3eff925 619 $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
d304116f 620
fca9b4c4 621 echo "<table width=\"100%\" border=\"0\">\n";
6d9948a2 622 echo "<tr><td bgcolor=\"#cccccc\" nowrap=\"nowrap\">"._("Failed")."</td><td bgcolor=\"#cccccc\">"._("Ok")."</td></tr>\n";
2a73daad 623 for ($i = 0; $i < count($addr); $i++)
fca9b4c4 624 echo "<tr><td nowrap=\"nowrap\">".
43ab2a23 625 "<a href=\"$url?idx=$i&amp;ok=0&amp;cnt=$cnt\">$addr[$i]</a></td><td nowrap=\"nowrap\">".
626 "[<a href=\"$url?idx=$i&amp;ok=1&amp;cnt=$cnt\">OK</a>]</td>".
f3eff925 627 #"<td>[<a href=\"$url?idx=$i&amp;action=qa\">qa</a>]</td>".
2a73daad
MM
628 "</tr>\n";
629 echo "</table><hr />\n";
58c74097 630
631 echo "<div align=\"center\">";
f3eff925 632 echo "<a href=\"$big_url&amp;action=adv_search\">"._("Advanced Search")."</a><br />\n";
58c74097 633
634 echo "<a href=\"$url\">main()</a><hr />\n";
7fe3a3a0 635 echo "<a href=\"http://www.pld-linux.org/\"><img src=\"powpld.png\" ".
f3eff925 636 "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
2a73daad 637 "<small>(c) 2002 ".
af6f41fb 638 "<a href=\"mailto:feedback@pld-linux.org\">PLD&nbsp;Team</a><br />\n".
6298b808 639 '$Revision: 1.88 $'.
2a73daad 640 "</small></div>\n";
c8c26d5e 641
2a73daad 642 # smile ;)
fca9b4c4 643 echo "<div align=\"center\"><small>";
2a73daad 644 $pow = array("vim", "php", "brain", "power", "electricity",
51aa6406 645 "coffee", "ufo", "penguin", "GNOME", "ELF", "DWARF",
2a73daad
MM
646 "voodoo magic", "Linux", "x-files", "X", "foobar",
647 "/dev/null", "/dev/zero", "/dev/drzewo",
648 "Leppe'", "matrix", "Neo", "PDP-11",
649 "Ken", "GNU antilope", "PDP-7", "ITS", "Multics",
51aa6406 650 "foobarbaz", "ed", "Joe", "Unix conspiracy",
2a73daad
MM
651 "overclock", "The Right Thing",
652 "The Bad Thing", "Star Treck", "NSA", "NASA",
653 "achelon", "VAX", "Real Programmer",
654 "Real Operating System", "Real Computer",
655 "computron", "bogon", "quantum bogodynamics",
e86d1be4 656 "BOFH", "/dev/ill", "nasi tu byli",
1bafb808 657 "Paranoid Android", "Lunatic Corp", "Parallel thinking",
811f3ae2
PG
658 "sfistak", "Linus", "The Golden Path", "Dark Side of the Force",
659 "Przewodniczacego Lepper-a", "KDE", "Microsoft Windows 2003"
2a73daad
MM
660 # feel free to add sth if you change this file ;)
661 );
d304116f 662 echo _("Powered by")." ";
2a73daad
MM
663 $max = 1;
664 for ($i = 0; $i < $max; $i++) {
665 $x = rand(0, count($pow) - 1);
666 if ($pow[$x] == "") $i--;
667 else echo $pow[$x] . ($i == $max - 1 ? "." : ", ");
668 $pow[$x] = "";
669 }
2a73daad 670 echo "</small></div>";
c8c26d5e 671
38299f63
MM
672 global $qa_addr;
673
5d5a01de 674 if (isset($qa_addr[$idx]) && $qa_addr[$idx] != "") {
38299f63 675 echo "<form action=\"index.php\" method=\"post\">";
aa3cba6e
AM
676 echo "<input type=\"hidden\" name=\"idx\" value=\"$idx\" />";
677 echo "<input type=\"hidden\" name=\"action\" value=\"sqa\" />";
678 echo "<input type=\"text\" size=\"14\" name=\"str\" /><br />";
679 echo "<input type=\"submit\" name=\"submit\" value=\""._("Search rpmqa!")."\" />";
38299f63
MM
680 echo "</form>";
681 }
2a73daad
MM
682}
683
38299f63 684function get_qa()
2a73daad 685{
f91d0306 686 global $idx, $qa_addr;
c8c26d5e 687
b018fce6 688 if (!isset($idx) || !isset($qa_addr[$idx]))
2a73daad
MM
689 return false;
690
b018fce6 691 $a = $qa_addr[$idx];
c8c26d5e 692
38299f63
MM
693 if ($qa_addr[$idx] == "")
694 return false;
695 else
f91d0306 696 return fopen("$qa_addr[$idx]", "r");
38299f63
MM
697}
698
699function search_qa()
700{
701 global $url, $idx, $qa_addr, $str;
702
703 $f = get_qa();
d304116f 704 echo "<h1>"._("Search results for")." '$str' "._("in")." $qa_addr[$idx]</h1>";
38299f63
MM
705
706 start_pre();
707
708 if ($f == 0) {
d304116f 709 echo _("Sorry, cannot open.");
38299f63
MM
710 } else {
711 while (($s = fgets($f, 1000)) != false) {
712 if (stristr($s, $str))
713 echo $s;
714 }
715 echo "/* EOF */";
716 }
717 end_pre();
718}
719
720function dump_qa($plain)
721{
722 global $url, $idx, $qa_addr;
c8c26d5e 723
38299f63
MM
724 $a = $qa_addr[$idx];
725
726 $f = get_qa();
c8c26d5e 727
2a73daad
MM
728 if ($plain) {
729 header("Content-type: text/plain");
d304116f 730 echo _("# rpm -qa of")." $a\n";
2a73daad 731 } else {
d304116f 732 echo "<h1>"._("rpm -qa of")." $a</h1>";
f3eff925 733 echo "<a href=\"$url?idx=$idx&amp;action=qatxt\">"._("text/plain version")."</a>";
2a73daad
MM
734 start_pre();
735 }
736
38299f63 737 if ($f == 0) {
d304116f 738 echo _("Sorry, cannot open.");
b018fce6 739 } else {
38299f63
MM
740 while (($s = fgets($f, 1000)) != false) {
741 echo $s;
742 }
2a73daad 743 }
c8c26d5e 744
2a73daad
MM
745 if (!$plain)
746 end_pre();
747}
748
58c74097 749
750function adv_search()
751{
e8aab146 752 global $addr, $url, $local, $_POST, $off, $cnt, $root_directory;
58c74097 753
f3eff925 754 $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
58c74097 755
6298b808 756 echo "<script><!--\n".
757 "function checkboxToggle() {\n".
758 "for (var i=0;i<document.forms[0].elements.length;i++) {\n".
759 "var e = document.forms[0].elements[i];\n".
760 "if ((e.name != 'all') && (e.type=='checkbox'))\n".
761 "e.checked = document.forms[0].all.checked;\n".
762 "}\n }\n -->\n </script>\n";
763
58c74097 764 echo "<form action=\"index.php?action=adv_search\" method=\"post\">";
765
fca9b4c4
AF
766 echo "<div align=\"center\">";
767 echo "<table border=\"0\">\n";
58c74097 768 echo "<tr>\n";
769 echo "<td>"._("Package name")."</td>\n";
6298b808 770 echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST["name"]."\"/></td>\n";
58c74097 771 echo "</tr>\n";
772
773 echo "<tr>\n";
774 echo "<td>"._("Days")."</td>\n";
775 echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"age1\" value=\"".$_POST["age1"]."\" /></td>\n";
776 echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"age2\" value=\"".$_POST["age2"]."\" /></td>\n";
777 echo "</tr>\n";
778
779 echo "<tr>\n";
780 echo "<td>"._("Size")."</td>\n";
781 echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"size1\" value=\"".$_POST["size1"]."\" /></td>\n";
782 echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"size2\" value=\"".$_POST["size2"]."\" /></td>\n";
783 echo "</tr>\n";
784
785 echo "<tr>\n";
786 echo "<td>"._("Search logs:")."</td>\n";
787 echo "</tr>\n";
788
789 echo "<tr>\n";
58c74097 790 echo "<td>"._("Failed")."</td>\n";
0e70bcd4 791 echo "<td>"._("OK")."</td>\n";
58c74097 792 echo "</tr>\n";
793
794 for ($i = 0; $i < count($addr); $i++)
795 {
796 echo "<tr>\n";
797 $name="as0_".$i;
f3eff925 798 $check=" checked=\"on\"";
6298b808 799 echo "<td><input name=\"$name\" id=\"$name\" type=\"checkbox\"$check /><label for=\"$name\">".$addr[$i]."</label></td>\n";
58c74097 800 $name="as1_".$i;
f3eff925 801 $check=" checked=\"on\"";
6298b808 802 echo "<td><input name=\"$name\" id=\"$name\" type=\"checkbox\"$check /><label for=\"$name\">".$addr[$i]."</label></td>\n";
58c74097 803 echo "</tr>\n";
804 }
805
806 echo "<tr>\n";
6298b808 807 echo "<td><input name=\"all\" type=\"checkbox\" checked=\"on\" onClick=\"checkboxToggle()\">"._("Toggle checkboxes")."&nbsp;<input type=\"submit\" name=\"submit\" value=\""._("Search!")."\" /></td>";
58c74097 808 echo "</tr>\n";
809
810 echo "</table>\n";
811
812// if (isset($_POST["name"]) || isset($_POST["age1"]) || isset($_POST["age2"]) ||
813// isset($_POST["size1"]) || isset($_POST["size2"]))
814 if (($_POST["name"]!="") || ($_POST["age1"]!="") || ($_POST["age2"]!="") ||
815 ($_POST["size1"]!="") || ($_POST["size2"]!=""))
816 {
817 unset($list);
818 $now = time();
819 for ($i = 0; $i < count($addr); $i++)
820
821 for ($j=0;$j<2;$j++)
822 {
823 unset($tmp_list);
824 if (isset($_POST["as".$j."_".$i]))
825 {
826 if ($local) {
827 $tmp_list = directory_list($i,$j);
828 } else {
829 $tmp_list = open_ftp($i,$j);
830 }
831 if (is_array($tmp_list))
832 {
833 while (list($k,$name)=each($tmp_list))
834 {
36783b89 835 $s = filesize("$root_directory$name[0]");
836 $t = $now - $name[1];
58c74097 837 $t/=(24*3600);
36783b89 838 if (($_POST["name"]!="") && (!preg_match("/".$_POST["name"]."/i",$name[0])))continue;
58c74097 839 if (($_POST["age1"]) && ($_POST["age1"]>$t))continue;
840 if (($_POST["age2"]) && ($_POST["age2"]<$t))continue;
841
842 if (($_POST["size1"]) && ($_POST["size1"]>$s))continue;
843 if (($_POST["size2"]) && ($_POST["size2"]<$s))continue;
844
845 $list[$i."_".$j."_".$k]=$name;
846 }
847 }
848 }
849 }
850
851 if (sizeof($list)==0)
852 {
853 echo _("Nothing found");
ecba143e 854 } else
855 {
58c74097 856
fca9b4c4 857 echo "<table border=\"0\" cellspacing=\"1\" ".
f3eff925 858 "cellpadding=3 bgcolor=\"#000000\" width=\"90%\">\n";
fca9b4c4 859 echo "<tr><th bgcolor=\"#CCCCFF\" align=\"left\" width=\"10%\">"._("Builder").
f3eff925 860 "[<a href=\"$big_url&amp;ns=2\">"._("sort")."</a>]</th>";
fca9b4c4 861 echo "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"60%\">"._("Log File").
f3eff925 862 "[<a href=\"$big_url&amp;ns=1\">"._("sort")."</a>]</th>".
fca9b4c4
AF
863 "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
864 "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
f3eff925 865 "[<a href=\"$big_url&amp;ns=0\">"._("sort")."</a>]</th>".
58c74097 866 "</th></tr>";
867
868 function cmp1($f1, $f2) {
869 global $ftp_conn, $root_directory, $local;
870 if ($local)
36783b89 871 return $f2[1] - $f1[1];
58c74097 872 return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
873 }
874
875 function cmp2($f1, $f2) {
36783b89 876 list($p11,$p12,$p13)=explode("_",$f1[0]);
877 list($p21,$p22,$p23)=explode("_",$f2[0]);
878 return strcmp($f1[0],$f2[0]);
58c74097 879 }
880
881 if ($ns == 1)
882 {
883 usort($list, "cmp1");
884// } else if ($ns == 2)
885// {
886// uksort($list, "cmp2");
887 } else
888 {
889 asort($list);
890 }
891
892 $counter=0;
893 while (list($k,$name)=each($list))
894 {
895 if (($counter<$off) || ($counter>$off+$cnt-1))
896 {
897 $counter++;
898 continue;
899 }
900
901 $counter++;
902 list($i,$j,$k)=explode("_",$k);
36783b89 903 $filename = $name[0];
58c74097 904
36783b89 905 $h = bin2hex(mhash(MHASH_MD5, $filename));
906 $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $filename);
58c74097 907 $f = preg_replace("/\.(bz2|gz)$/", "", $f);
908 if ($local) {
36783b89 909 $s = filesize("$root_directory$filename");
910 $t = $now - $name[1];
58c74097 911 } else {
912 $s = ftp_size($ftp_conn, $list[$i]);
913 $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
914 }
915 $t /= 60;
916 if ($t >= 60) {
917 $t /= 60;
918 if ($t >= 24) {
919 $t /= 24;
920 $t = round($t);
6a739fdd 921 $t = $t . "&nbsp;" . ngettext("day","days",$t);
58c74097 922 } else {
923 $t = round($t);
6a739fdd 924 $t = $t . "&nbsp;" . ngettext("hour","hours",$t);
58c74097 925 }
926 } else {
927 $t = round($t);
6a739fdd 928 $t = $t . "&nbsp;" . ngettext("minute","minutes",$t);
58c74097 929 }
f3eff925 930 $big_url = "$url?idx=$i&amp;ok=$j&amp;ns=$ns&amp;cnt=$cnt";
931 $u = "$big_url&amp;off=$off&amp;id=$h";
ecba143e 932
f0f4086d 933 $builder=$addr[$i]."/".(($j=="1")?"OK":"FAIL");
58c74097 934 echo "<tr>";
aa3cba6e
AM
935 echo "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$builder</a></td>";
936 echo "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$f</a> ".
f3eff925 937 "[<a href=\"$u&amp;action=text\">"._("text")."</a> | ".
938 "<a href=\"$u&amp;action=tail\">"._("tail")."</a>]".
aa3cba6e
AM
939 "</td><td bgcolor=\"#CCCCCC\" align=\"right\">".
940 "$s</td><td bgcolor=\"#CCCCCC\">$t</td></tr>\n";
58c74097 941 }
942 echo "</table></div>\n";
943
944 $backarr = "&lt;&lt;&lt;&nbsp;";
945 $back = _("Page back");
946 $forward = _("Page forward");
947 $forwardarr = "&nbsp;&gt;&gt;&gt;";
948
949// FIXME
950/*
f3eff925 951 echo "<p><table width=\"90%\" align=\"center\"><tr><td align=left width=1%>";
58c74097 952
953 if ($off > 0) {
954 $noff = $off - $cnt;
955 if ($noff < 0)
956 $noff = 0;
f3eff925 957 $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
58c74097 958 echo "$hrefurl$backarr</a></td><td align=left>$hrefurl$back</a>";
959 } else {
960 echo "$backarr</td><td align=left>$back";
961 }
962
f3eff925 963 echo "</td>\n<td align=\"center\">";
964 echo "</td>\n<td align=\"right\">";
58c74097 965
966 if ($off + $cnt < count($list))
967 {
968 $noff = $off + $cnt;
969 if ($noff < 0)
970 $noff = 0;
f3eff925 971 $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
972 echo "$hrefurl$forward</a></td><td align=\"right\" width=\"1%\">$hrefurl$forwardarr</a>";
58c74097 973 }
974 else
975 {
f3eff925 976 echo "$forward</td><td align=\"right\" width=\"1%\">$forwardarr";
58c74097 977 }
978
979 echo "</td>\n</tr></table></p>";
980*/
ecba143e 981 }
58c74097 982 if ($local == 0)
983 {
984 ftp_quit($ftp_conn);
985 $ftp_conn = 0;
986 }
987 } else
988 {
989 echo _("Enter something!");
990 }
991 echo "</form>\n";
992}
993
2a73daad
MM
994function welcome()
995{
996?>
f3eff925 997<table border="0" width="100%"><tr><td width="20%">&nbsp;</td><td>
d304116f 998<h1><?=_("Welcome!")?></h1>
999<p><?=_("Welcome to PLD Build Logs WWW interface.")?></p><p>
1000<?=_("Feel free to email bug reports, complaints and feature requests ")?>
ca0f7067 1001<!-- ech... niech strace... -->
7fe3a3a0
PG
1002<a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?>
1003<a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
6298b808 1004<p>Version: $Id: index.php,v 1.88 2006/09/15 18:16:37 witekfl Exp $</p>
f3eff925 1005</td><td width="20%">&nbsp;</td></tr>
2a73daad
MM
1006</table>
1007<?php
1008}
1009
1010header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
1011header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
1012header("Cache-Control: no-cache, must-revalidate");
1013header("Pragma: no-cache");
1014
1015//phpinfo();
e86d1be4 1016if ($local) {
1017 if ($action == "text") {
c8c26d5e 1018 dump_text();
58c74097 1019 } else if ($action == "adv_search") {
1020 myheader();
1021 adv_search();
1022 trailer();
e86d1be4 1023 } else if ($action == "qatxt") {
1024 dump_qa(1);
1025 } else {
1026 myheader();
fca9b4c4 1027 echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=\"top\" width=\"10%\">";
e86d1be4 1028 list_archs();
fca9b4c4 1029 echo "</td><td valign=\"top\">";
e86d1be4 1030 flush();
1031 if ($action == "qa")
1032 dump_qa(0);
38299f63
MM
1033 else if ($action == "sqa")
1034 search_qa();
e86d1be4 1035 else if (isset($id))
c8c26d5e 1036 dump_log($action == "tail");
e86d1be4 1037 else if (isset($idx))
c8c26d5e 1038 list_logs();
e86d1be4 1039 else
1040 welcome();
51aa6406 1041 echo "</td></tr></table>";
e86d1be4 1042 trailer();
1043 }
1044}
1045else {
2a73daad 1046
e86d1be4 1047 if ($action == "text") {
1048 dump_text();
1049 } else if ($action == "qatxt") {
1050 dump_qa(1);
1051 } else {
1052 myheader();
f3eff925 1053 echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=top width=\"10%\">";
e86d1be4 1054 list_archs();
fca9b4c4 1055 echo "</td><td valign=\"top\">";
e86d1be4 1056 flush();
1057 if ($action == "qa")
1058 dump_qa(0);
1059 else if (isset($id))
1060 dump_log($action == "tail");
1061 else if (isset($idx))
1062 list_logs();
1063 else
1064 welcome();
51aa6406 1065 echo "</td></tr></table>";
e86d1be4 1066 trailer();
1067 }
2a73daad
MM
1068}
1069?>
This page took 0.341982 seconds and 4 git commands to generate.