--- /dev/null
+<? require_once("inc/header.php"); ?>
+
+<table width="100%">
+<tr>
+ <td class="contentTopic">
+ Donations Received
+ </td>
+</tr>
+</table>
+<table width="90%" align="center">
+<tr>
+ <td class="content">
+ <table class="news" style="width: 99%">
+<?
+
+$max_news = 5;
+$news_counter = 0;
+
+// read file into an array and revert that
+// revert cause array_pop always gets the last element
+//
+$file = "donations.txt";
+$lines = array_reverse(file($file)) or
+ die("No newsfile!");
+
+// as long as there are lines ...
+//
+while(count($lines) > 0 && $news_counter < $max_news) {
+ // next line
+ $line = array_pop($lines);
+
+ // start of news
+ if(eregi("^[a-z0-9]+;;;", $line)) {
+ // news header
+ list($author,$date,$time) = explode(";;;",$line);
+
+ // news subject
+ $subject = array_pop($lines);
+ printf('<tr><td class="newsHeader">%s</td></tr>', $subject);
+ printf('<tr><td class="newsContent"><pre class="newsContent">');
+
+ continue;
+ }
+
+ // end of news
+ if(eregi("^;;;", $line)) {
+ printf('</pre></td></tr>');
+ printf('<tr>');
+ printf('<td class="newsFooter">%s - %s, %s</td>', $date, $time, $author);
+ printf('</tr>');
+ printf('<tr><td><img src="/images/spacer.gif" width="1px" height="15px"></td></tr>');
+ $news_counter++;
+ continue;
+ }
+
+ // news content
+ printf('%s', $line);
+}
+?>
+ </table>
+ </td>
+</tr>
+</table>
+<? require_once("inc/header.php"); ?>
--- /dev/null
+<? require_once("inc/header.php"); ?>
+
+<?php
+
+$version = $_GET["version"];
+
+$category_map = array(
+ "bacula" => "Source Code",
+ "Win32_64" => "Windows",
+ "rpms" => "Linux RPMs (official)",
+ "rpms-contrib-psheaffer" => "Linux RPMs (psheaffer)",
+ "rpms-contrib-fschwarz" => "Linux RPMs (fschwarz)",
+ "depkgs" => "Dependency package (mtx, SQLite3)",
+ "depkgs-qt" => "Dependency package (qt4 to build bat)"
+);
+
+$URL = 1;
+$CAT = 2;
+$VER = 3;
+$NAM = 4;
+$SIZ = 5;
+$DAT = 6;
+$DLS = 7;
+
+function getfiles()
+{
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, "http://sourceforge.net/projects/bacula/files/");
+ curl_setopt($ch, CURLOPT_HEADER, false);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ $res = curl_exec($ch);
+ curl_close($ch);
+
+ $res = strstr($res, "All Files");
+// echo "res=$res";
+ $res = str_replace("\n", "", $res);
+ $res = str_replace("\r", "", $res);
+
+ // get list of all available files and their attributes
+ $count = preg_match_all(
+ // cat vers name
+ "!href=\"(/projects/bacula/files/([^/]+)/([^/]+)/([^/]+)/download)\"" .
+ // size date downloads
+ ".*?<td>([\d\.]+ [a-zA-Z]+)</td>.*?<td>(.*?)</td>.*?<td>(.*?)</td>!",
+ $res, $files, PREG_SET_ORDER);
+
+ // remove duplicates (due to "latest files" list)
+ $out = array_filter_unique(
+ $files, create_function('$a,$b', 'return strcmp($a[1], $b[1]);'));
+ return $out;
+}
+
+function array_filter_unique($array, $compare)
+{
+ usort($array, $compare);
+ for ($x = 0; $x < count($array) - 1; $x++)
+ if (call_user_func($compare, $array[$x], $array[$x+1]) != 0)
+ $out[] = $array[$x];
+ if (count($array))
+ $out[] = $array[count($array) - 1]; // last one is never a dupe
+ return $out;
+}
+
+function versioncmp($a, $b)
+{
+ // [0] = entire string, [1] = major, [2] = minor, [3] = rev
+ for ($x = 1; $x < count($a); $x++)
+ {
+ if ($a[$x] < $b[$x])
+ return -1;
+ if ($a[$x] > $b[$x])
+ return 1;
+ }
+
+ return 0;
+}
+
+function getversions(&$files)
+{
+ global $VER;
+
+ // assemble version strings into their own array
+ foreach ($files as $file)
+ $versions[] = $file[$VER];
+
+ // filter out versions not matching A.B.Cd format
+ $versions = preg_grep("/^[0-9]+\.[0-9]+\.[0-9]+[a-z]?$/", $versions);
+
+ // split string into array at '.' and prepend original string
+ foreach ($versions as $version)
+ {
+ $tmp = explode(".", $version);
+ $out[] = array_merge((array)$version, $tmp);
+ }
+
+ // remove identical versions
+ $out = array_filter_unique($out, "versioncmp");
+
+ // create result array containing original strings
+ for ($x = 0; $x < count($out); $x++)
+ $out2[] = $out[$x][0];
+
+ // finally, return array in reverse order (most recent version first)
+ return array_reverse($out2);
+}
+
+$files = getfiles();
+$avail_versions = getversions($files);
+
+if ($version == "")
+ $version = $avail_versions[0];
+
+$version_ = strtr($version, ".", "_");
+
+$notes = "https://bacula.git.sourceforge.net/git/gitweb-index.cgi";
+$chglog = "http://apcupsd.cvs.sourceforge.net/viewvc/*checkout*/apcupsd/apcupsd/ChangeLog?pathrev=Release-$version_";
+$pubkey = "https://sourceforge.net/projects/apcupsd/files/apcupsd%20Public%20Key/Current%20Public%20Key/apcupsd.pub/download";
+$rpmkey = "https://sourceforge.net/projects/apcupsd/files/apcupsd%20Public%20Key/Current%20Public%20Key/rpmkey-apcupsd-0.1-3.noarch.rpm/download";
+
+echo "<html>\n";
+echo "<title>Bacula $version Downloads</title>\n";
+echo "<body>\n";
+echo "<h1>Bacula $version Downloads</h1>\n";
+echo "<form method=\"get\" action=\"/en/?page=dl&\">\n";
+echo "Other Versions:\n";
+echo "<select name=\"version\">\n";
+foreach ($avail_versions as $ver)
+{
+ echo " <option value=\"$ver\"";
+ if ($ver == $version)
+ echo " selected=\"selected\"";
+ echo ">$ver</option>\n";
+}
+echo "</select>\n";
+echo "<input type=\"submit\" value=\"Go\"></input>\n";
+echo "</form>\n";
+echo "<p>\n";
+echo "<a href=\"$notes\">Release Notes</a> | \n";
+echo "<a href=\"$chglog\">ChangeLog</a> | \n";
+echo "<a href=\"$pubkey\">Public Key</a> | \n";
+echo "<a href=\"$rpmkey\">RPM Public Key</a>\n";
+echo "<p>\n";
+
+$colors = array("#E8E8FF", "#B9B9FF");
+
+foreach ($category_map as $category => $catname)
+{
+ $color = 0;
+ $header = false;
+
+ foreach ($files as $file)
+ {
+ $isrpm = preg_match("/\.rpm$/", $file[$NAM]);
+ $issig = preg_match("/\.sig$/", $file[$NAM]);
+ $isrel = $file[$NAM] == "ReleaseNotes";
+
+ if (!$issig && !$isrel &&
+ $file[$VER] == $version && $file[$CAT] == $category)
+ {
+ // only output the table header if table won't be empty
+ if (!$header)
+ {
+ $header = true;
+ echo "<table title=\"$catname\">\n";
+ echo "<tr bgcolor=\"#2E2EFF\">\n";
+ echo " <th><font size=\"+1\" color=\"FFFFFF\">$catname</font></th>\n";
+ echo " <th><font color=\"FFFFFF\"> Signature </font></th>\n";
+ echo " <th><font color=\"FFFFFF\">Size</font></th>\n";
+ echo " <th><font color=\"FFFFFF\"> Release Date </font></th>\n";
+ echo " <th><font color=\"FFFFFF\"> Downloads </font></th>\n";
+ echo "</tr>\n";
+ }
+
+ echo "<tr bgcolor=\"$colors[$color]\">\n";
+ echo " <td><a href=\"https://sourceforge.net$file[$URL]\">$file[$NAM]</a></td></td>\n";
+ if ($isrpm)
+ echo " <td align=\"center\">N/A</td>\n";
+ else
+ echo " <td align=\"center\"><a href=\"https://sourceforge.net/projects/bacula/files/$category/$file[$VER]/$file[$NAM].sig/download\">sig</td>\n";
+ echo " <td align=\"right\">$file[$SIZ]</td>\n";
+ echo " <td align=\"center\">$file[$DAT]</td>\n";
+ echo " <td align=\"center\">$file[$DLS]</td>\n";
+ echo "</tr>\n";
+
+ $color = ($color + 1) & 1;
+ }
+ }
+
+ if ($header)
+ echo "</table><br>\n";
+}
+
+echo "</body>\n";
+echo "</html>\n";
+?>
+
+<? require_once("inc/footer.php"); ?>
--- /dev/null
+ <div>
+ <img src="../images/spacer.gif" alt="spacer" width="1px" height="50px"><br>
+ <?
+ if(isset($_SESSION['user']) && ($_SESSION['user'] == "bukdebug"))
+ print_r($_SERVER);
+ ?>
+ </div>
+ </div>
+ </body>
+</html>
--- /dev/null
+<?
+ /**
+ * grab parms from URL
+ *
+ */
+ parse_str($_SERVER['QUERY_STRING']);
+
+ /**
+ * some settings
+ *
+ */
+ isset($page) || $page = "home"; // default page to show
+ if (!preg_match("/^[a-zA-Z0-9_\-]+$/", $page)) {
+ sleep(5);
+ header("HTTP/1.0 404 Not Found");
+ exit;
+ }
+
+ $page_directory = "pages"; // directory with pages
+ $page_current = "$page_directory/$page.php";
+
+
+ /**
+ * Login
+ *
+ */
+ session_start();
+ if(isset($_POST['username']) and isset($_POST['password'])) {
+ $user = $_POST['username'];
+ $pass = $_POST['password'];
+
+ if($user == $pass) {
+ $_SESSION['user'] = $user;
+ $_SESSION['logged_in'] = true;
+ }
+ }
+
+ /**
+ * Prepare links
+ */
+ $spath = dirname($_SERVER['SCRIPT_NAME']);
+ if(strlen($spath) < 2)
+ $spath = "";
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict //EN" "http://www.w3.org/TR/html4/strict.dtd">
+
+<html>
+ <head>
+ <title> Bacula, the Open Source, Enterprise ready, Network Backup Tool for Linux, Unix, and Windows </title>
+ <link rel="stylesheet" type="text/css" href="bacula.css" title="blueish">
+ <meta name="Description" content="Bacula an Open Source network backup and restore solution">
+ <meta name="Keywords" content="Bacula, backup, restore, file backup, Open Source Backup, network backup, enterprise backup">
+ <meta name="Copyright" content="Copyright (C) 2000-2009 Kern Sibbald">
+ <meta name="Trademark" content="Bacula (R) is a registered trademark of Kern Sibbald">
+ </head>
+
+ <body>
+
+ <!-- Top Search Bar -->
+ <div class="searchBar">
+ <table class="searchBar">
+ <tr>
+ <td style="text-align: left; vertical-align: middle; width: 50%">
+ Bacula, the Open Source, Enterprise ready, Network Backup Tool for Linux, Unix, Mac and Windows.
+ </td>
+ <td style="text-align: left; vertical-align: middle">
+ <img alt="Español" src="../images/spanish-flag.png">
+
+ <a href='../en'>
+ <img alt="English" src="../images/english-flag.jpg">
+
+ <a href='../fr'>
+ <img alt="Français" src="../images/french-flag.jpg">
+ </a>
+ <a href='..//de'>
+ <img alt="Deutsch" src="../images/german-flag.jpg">
+ </a>
+
+ </td>
+ <FORM method=GET target="_blank" action=http://www.google.com/search>
+ <td style="text-align: right; vertical-align: middle">
+ <INPUT id="text" class="searchBar" type="text" name="q" size=20
+ maxlength=255 value="">
+ <INPUT id="button" class="searchBar" type="submit" name="sa" VALUE="Search">
+ <input type="hidden" name="domains" value="www.bacula.org">
+ <input type="hidden" name="sitesearch" value="www.bacula.org">
+ </td>
+ </FORM>
+ </tr>
+ </table>
+ </div>
+
+ <!-- Logo Bar -->
+ <div class="pageLogo">
+ <table class="pageLogo">
+ <tr>
+ <td style="text-align: left; vertical-align: middle">
+ <img alt="Bacula Logo" src="../images/bacu_logo-red.jpg">
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <!-- User Bar - if logged in -->
+ <?
+ if(isset($_SESSION['logged_in'])) {
+ printf('<div class="userBar">');
+ printf('Welcome %s, <a style="color: white; text-decoration: none" href="/?page=logout">logout here</a>.', $_SESSION['user']);
+ printf('</div>');
+ }
+ ?>
+
+ <!-- Menu Left -->
+ <div class="menuLeft">
+
+ <!-- General -->
+ <div class="menuHead"> General </div>
+ <div class="menuItem">
+ <ul class="menuitem">
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=news"> News </a></li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=screenshot"> Screenshots </a></li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=home"> Bacula Home </a></li>
+ <li class="menuItem"> <a href="dev-manual/What_is_Bacula.html"> What is Bacula? </a> </li>
+ <li class="menuItem"> <a href="dev-manual/Current_State_Bacula.html"> Current State of Bacula </a> </li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=testimonial"> Testimonials</a> </li>
+ <li class="menuItem"> <a href="http://sourceforge.net/projects/bacula"> SF Project Page </a> </li>
+ <li class="menuItem"> <a href="dev-manual/System_Requirements.html"> Requirements </a> </li>
+ <li class="menuItem"> <a href="dev-manual/Supported_Operating_Systems.html"> Operating Systems </a> </li>
+ <li class="menuItem"> <a href="dev-manual/Supported_Tape_Drives.html"> Tapedrives </a> </li>
+ <li class="menuItem"> <a href="dev-manual/Supported_Autochangers.html"> Autochangers </a> </li>
+ <li class="menuItem"> <a href="dev-manual/Bacula_Copyri_Tradem_Licens.html"> License </a> </li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=fsfe"> FSFE License </a></li>
+ </ul>
+ </div>
+
+ <!-- Documentation -->
+ <!-- files need a version -->
+ <div class="menuHead"> Documentation </div>
+ <div class="menuItem">
+ <ul class="menuitem">
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=documentation"> Documentation </a></li>
+ <li class="menuItem"> <a href="http://wiki.bacula.org">Wiki </a></li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=presentations"> Presentations </a></li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=presskits"> Press Kits </a></li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=articles"> Articles </a></li>
+ </ul>
+ </div>
+
+ <!-- Downloads -->
+ <div class="menuHead"> Downloads </div>
+ <div class="menuItem">
+ <ul class="menuitem">
+ <li class="menuItem"> <a href="http://sourceforge.net/project/showfiles.php?group_id=50727"> Current Files </a> </li>
+ <li class="menuItem"> <a href="http://sourceforge.net/project/showfiles.php?group_id=50727&package_id=93946"> Patches</a> </li>
+ <li class="menuItem"> <a href="http://sourceforge.net/project/showfiles.php?group_id=50727#files"> All Files </a> </li>
+ <li class="menuItem"> <a href="http://sourceforge.net/svn/?group_id=50727"> SVN Repository </a> </li>
+ </ul>
+ </div>
+
+ <!-- Support -->
+ <div class="menuHead"> Support </div>
+ <div class="menuItem">
+ <ul class="menuitem">
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=support"> Getting Support </a> </li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=maillists"> Email Lists </a> </li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=bugs"> Bug Reports </a> </li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=professional"> Professional </a></li>
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=feature-request"> Feature Requests </a></li>
+ </ul>
+ </div>
+
+ <!-- Projects -->
+ <div class="menuHead"> Projects </div>
+ <div class="menuItem">
+ <ul class="menuitem">
+ <li class="menuItem"> <a href="http://bacula.svn.sourceforge.net/viewvc/bacula/trunk/bacula/projects?view=markup"> Projects </a> </li>
+ <!--
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=vote"> Project Vote </a> </li>
+ -->
+ </ul>
+ </div>
+
+ <div class="menuHead"> Donations </div>
+ <div class="menuItem">
+ <ul class="menuitem">
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=makedonation"> Make a Donation </a> </li>
+ <!--
+ <li class="menuItem"> <a href="<? echo $spath ?>/?page=donations"> Donations Received </a> </li>
+ -->
+ </ul>
+ </div>
+ <div class="menuHead"> </div>
+ <div class="icons">
+ <a href="http://www.ukfast.net"><img src="../images/bacula_ukfast_logo.gif" alt="www.ukfast.net"></a>
+ </div>
+
+ </div>
+
+ <div class="pageTopRight">
+ It comes by night and sucks the vital essence from your computers.
+ </div>
+
+ <div class="pageContent">
--- /dev/null
+<?
+
+/**
+ * load header, menu
+ *
+ */
+require_once("inc/header.php");
+
+
+/**
+ * load content
+ *
+ */
+if(is_file($page_current)) {
+ include_once($page_current);
+} else {
+ printf('
+
+ An <b>ERROR</b> occurred:<br>
+ <p class="error">
+ The page <b>%s</b> isn\'t available.
+ </p>', $page);
+}
+
+
+/**
+ * load footer
+ *
+ */
+require_once("inc/footer.php");
+
+?>