summaryrefslogtreecommitdiffstats
path: root/website
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-06-08 14:06:41 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-06-08 14:06:41 -0400
commit066b6fd14f91959ff7272d1303ccab273d61ff6a (patch)
treebffb260b2ae6e8c03d5679bf0b654fdc8fc2b3f2 /website
parent874512b0792ad4d33020642e710e9f9df1c446ca (diff)
downloadthird_party-cobbler-066b6fd14f91959ff7272d1303ccab273d61ff6a.tar.gz
third_party-cobbler-066b6fd14f91959ff7272d1303ccab273d61ff6a.tar.xz
third_party-cobbler-066b6fd14f91959ff7272d1303ccab273d61ff6a.zip
Put cobbler website under version control, some changes still TBA
Diffstat (limited to 'website')
-rw-r--r--website/new/about.html20
-rwxr-xr-xwebsite/new/cobbler-guide.php44
-rw-r--r--website/new/cobbler.odp (renamed from website/cobbler.odp)bin22479 -> 22479 bytes
-rw-r--r--website/new/communicate.html14
-rwxr-xr-xwebsite/new/communicate.php51
-rw-r--r--website/new/css/style.css184
-rw-r--r--website/new/css/style.css~183
-rw-r--r--website/new/docs/cobbler-guide.html6
-rw-r--r--website/new/docs/cobbler.html (renamed from website/cobbler.html)0
-rw-r--r--website/new/docs/koan.html (renamed from website/koan.html)11
-rw-r--r--website/new/documentation.html24
-rwxr-xr-xwebsite/new/documentation.php44
-rw-r--r--website/new/download.html62
-rwxr-xr-xwebsite/new/download.php49
-rw-r--r--website/new/faq.html54
-rwxr-xr-xwebsite/new/faq.php48
-rw-r--r--website/new/favicon.ico (renamed from website/favicon.ico)bin318 -> 318 bytes
-rwxr-xr-xwebsite/new/feed.php31
-rw-r--r--website/new/footer.html3
-rw-r--r--website/new/img/current-page.pngbin0 -> 281 bytes
-rw-r--r--website/new/img/logo-cobbler.pngbin0 -> 15085 bytes
-rw-r--r--website/new/img/logo-cobblerpngbin0 -> 11082 bytes
-rw-r--r--website/new/img/logo-surfr.pngbin0 -> 6101 bytes
-rw-r--r--website/new/img/logo-ump.pngbin0 -> 16955 bytes
-rw-r--r--website/new/img/rss_entries.pngbin0 -> 294 bytes
-rw-r--r--website/new/img/screenshot.pngbin0 -> 6093 bytes
-rw-r--r--website/new/img/screenshot_full.pngbin0 -> 34113 bytes
-rw-r--r--website/new/img/up-arrow.gifbin0 -> 913 bytes
-rw-r--r--website/new/index.html115
-rwxr-xr-xwebsite/new/index.php44
-rw-r--r--website/new/magpierss/extlib/Snoopy.class.inc900
-rw-r--r--website/new/magpierss/rss_cache.inc200
-rw-r--r--website/new/magpierss/rss_fetch.inc458
-rw-r--r--website/new/magpierss/rss_parse.inc605
-rw-r--r--website/new/magpierss/rss_utils.inc67
-rwxr-xr-xwebsite/new/nav.php80
-rw-r--r--website/new/news-feed.php0
-rw-r--r--website/new/news.html1
-rwxr-xr-xwebsite/new/news.php70
-rwxr-xr-xwebsite/new/rss-aggregator.php73
-rwxr-xr-xwebsite/new/rss-parser.php221
-rw-r--r--website/new/top.html3
-rw-r--r--website/old/cobbler.html578
-rw-r--r--website/old/img/black-red/callout-bg.png (renamed from website/img/black-red/callout-bg.png)bin1240 -> 1240 bytes
-rw-r--r--website/old/img/black-red/content-left-bg.png (renamed from website/img/black-red/content-left-bg.png)bin203 -> 203 bytes
-rw-r--r--website/old/img/black-red/content-right-bg.png (renamed from website/img/black-red/content-right-bg.png)bin204 -> 204 bytes
-rw-r--r--website/old/img/black-red/hr.png (renamed from website/img/black-red/hr.png)bin8201 -> 8201 bytes
-rw-r--r--website/old/img/black-red/topbar-bg.png (renamed from website/img/black-red/topbar-bg.png)bin196 -> 196 bytes
-rw-r--r--website/old/img/black-red/topbar-graphic.png (renamed from website/img/black-red/topbar-graphic.png)bin8120 -> 8120 bytes
-rw-r--r--website/old/index.html (renamed from website/index.html)0
-rw-r--r--website/old/style.css (renamed from website/style.css)0
-rw-r--r--website/push.sh6
52 files changed, 4237 insertions, 12 deletions
diff --git a/website/new/about.html b/website/new/about.html
new file mode 100644
index 0000000..648fc47
--- /dev/null
+++ b/website/new/about.html
@@ -0,0 +1,20 @@
+<h2>About Cobbler</h2>
+
+<!--
+<h3>Provisioning For Everyone</h3>
+-->
+
+<!--
+<a href="img/screenshot_full.png"><img src="img/screenshot.png" style="float: left; margin-right: 10px;" /></a>
+-->
+
+<p>Cobbler is a Linux provisioning tool that allows for rapid setup of network installation environments. With a simple series of commands, network installs can be configured for PXE, reinstallations, and virtualized installs. Cobbler uses a helper program called 'Koan' for reinstalls and virtualization support.</p>
+
+<p>Installation trees can be imported directly from media you already have (or copied from a mirror location), and turned into network install sources within minutes. RHEL, Fedora, and Centos are all supported for both the boot server and installation targets.</p>
+
+<p>Cobbler can, if desired, also assist in managing of DHCP infrastructure for provisioned systems (using <A HREF="http://www.isc.org/sw/dhcp/">ISC dhcp</A> or <A HREF="http://www.thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</A>), mirroring install trees, templating kickstart files, automatically creating PXE menus, and locally mirroring software repositories used by systems on your network.</p>
+
+<p>In short, Cobbler helps build and maintain network intallation infrastructure really easily. It's highly customizable to your particular methods of operation through a wide variety of options, a pluggable extension mechanism, and (for developers) it's own Python API. Cobbler lets administrators forget <i>how</i> software gets installed and delivered and lets them concentrate instead on what they want to install where.</p>
+
+<p>Whether you run a large datacenter, a campus lab, or just have a handfull of machines on a home network, cobbler can help you do installations and updates faster.</p>
+
diff --git a/website/new/cobbler-guide.php b/website/new/cobbler-guide.php
new file mode 100755
index 0000000..99d6456
--- /dev/null
+++ b/website/new/cobbler-guide.php
@@ -0,0 +1,44 @@
+<?php
+ $current_page = 'documentation';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<title>UMP: Update and Management Platform</title>
+
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
+</head>
+
+<body>
+<div id="wrap">
+<?php
+ include("top.html");
+?>
+
+<div id="main">
+ <div id="sidebar">
+<?php
+ include("nav.php");
+?>
+ </div>
+
+<div id="content">
+<?php
+ include("docs/ump-install-setup.html");
+?>
+
+</div>
+</div>
+<div id="footer">
+<?php
+ include("footer.html");
+?>
+</div>
+</div>
+</body>
+</html>
diff --git a/website/cobbler.odp b/website/new/cobbler.odp
index 223cd04..223cd04 100644
--- a/website/cobbler.odp
+++ b/website/new/cobbler.odp
Binary files differ
diff --git a/website/new/communicate.html b/website/new/communicate.html
new file mode 100644
index 0000000..16cbf66
--- /dev/null
+++ b/website/new/communicate.html
@@ -0,0 +1,14 @@
+<h3>Mailing List</h3>
+
+<p>Send comments, questions, patches, and suggestions to the <a href="https://www.redhat.com/mailman/listinfo/et-mgmt-tools">et-mgmt-tools mailing list</a>. You can send mail even if you aren't a list member. This is a community project, so if you feel like contributing, download the source, check it out, and join the list.</p>
+
+<ul>
+<li>Mailing List Signup Form: <a href="https://www.redhat.com/mailman/listinfo/et-mgmt-tools">https://www.redhat.com/mailman/listinfo/et-mgmt-tools</a></li>
+<li>Mailling List Archives: <a href="https://www.redhat.com/archives/et-mgmt-tools/">https://www.redhat.com/archives/et-mgmt-tools/</a></li>
+<li>gmane.org RSS feed of et-mgmt-tools: <a href="http://blog.gmane.org/gmane.linux.redhat.et-mgmt-tools"><img src="img/rss_entries.png" alt="rss entries" style="vertical-align: middle;"></a></li>
+</ul>
+<h3>Internet Relay Chat (IRC)</h3>
+<p>Cobbler has a chat room on <strong><a href="http://www.freenode.net/">irc.freenode.net</a></strong> ... <strong>#cobbler</strong>:</p>
+
+<p> If no one seems to be responding to your requests in IRC, feel free to ask your questions on the mailing list. (It's quite common for IRC users to 'idle' their nicks in a channel so they can catch up on any conversation they missed later on.)</p>
+<p class="note"><strong>Note:</strong> irc.freenode.net has an IRC 'nick' (nickname, the name you go by in chat) registration system. Some irc.freenode.net channels require that you identify with the server every time you log in. This identification is also required for private messages on the network (no, they're not ignoring you; you probably just haven't identified with the registration system!) For more information, please consult <a href="http://freenode.net/faq.shtml#contents-userregistration">the Freenode Frequently-Asked Questions page on user registration</a>.</p>
diff --git a/website/new/communicate.php b/website/new/communicate.php
new file mode 100755
index 0000000..2c4371f
--- /dev/null
+++ b/website/new/communicate.php
@@ -0,0 +1,51 @@
+<?php
+ $current_page = 'communicate';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<title>UMP: Update and Management Platform</title>
+
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
+</head>
+
+<body>
+<div id="wrap">
+<?php
+ include("top.html");
+?>
+
+<div id="main">
+ <div id="sidebar">
+<?php
+ include("nav.php");
+?>
+<?php
+ include("feed.php");
+?>
+ </div>
+
+<div id="content">
+
+<h2>Communicate</h2>
+
+<?php
+ include('communicate.html');
+?>
+
+</div>
+</div>
+<div id="footer">
+<?php
+ include("footer.html");
+?>
+</div>
+</div>
+</body>
+</html>
diff --git a/website/new/css/style.css b/website/new/css/style.css
new file mode 100644
index 0000000..1d43324
--- /dev/null
+++ b/website/new/css/style.css
@@ -0,0 +1,184 @@
+body, html {
+ background-color: black;
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ min-width: 750px;
+}
+
+img {
+ border: none;
+}
+
+/* site-wide font specifications */
+
+body, ul, li, p, h1, h2, h3 {
+ font-family: "Liberation Sans", "Helvetica", "Luxi Sans", "Bitstream Vera Sans", sans-serif;
+ color: white;
+}
+
+ul {
+ list-style-type: square;
+}
+
+#sidebar {
+ height: auto;
+ float: left;
+}
+
+#sidebar p, #sidebar h2 {
+ margin-left: 24px;
+}
+
+ul#nav {
+ text-transform: uppercase;
+ letter-spacing: -.05em;
+ list-style-type: none;
+ font-family: "URW Gothic", "Liberation Sans", "Helvetica", "Luxi Sans", "Bitstream Vera Sans", sans-serif;
+}
+
+ul#nav li a {
+ color: #59cbe1;
+ text-decoration: none;
+}
+
+ul#nav li#active {
+ list-style-image: url('../img/current-page.png');
+}
+
+ul#nav li#active a, ul#nav li#active a:link, ul#nav li#active a:visited {
+ color: white;
+}
+
+div#feed {
+ width: 160px;
+ font-size: small;
+ margin-top: 28px;
+ margin-bottom: 50px;
+ border-top: 1px solid #444;
+ padding-top: 5px;
+}
+
+div#feed ul {
+ font-size: x-small;
+}
+
+
+#wrap {
+ min-width: 750px;
+ margin: 0px 3%;
+ padding-top: 12px;
+}
+
+div#main {
+ background-color: #212121;
+ border-top: 1px solid #59cbe1;
+ border-bottom: 1px solid #59cbe1;
+ overflow: auto;
+ padding: 20px 0px;
+}
+
+div#content {
+ width: 70%;
+ float: right;
+ padding: 0px 24px;
+}
+
+div#content h1 {
+ font-size: x-large;
+ font-weight: normal;
+}
+
+div#content h2 {
+ font-size: medium;
+ font-weight: 900;
+ text-transform: uppercase;
+}
+
+div#content h3 {
+ color: #59cbe1;
+}
+
+
+div#content p {
+ font-size: small;
+ color: #ccc;
+}
+
+a:link {
+ color: #59cbe1;
+}
+
+a:hover {
+ color: white;
+}
+
+a:visited {
+ color: #99d9e8;
+}
+
+
+#content p.metadata {
+ font-size: x-small;
+ color: white;
+}
+
+dt {
+ font-weight: 900;
+ margin-bottom: 1em;
+}
+
+dd {
+ color: #ccc;
+ margin-bottom: 2em;
+}
+
+.back-to-top {
+ background: url('../img/up-arrow.gif') left no-repeat;
+ padding-left: 20px;
+ font-size: small;
+}
+
+blockquote {
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ background: #444;
+ padding: 2px 4px;
+}
+
+p.note, p.tip {
+ margin: 16px 8px;
+ padding: 8px 12px;
+ color: white !important;
+ background-color: #666;
+ -moz-border-radius: 10px;
+}
+
+p.note strong, p.tip strong {
+ font-size: 120%;
+}
+
+tt {
+ font-size: 130%;
+ font-weight: 700;
+}
+
+#faq, #toc {
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ background: #444;
+ padding-top: 12px;
+ padding-bottom: 16px;
+ padding-left: 30px;
+}
+
+#footer {
+ width: 100%;
+ font-size: x-small;
+ color: #aaa;
+ text-align: center;
+ padding-top: 16px;
+ padding-bottom: 16px;
+}
diff --git a/website/new/css/style.css~ b/website/new/css/style.css~
new file mode 100644
index 0000000..f1e9b08
--- /dev/null
+++ b/website/new/css/style.css~
@@ -0,0 +1,183 @@
+body, html {
+ background-color: black;
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ min-width: 750px;
+}
+
+img {
+ border: none;
+}
+
+/* site-wide font specifications */
+
+body, ul, li, p, h1, h2, h3 {
+ font-family: "Liberation Sans", "Helvetica", "Luxi Sans", "Bitstream Vera Sans", sans-serif;
+ color: white;
+}
+
+ul {
+ list-style-type: square;
+}
+
+#sidebar {
+ height: auto;
+ float: left;
+}
+
+#sidebar p, #sidebar h2 {
+ margin-left: 24px;
+}
+
+ul#nav {
+ text-transform: uppercase;
+ letter-spacing: -.05em;
+ list-style-type: none;
+ font-family: "URW Gothic", "Liberation Sans", "Helvetica", "Luxi Sans", "Bitstream Vera Sans", sans-serif;
+}
+
+ul#nav li a {
+ color: #59cbe1;
+ text-decoration: none;
+}
+
+ul#nav li#active {
+ list-style-image: url('../img/current-page.png');
+}
+
+ul#nav li#active a, ul#nav li#active a:link, ul#nav li#active a:visited {
+ color: white;
+}
+
+div#feed {
+ width: 160px;
+ font-size: small;
+ margin-top: 28px;
+ margin-bottom: 50px;
+ border-top: 1px solid #444;
+ padding-top: 5px;
+}
+
+div#feed ul {
+ font-size: x-small;
+}
+
+
+#wrap {
+ min-width: 750px;
+ margin: 0px 3%;
+ padding-top: 12px;
+}
+
+div#main {
+ background-color: #212121;
+ border-top: 1px solid #59cbe1;
+ border-bottom: 1px solid #59cbe1;
+ overflow: auto;
+ padding: 20px 0px;
+}
+
+div#content {
+ width: 70%;
+ float: right;
+ padding: 0px 24px;
+}
+
+div#content h1 {
+ font-size: x-large;
+ font-weight: normal;
+}
+
+div#content h2 {
+ font-size: medium;
+ font-weight: 900;
+ text-transform: uppercase;
+}
+
+div#content h3 {
+ color: #59cbe1;
+}
+
+
+div#content p {
+ font-size: small;
+ color: #ccc;
+}
+
+a:link {
+ color: #59cbe1;
+}
+
+a:hover {
+ color: white;
+}
+
+a:visited {
+ color: #99d9e8;
+}
+
+
+#content p.metadata {
+ font-size: x-small;
+ color: white;
+}
+
+dt {
+ font-weight: 900;
+ margin-bottom: 1em;
+}
+
+dd {
+ color: #ccc;
+ margin-bottom: 2em;
+}
+
+.back-to-top {
+ background: url('../img/up-arrow.gif') left no-repeat;
+ padding-left: 20px;
+ font-size: small;
+}
+
+blockquote {
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ background: #444;
+ padding: 2px 4px;
+}
+
+p.note, p.tip {
+ margin: 16px 8px;
+ padding: 8px 12px;
+ color: white !important;
+ background-color: #666;
+ -moz-border-radius: 10px;
+}
+
+p.note strong, p.tip strong {
+ font-size: 120%;
+}
+
+tt {
+ font-size: 130%;
+}
+
+#faq, #toc {
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ background: #444;
+ padding-top: 12px;
+ padding-bottom: 16px;
+ padding-left: 30px;
+}
+
+#footer {
+ width: 100%;
+ font-size: x-small;
+ color: #aaa;
+ text-align: center;
+ padding-top: 16px;
+ padding-bottom: 16px;
+}
diff --git a/website/new/docs/cobbler-guide.html b/website/new/docs/cobbler-guide.html
new file mode 100644
index 0000000..1d4671f
--- /dev/null
+++ b/website/new/docs/cobbler-guide.html
@@ -0,0 +1,6 @@
+<a name="toc">
+<h2>Cobbler User Guide</h2>
+</a>
+
+Contents TBA
+
diff --git a/website/cobbler.html b/website/new/docs/cobbler.html
index a16bbc6..a16bbc6 100644
--- a/website/cobbler.html
+++ b/website/new/docs/cobbler.html
diff --git a/website/koan.html b/website/new/docs/koan.html
index 00fa982..cbd0c8c 100644
--- a/website/koan.html
+++ b/website/new/docs/koan.html
@@ -27,18 +27,15 @@
<p>
</p>
<h1><a name="name">NAME</a></h1>
-<p>koan stands for ``kickstart-over-a-network'' and allows for both
-network provisioning of new virtualized guests and destructive provisioning of
-any existing system. For use with a boot-server configured with
-'cobbler'.</p>
+<p>koan stands for ``kickstart-over-a-network'' and allows for both network provisioning of new virtualized guests and destructive provisioning of any existing system. For use with a boot-server configured with 'cobbler'.</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>koan --server=&lt;host&gt; --list-profiles</p>
<p>koan --server=&lt;host&gt; --list-systems</p>
-<p>koan --virt --server=&lt;host&gt; --profile=&lt;name&gt;</p>
-<p>koan --virt --server=&lt;host&gt; --system=&lt;name&gt;</p>
+<p>koan --virt --server=&lt;host&gt; --profile=&lt;name&gt; [--virtname=&lt;name&gt;]</p>
+<p>koan --virt --server=&lt;host&gt; --system=&lt;name&gt; [--virtname=&lt;name&gt;]</p>
<p>koan --replace-self --server=&lt;host&gt; --profile=&lt;name&gt;</p>
<p>koan --replace-self --server=&lt;host&gt; --system=&lt;name&gt;</p>
<p>
@@ -46,7 +43,7 @@ any existing system. For use with a boot-server configured with
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>When invoked, koan requests profile information from a remote boot server that has been configured with cobbler. What koan does with the profile data depends on whether it was invoked with --virt or --replace-self.</p>
-<p>For --virt, cobbler will create new virtualized guests on a machine in accordance to the orders from cobbler. You can then, once finished, use ``virsh'' and ``xm'' commands on the guest. Cobbler automatically names domains based on their mac addresses.</p>
+<p>For --virt, cobbler will create new virtualized guests on a machine in accordance to the orders from cobbler. You can then, once finished, use ``virsh'' and ``xm'' commands on the guest. Cobbler automatically names domains based on their mac addresses. To install using a more descriptive name, specify one with --virtname.</p>
<p>For re-kickstarting ('--replace-self'), cobbler will reprovisioning the system, blowing away any current data and replacing it with the results of a network install.</p>
<p>
</p>
diff --git a/website/new/documentation.html b/website/new/documentation.html
new file mode 100644
index 0000000..9f2daa0
--- /dev/null
+++ b/website/new/documentation.html
@@ -0,0 +1,24 @@
+<h2>Documentation</h2>
+
+<h3>Available Documents</h3>
+
+<p>The following docs are available for Cobbler:</p>
+
+<ul>
+<!--
+<li><a href="cobbler-guide.php">Cobbler Guide</a></li>
+-->
+<li><a href="http://et.redhat.com/page/Cobbler_Wiki">Cobbler Wiki Articles</a></li>
+<li><a href="docs/cobbler.html">Cobbler Manpage</a></li>
+<li><a href="docs/koan.html">Koan Manpage</a></li>
+</ul>
+
+</ul>
+
+<h3>Open Office Presentations</h3>
+
+<ul>
+<li><a href="docs/cobbler_sumit.odp">Red Hat Summit 5/2007</A></li>
+<li><a href="docs/cobbler.odp">Cobbler slides</A> .. somewhat dated</li>
+</ul>
+
diff --git a/website/new/documentation.php b/website/new/documentation.php
new file mode 100755
index 0000000..63ba719
--- /dev/null
+++ b/website/new/documentation.php
@@ -0,0 +1,44 @@
+<?php
+ $current_page = 'documentation';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<title>UMP: Update and Management Platform</title>
+
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
+</head>
+
+<body>
+<div id="wrap">
+<?php
+ include("top.html");
+?>
+
+<div id="main">
+ <div id="sidebar">
+<?php
+ include("nav.php");
+?>
+ </div>
+
+<div id="content">
+<?php
+ include("documentation.html");
+?>
+
+</div>
+</div>
+<div id="footer">
+<?php
+ include("footer.html");
+?>
+</div>
+</div>
+</body>
+</html>
diff --git a/website/new/download.html b/website/new/download.html
new file mode 100644
index 0000000..1f4f134
--- /dev/null
+++ b/website/new/download.html
@@ -0,0 +1,62 @@
+<p>Cobbler is licensed under the <a href="http://www.gnu.org/copyleft/gpl.html">General Public License (GPL)</a>.</p>
+
+<h3>Download Cobbler</h3>
+
+<h4>Latest Source</h4>
+<p>The latest source code (Python and Ruby-on-Rails) is available through git:</p>
+
+<blockquote>
+git clone git://et.redhat.com/cobbler<br/>
+git clone git://et.redhat.com/koan
+</blockquote>
+</p>
+
+<h4>Source RPMs</h4>
+<p>
+<blockquote>
+Source RPMS and tarballs are available <A HREF="http://cobbler.et.redhat.com/download/">here</A>
+</blockquote>
+<p>
+
+<h4>Downloading Binaries for Users of Fedora Core 5/6, and F7</h4>
+<p>
+<blockquote>
+yum install cobbler # on the boot server
+yum install koan # on target systems
+</blockquote>
+</p>
+
+<h4>Build Instructions for RHEL4</h4>
+<p>
+<blockquote>
+ <ul>
+ <li>wget http://www.python.org/pyvault/centos-4-i386/python-cheetah-0.9.18-1.el4.pyv.i386.rpm</li>
+ <li>wget http://www.python.org/pyvault/centos-4-i386/python23-cheetah-0.9.18-1.el4.pyv.i386.rpm</li>
+ <li>rpm -i python*cheetah*.rpm</li>
+ <li>wget http://cobbler.et.redhat.com/download/cobbler-$version.src.rpm</li>
+ <li>rpmbuild --rebuild cobbler-$version.src.rpm</li>
+ <li>rpm -i /usr/src/redhat/RPMS/noarch/cobbler-$version.src.rpm</li>
+ </ul>
+</blockquote>
+
+<h4>Build Instructions for RHEL5</h4>
+<p>
+<blockquote>
+ <ul>
+ <li>Grab python-setuputils from <A HREF="ftp://rpmfind.net/linux/fedora/extras/6/SRPMS/python-setuptools-0.6c5-1.fc6.src.rpm">here</A></li>
+ <li>Grab python-cheetah and yum-utils from here: <A HREF="ftp://mirror.linux.duke.edu/pub/fedora/linux/extras/6/SRPMS/">here</A></li>
+ <li>rpmbuild --rebuild those RPMs and then install them</li>
+ <li>now rebuild --rebuild and install Cobbler from it's source RPM</li>
+ </ul>
+</blockquote>
+</p>
+
+<h4>Download Instructions For Centos Users</h4>
+<p>
+<blockquote>
+Cobbler will be part of Centos Extras shortly and will then be yum installable. Until then, you will want to rebuild the source RPMs. The process will be as in RHEL, though you should get the dependencies from "yum install" instead of the above hard-coded URLs.
+</blockquote>
+</p>
+
+
+
diff --git a/website/new/download.php b/website/new/download.php
new file mode 100755
index 0000000..f33b7d6
--- /dev/null
+++ b/website/new/download.php
@@ -0,0 +1,49 @@
+<?php
+ $current_page = 'download';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<title>UMP: Update and Management Platform</title>
+
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
+</head>
+
+<body>
+<div id="wrap">
+<?php
+ include("top.html");
+?>
+
+<div id="main">
+
+<div id="sidebar">
+<?php
+ include("nav.php");
+?>
+</div>
+
+<div id="content">
+
+<h2>Download</h2>
+
+<?php
+ include('download.html');
+?>
+
+</div>
+</div>
+<div id="footer">
+<?php
+ include("footer.html");
+?>
+</div>
+</div>
+</body>
+</html>
diff --git a/website/new/faq.html b/website/new/faq.html
new file mode 100644
index 0000000..944f581
--- /dev/null
+++ b/website/new/faq.html
@@ -0,0 +1,54 @@
+
+<a name="questions">
+<h3>Questions</h3>
+</a>
+<ul id="faq">
+<li><a href="#whouses">Who Uses Cobbler?</a></li>
+<li><a href="#supported">What Operating Systems Are Supported?</a></li>
+<li><a href="#reinstalls">What are my non-PXE install options?</a></li>
+<li><a href="#virt">How are virtual systems installed?</a></li>
+<li><a href="#contribute">How can I contribute?</a></li>
+</ul>
+
+<h3>Answers</h3>
+
+<a name="whouses">
+<dt>Who Uses Cobbler?</dt>
+</a>
+ <dd>Cobbler is in use in a lot of diverse configurations. Large companies, hosting datacenters, college labs, consultants, ISVs, developers, and home Linux users all use cobbler and koan in different ways. It is intended to cover the large configurations just as easily as the smaller ones -- and be non-complex for all classes of users.
+ <br />
+ <a href="#questions" class="back-to-top">Back to top</a>
+</dd>
+<a name="supported">
+<dt>What Operating Systems Are Supported?</dt>
+</a>
+ <dd>
+Cobbler runs on RHEL 4 and later, Fedora 5 and later, and Centos 4 and later. Koan, cobbler's helper program, also works with RHEL 3.
+ <br />
+ <a href="#questions" class="back-to-top">Back to top</a>
+</dd>
+<a name="reinstalls">
+<dt>What are my non-PXE install options?</dt>
+</a>
+ <dd>Cobbler's helper program koan can be used on the target system to reinstall it's operating system to start a fully-automated reinstall of another operating system. This solution is ideal for those users who can not take advantage of PXE due to hardware, network, or policy constraints. For more information, see the <A HREF="./docs/koan.html">koan</A> manpage documentation.
+ <br />
+ <a href="#questions" class="back-to-top">Back to top</a>
+</dd>
+<a name="virt">
+<dt>How are virtual systems installed?</dt>
+</a>
+ <dd>Cobbler's helper program, koan, is invoked on the remote host system, and it pulls down information from the remote cobbler server to begin a fully automated installation of a virtual guest. This works out of the box for any distribution that contains a Xen kernel. For more information, see the <A HREF="./docs/koan.html">koan</A> manpage documentation.
+ <br />
+ <a href="#questions" class="back-to-top">Back to top</a>
+</dd>
+
+<a name="contribute">
+<dt>How can I contribute?</dt>
+</a>
+ <dd>
+Send in bug reports, patches, ideas, or comments. We're interested in hearing about your real-world provisioning challenges and how we can solve them for system administrators everywhere.
+ <br />
+ <a href="#questions" class="back-to-top">Back to top</a>
+</dd>
+
+
diff --git a/website/new/faq.php b/website/new/faq.php
new file mode 100755
index 0000000..c7a1528
--- /dev/null
+++ b/website/new/faq.php
@@ -0,0 +1,48 @@
+<?php
+ $current_page = 'faq';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<title>UMP: Update and Management Platform</title>
+
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
+</head>
+
+<body>
+<div id="wrap">
+<?php
+ include("top.html");
+?>
+
+<div id="main">
+<div id="sidebar">
+<?php
+ include("nav.php");
+?>
+</div>
+
+<div id="content">
+
+<h2>Frequently-Asked Questions</h2>
+
+<?php
+ include('faq.html');
+?>
+
+</div>
+</div>
+<div id="footer">
+<?php
+ include("footer.html");
+?>
+</div>
+</div>
+</body>
+</html>
diff --git a/website/favicon.ico b/website/new/favicon.ico
index cbb6124..cbb6124 100644
--- a/website/favicon.ico
+++ b/website/new/favicon.ico
Binary files differ
diff --git a/website/new/feed.php b/website/new/feed.php
new file mode 100755
index 0000000..a92f985
--- /dev/null
+++ b/website/new/feed.php
@@ -0,0 +1,31 @@
+<div id="feed">
+<p>Below are the latest 3 message subjects from the <a href="https://www.redhat.com/mailman/listinfo/et-mgmt-tools">et-mgmt-tools list</a>:</p>
+<ul>
+<?php
+
+require_once('magpierss/rss_fetch.inc');
+
+$url = 'http://rss.gmane.org/gmane.linux.redhat.et-mgmt-tools';
+$rss = fetch_rss($url);
+
+ for ($i = 0; $i < 3; $i++)
+ {
+ $item_array = $rss->items;
+ $item = $item_array[$i];
+ $href = $item['link'];
+ $title = $item['title'];
+ $body = $item['description'];
+ $author = $item['dc']['creator'];
+ $raw_timestamp = $item['dc']['date'];
+ $unixtime = strtotime($raw_timestamp);
+ $timestamp = date('g:i A T j F Y', $unixtime);
+
+ echo "<li><a href=$href>$title</a></li>";
+ }
+
+
+?>
+</ul>
+<p>
+[ <a href="https://www.redhat.com/archives/et-mgmt-tools/">View More ...</a> ]</p>
+</div>
diff --git a/website/new/footer.html b/website/new/footer.html
new file mode 100644
index 0000000..f5d06cc
--- /dev/null
+++ b/website/new/footer.html
@@ -0,0 +1,3 @@
+<p>Copyright &copy; 2007 Red Hat, Inc. and others.
+A project from the <a href="http://et.redhat.com/">Red Hat Emerging Technologies Group</a>.<br />
+Website design is <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0</a>.
diff --git a/website/new/img/current-page.png b/website/new/img/current-page.png
new file mode 100644
index 0000000..0dc6ca1
--- /dev/null
+++ b/website/new/img/current-page.png
Binary files differ
diff --git a/website/new/img/logo-cobbler.png b/website/new/img/logo-cobbler.png
new file mode 100644
index 0000000..f8fe53c
--- /dev/null
+++ b/website/new/img/logo-cobbler.png
Binary files differ
diff --git a/website/new/img/logo-cobblerpng b/website/new/img/logo-cobblerpng
new file mode 100644
index 0000000..93ec100
--- /dev/null
+++ b/website/new/img/logo-cobblerpng
Binary files differ
diff --git a/website/new/img/logo-surfr.png b/website/new/img/logo-surfr.png
new file mode 100644
index 0000000..ff9a1d8
--- /dev/null
+++ b/website/new/img/logo-surfr.png
Binary files differ
diff --git a/website/new/img/logo-ump.png b/website/new/img/logo-ump.png
new file mode 100644
index 0000000..3998e14
--- /dev/null
+++ b/website/new/img/logo-ump.png
Binary files differ
diff --git a/website/new/img/rss_entries.png b/website/new/img/rss_entries.png
new file mode 100644
index 0000000..373df52
--- /dev/null
+++ b/website/new/img/rss_entries.png
Binary files differ
diff --git a/website/new/img/screenshot.png b/website/new/img/screenshot.png
new file mode 100644
index 0000000..6cbaf0b
--- /dev/null
+++ b/website/new/img/screenshot.png
Binary files differ
diff --git a/website/new/img/screenshot_full.png b/website/new/img/screenshot_full.png
new file mode 100644
index 0000000..b6ef574
--- /dev/null
+++ b/website/new/img/screenshot_full.png
Binary files differ
diff --git a/website/new/img/up-arrow.gif b/website/new/img/up-arrow.gif
new file mode 100644
index 0000000..6f6ffcd
--- /dev/null
+++ b/website/new/img/up-arrow.gif
Binary files differ
diff --git a/website/new/index.html b/website/new/index.html
new file mode 100644
index 0000000..5638630
--- /dev/null
+++ b/website/new/index.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<!--
+<link rel="alternate" type="application/rss+xml" title="RSS feed" href="??" />
+<link rel="stylesheet" type="text/css" href="/css/print.css" media="print" />
+-->
+<title>UMP: Update and Management Platform</title>
+
+<!--
+ <link rel="stylesheet" href="/css/home.css" type="text/css" media="all" />
+-->
+
+<style type="text/css">
+
+body {
+ background-color: black;
+}
+
+img {
+ border: none;
+}
+
+/* site-wide font specifications */
+
+body, ul, li, p, h1, h2, h3 {
+ font-family: "Liberation Sans", "Helvetica", "Luxi Sans", "Bitstream Vera Sans", sans-serif;
+ color: white;
+}
+
+ul#nav {
+ text-transform: uppercase;
+ letter-spacing: -.05em;
+ list-style-type: none;
+ font-family: "URW Gothic", "Liberation Sans", "Helvetica", "Luxi Sans", "Bitstream Vera Sans", sans-serif;
+ float: left;
+ margin-right: 32px;
+ margin-bottom: 100%;
+}
+
+ul#nav li a {
+ color: #59cbe1;
+ text-decoration: none;
+}
+
+ul#nav li#active {
+ list-style-image: url('img/current-page.png');
+}
+
+div#main {
+ background-color: #212121;
+ padding: 20px 0px;
+ margin: 0px 3%;
+ border-top: 1px solid #59cbe1;
+ border-bottom: 1px solid #59cbe1;
+}
+
+div#content {
+ width: 80%;
+}
+
+div#content h2 {
+ font-size: medium;
+ font-weight: 900;
+}
+
+div#content p {
+ font-size: small;
+ color: #ccc;
+}
+
+</style>
+
+</head>
+
+<body>
+
+<h1 id="masthead">
+<a href="/"><img src="img/logo-ump.png" alt="UMP: Update and Management Platform" /></a>
+</h1>
+
+<div id="main">
+
+ <ul id="nav">
+ <li id="active">About</li>
+ <li><a href="#">News</a></li>
+ <li><a href="#">Download</a></li>
+ <li><a href="#">FAQ</a></li>
+ <li><a href="#">Communicate</a></li>
+ </ul>
+
+<div id="content">
+
+<h2>Introducing the next generation of systems management</h2>
+
+<p>There are many systems management tools out there, including many great free and open source tools. These tools are numerous and disparate, however, making it a complex and time-consuming process to select which tools ot use and how to connect the pieces together.</p>
+
+<p>By introducing a free and open source platform upon which management tools can be built and adhere to, the Update &amp; Management Platform (UMP) will make it simpler for system administrators to choose and implement whichever management tools they desire.</p>
+
+<h2>Free to use, developed openly</h2>
+
+<p>Use UMP freely to get your system update and management tasks done. Get involved with the UMP developers or become an UMP developer in UMP's open development community to get your system update and management tasks done <strong>better</strong>.</p>
+
+<p>Your feedback is valuable to us. Let us know which UMP features are most valuable to you, which ones are not, and which ones you'd like to see. Become an UMP developer and help us reach our vision. Either way, we'd love to hear from you.</p>
+
+</div>
+
+</div>
+
+</body>
+</html>
diff --git a/website/new/index.php b/website/new/index.php
new file mode 100755
index 0000000..b0b95b0
--- /dev/null
+++ b/website/new/index.php
@@ -0,0 +1,44 @@
+<?php
+ $current_page = 'about';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<title>UMP: Update and Management Platform</title>
+
+ <link rel="stylesheet" href="./css/style.css" type="text/css" media="all" />
+</head>
+
+<body>
+<div id="wrap">
+<?php
+ include("top.html");
+?>
+
+<div id="main">
+ <div id="sidebar">
+<?php
+ include("nav.php");
+?>
+ </div>
+
+<div id="content">
+<?php
+ include("about.html");
+?>
+
+</div>
+</div>
+<div id="footer">
+<?php
+ include("footer.html");
+?>
+</div>
+</div>
+</body>
+</html>
diff --git a/website/new/magpierss/extlib/Snoopy.class.inc b/website/new/magpierss/extlib/Snoopy.class.inc
new file mode 100644
index 0000000..3ddecba
--- /dev/null
+++ b/website/new/magpierss/extlib/Snoopy.class.inc
@@ -0,0 +1,900 @@
+<?php
+
+/*************************************************
+
+Snoopy - the PHP net client
+Author: Monte Ohrt <monte@ispi.net>
+Copyright (c): 1999-2000 ispi, all rights reserved
+Version: 1.0
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+You may contact the author of Snoopy by e-mail at:
+monte@ispi.net
+
+Or, write to:
+Monte Ohrt
+CTO, ispi
+237 S. 70th suite 220
+Lincoln, NE 68510
+
+The latest version of Snoopy can be obtained from:
+http://snoopy.sourceforge.com
+
+*************************************************/
+
+class Snoopy
+{
+ /**** Public variables ****/
+
+ /* user definable vars */
+
+ var $host = "www.php.net"; // host name we are connecting to
+ var $port = 80; // port we are connecting to
+ var $proxy_host = ""; // proxy host to use
+ var $proxy_port = ""; // proxy port to use
+ var $agent = "Snoopy v1.0"; // agent we masquerade as
+ var $referer = ""; // referer info to pass
+ var $cookies = array(); // array of cookies to pass
+ // $cookies["username"]="joe";
+ var $rawheaders = array(); // array of raw headers to send
+ // $rawheaders["Content-type"]="text/html";
+
+ var $maxredirs = 5; // http redirection depth maximum. 0 = disallow
+ var $lastredirectaddr = ""; // contains address of last redirected address
+ var $offsiteok = true; // allows redirection off-site
+ var $maxframes = 0; // frame content depth maximum. 0 = disallow
+ var $expandlinks = true; // expand links to fully qualified URLs.
+ // this only applies to fetchlinks()
+ // or submitlinks()
+ var $passcookies = true; // pass set cookies back through redirects
+ // NOTE: this currently does not respect
+ // dates, domains or paths.
+
+ var $user = ""; // user for http authentication
+ var $pass = ""; // password for http authentication
+
+ // http accept types
+ var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
+
+ var $results = ""; // where the content is put
+
+ var $error = ""; // error messages sent here
+ var $response_code = ""; // response code returned from server
+ var $headers = array(); // headers returned from server sent here
+ var $maxlength = 500000; // max return data length (body)
+ var $read_timeout = 0; // timeout on read operations, in seconds
+ // supported only since PHP 4 Beta 4
+ // set to 0 to disallow timeouts
+ var $timed_out = false; // if a read operation timed out
+ var $status = 0; // http request status
+
+ var $curl_path = "/usr/bin/curl";
+ // Snoopy will use cURL for fetching
+ // SSL content if a full system path to
+ // the cURL binary is supplied here.
+ // set to false if you do not have
+ // cURL installed. See http://curl.haxx.se
+ // for details on installing cURL.
+ // Snoopy does *not* use the cURL
+ // library functions built into php,
+ // as these functions are not stable
+ // as of this Snoopy release.
+
+ // send Accept-encoding: gzip?
+ var $use_gzip = true;
+
+ /**** Private variables ****/
+
+ var $_maxlinelen = 4096; // max line length (headers)
+
+ var $_httpmethod = "GET"; // default http request method
+ var $_httpversion = "HTTP/1.0"; // default http request version
+ var $_submit_method = "POST"; // default submit method
+ var $_submit_type = "application/x-www-form-urlencoded"; // default submit type
+ var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type
+ var $_redirectaddr = false; // will be set if page fetched is a redirect
+ var $_redirectdepth = 0; // increments on an http redirect
+ var $_frameurls = array(); // frame src urls
+ var $_framedepth = 0; // increments on frame depth
+
+ var $_isproxy = false; // set if using a proxy server
+ var $_fp_timeout = 30; // timeout for socket connection
+
+/*======================================================================*\
+ Function: fetch
+ Purpose: fetch the contents of a web page
+ (and possibly other protocols in the
+ future like ftp, nntp, gopher, etc.)
+ Input: $URI the location of the page to fetch
+ Output: $this->results the output text from the fetch
+\*======================================================================*/
+
+ function fetch($URI)
+ {
+
+ //preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS);
+ $URI_PARTS = parse_url($URI);
+ if (!empty($URI_PARTS["user"]))
+ $this->user = $URI_PARTS["user"];
+ if (!empty($URI_PARTS["pass"]))
+ $this->pass = $URI_PARTS["pass"];
+
+ switch($URI_PARTS["scheme"])
+ {
+ case "http":
+ $this->host = $URI_PARTS["host"];
+ if(!empty($URI_PARTS["port"]))
+ $this->port = $URI_PARTS["port"];
+ if($this->_connect($fp))
+ {
+ if($this->_isproxy)
+ {
+ // using proxy, send entire URI
+ $this->_httprequest($URI,$fp,$URI,$this->_httpmethod);
+ }
+ else
+ {
+ $path = $URI_PARTS["path"].(isset($URI_PARTS["query"]) ? "?".$URI_PARTS["query"] : "");
+ // no proxy, send only the path
+ $this->_httprequest($path, $fp, $URI, $this->_httpmethod);
+ }
+
+ $this->_disconnect($fp);
+
+ if($this->_redirectaddr)
+ {
+ /* url was redirected, check if we've hit the max depth */
+ if($this->maxredirs > $this->_redirectdepth)
+ {
+ // only follow redirect if it's on this site, or offsiteok is true
+ if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+ {
+ /* follow the redirect */
+ $this->_redirectdepth++;
+ $this->lastredirectaddr=$this->_redirectaddr;
+ $this->fetch($this->_redirectaddr);
+ }
+ }
+ }
+
+ if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+ {
+ $frameurls = $this->_frameurls;
+ $this->_frameurls = array();
+
+ while(list(,$frameurl) = each($frameurls))
+ {
+ if($this->_framedepth < $this->maxframes)
+ {
+ $this->fetch($frameurl);
+ $this->_framedepth++;
+ }
+ else
+ break;
+ }
+ }
+ }
+ else
+ {
+ return false;
+ }
+ return true;
+ break;
+ case "https":
+ if(!$this->curl_path || (!is_executable($this->curl_path))) {
+ $this->error = "Bad curl ($this->curl_path), can't fetch HTTPS \n";
+ return false;
+ }
+ $this->host = $URI_PARTS["host"];
+ if(!empty($URI_PARTS["port"]))
+ $this->port = $URI_PARTS["port"];
+ if($this->_isproxy)
+ {
+ // using proxy, send entire URI
+ $this->_httpsrequest($URI,$URI,$this->_httpmethod);
+ }
+ else
+ {
+ $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+ // no proxy, send only the path
+ $this->_httpsrequest($path, $URI, $this->_httpmethod);
+ }
+
+ if($this->_redirectaddr)
+ {
+ /* url was redirected, check if we've hit the max depth */
+ if($this->maxredirs > $this->_redirectdepth)
+ {
+ // only follow redirect if it's on this site, or offsiteok is true
+ if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+ {
+ /* follow the redirect */
+ $this->_redirectdepth++;
+ $this->lastredirectaddr=$this->_redirectaddr;
+ $this->fetch($this->_redirectaddr);
+ }
+ }
+ }
+
+ if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+ {
+ $frameurls = $this->_frameurls;
+ $this->_frameurls = array();
+
+ while(list(,$frameurl) = each($frameurls))
+ {
+ if($this->_framedepth < $this->maxframes)
+ {
+ $this->fetch($frameurl);
+ $this->_framedepth++;
+ }
+ else
+ break;
+ }
+ }
+ return true;
+ break;
+ default:
+ // not a valid protocol
+ $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
+ return false;
+ break;
+ }
+ return true;
+ }
+
+
+
+/*======================================================================*\
+ Private functions
+\*======================================================================*/
+
+
+/*======================================================================*\
+ Function: _striplinks
+ Purpose: strip the hyperlinks from an html document
+ Input: $document document to strip.
+ Output: $match an array of the links
+\*======================================================================*/
+
+ function _striplinks($document)
+ {
+ preg_match_all("'<\s*a\s+.*href\s*=\s* # find <a href=
+ ([\"\'])? # find single or double quote
+ (?(1) (.*?)\\1 | ([^\s\>]+)) # if quote found, match up to next matching
+ # quote, otherwise match up to next space
+ 'isx",$document,$links);
+
+
+ // catenate the non-empty matches from the conditional subpattern
+
+ while(list($key,$val) = each($links[2]))
+ {
+ if(!empty($val))
+ $match[] = $val;
+ }
+
+ while(list($key,$val) = each($links[3]))
+ {
+ if(!empty($val))
+ $match[] = $val;
+ }
+
+ // return the links
+ return $match;
+ }
+
+/*======================================================================*\
+ Function: _stripform
+ Purpose: strip the form elements from an html document
+ Input: $document document to strip.
+ Output: $match an array of the links
+\*======================================================================*/
+
+ function _stripform($document)
+ {
+ preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements);
+
+ // catenate the matches
+ $match = implode("\r\n",$elements[0]);
+
+ // return the links
+ return $match;
+ }
+
+
+
+/*======================================================================*\
+ Function: _striptext
+ Purpose: strip the text from an html document
+ Input: $document document to strip.
+ Output: $text the resulting text
+\*======================================================================*/
+
+ function _striptext($document)
+ {
+
+ // I didn't use preg eval (//e) since that is only available in PHP 4.0.
+ // so, list your entities one by one here. I included some of the
+ // more common ones.
+
+ $search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript
+ "'<[\/\!]*?[^<>]*?>'si", // strip out html tags
+ "'([\r\n])[\s]+'", // strip out white space
+ "'&(quote|#34);'i", // replace html entities
+ "'&(amp|#38);'i",
+ "'&(lt|#60);'i",
+ "'&(gt|#62);'i",
+ "'&(nbsp|#160);'i",
+ "'&(iexcl|#161);'i",
+ "'&(cent|#162);'i",
+ "'&(pound|#163);'i",
+ "'&(copy|#169);'i"
+ );
+ $replace = array( "",
+ "",
+ "\\1",
+ "\"",
+ "&",
+ "<",
+ ">",
+ " ",
+ chr(161),
+ chr(162),
+ chr(163),
+ chr(169));
+
+ $text = preg_replace($search,$replace,$document);
+
+ return $text;
+ }
+
+/*======================================================================*\
+ Function: _expandlinks
+ Purpose: expand each link into a fully qualified URL
+ Input: $links the links to qualify
+ $URI the full URI to get the base from
+ Output: $expandedLinks the expanded links
+\*======================================================================*/
+
+ function _expandlinks($links,$URI)
+ {
+
+ preg_match("/^[^\?]+/",$URI,$match);
+
+ $match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]);
+
+ $search = array( "|^http://".preg_quote($this->host)."|i",
+ "|^(?!http://)(\/)?(?!mailto:)|i",
+ "|/\./|",
+ "|/[^\/]+/\.\./|"
+ );
+
+ $replace = array( "",
+ $match."/",
+ "/",
+ "/"
+ );
+
+ $expandedLinks = preg_replace($search,$replace,$links);
+
+ return $expandedLinks;
+ }
+
+/*======================================================================*\
+ Function: _httprequest
+ Purpose: go get the http data from the server
+ Input: $url the url to fetch
+ $fp the current open file pointer
+ $URI the full URI
+ $body body contents to send if any (POST)
+ Output:
+\*======================================================================*/
+
+ function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="")
+ {
+ if($this->passcookies && $this->_redirectaddr)
+ $this->setcookies();
+
+ $URI_PARTS = parse_url($URI);
+ if(empty($url))
+ $url = "/";
+ $headers = $http_method." ".$url." ".$this->_httpversion."\r\n";
+ if(!empty($this->agent))
+ $headers .= "User-Agent: ".$this->agent."\r\n";
+ if(!empty($this->host) && !isset($this->rawheaders['Host']))
+ $headers .= "Host: ".$this->host."\r\n";
+ if(!empty($this->accept))
+ $headers .= "Accept: ".$this->accept."\r\n";
+
+ if($this->use_gzip) {
+ // make sure PHP was built with --with-zlib
+ // and we can handle gzipp'ed data
+ if ( function_exists(gzinflate) ) {
+ $headers .= "Accept-encoding: gzip\r\n";
+ }
+ else {
+ trigger_error(
+ "use_gzip is on, but PHP was built without zlib support.".
+ " Requesting file(s) without gzip encoding.",
+ E_USER_NOTICE);
+ }
+ }
+
+ if(!empty($this->referer))
+ $headers .= "Referer: ".$this->referer."\r\n";
+ if(!empty($this->cookies))
+ {
+ if(!is_array($this->cookies))
+ $this->cookies = (array)$this->cookies;
+
+ reset($this->cookies);
+ if ( count($this->cookies) > 0 ) {
+ $cookie_headers .= 'Cookie: ';
+ foreach ( $this->cookies as $cookieKey => $cookieVal ) {
+ $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; ";
+ }
+ $headers .= substr($cookie_headers,0,-2) . "\r\n";
+ }
+ }
+ if(!empty($this->rawheaders))
+ {
+ if(!is_array($this->rawheaders))
+ $this->rawheaders = (array)$this->rawheaders;
+ while(list($headerKey,$headerVal) = each($this->rawheaders))
+ $headers .= $headerKey.": ".$headerVal."\r\n";
+ }
+ if(!empty($content_type)) {
+ $headers .= "Content-type: $content_type";
+ if ($content_type == "multipart/form-data")
+ $headers .= "; boundary=".$this->_mime_boundary;
+ $headers .= "\r\n";
+ }
+ if(!empty($body))
+ $headers .= "Content-length: ".strlen($body)."\r\n";
+ if(!empty($this->user) || !empty($this->pass))
+ $headers .= "Authorization: BASIC ".base64_encode($this->user.":".$this->pass)."\r\n";
+
+ $headers .= "\r\n";
+
+ // set the read timeout if needed
+ if ($this->read_timeout > 0)
+ socket_set_timeout($fp, $this->read_timeout);
+ $this->timed_out = false;
+
+ fwrite($fp,$headers.$body,strlen($headers.$body));
+
+ $this->_redirectaddr = false;
+ unset($this->headers);
+
+ // content was returned gzip encoded?
+ $is_gzipped = false;
+
+ while($currentHeader = fgets($fp,$this->_maxlinelen))
+ {
+ if ($this->read_timeout > 0 && $this->_check_timeout($fp))
+ {
+ $this->status=-100;
+ return false;
+ }
+
+ // if($currentHeader == "\r\n")
+ if(preg_match("/^\r?\n$/", $currentHeader) )
+ break;
+
+ // if a header begins with Location: or URI:, set the redirect
+ if(preg_match("/^(Location:|URI:)/i",$currentHeader))
+ {
+ // get URL portion of the redirect
+ preg_match("/^(Location:|URI:)\s+(.*)/",chop($currentHeader),$matches);
+ // look for :// in the Location header to see if hostname is included
+ if(!preg_match("|\:\/\/|",$matches[2]))
+ {
+ // no host in the path, so prepend
+ $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
+ // eliminate double slash
+ if(!preg_match("|^/|",$matches[2]))
+ $this->_redirectaddr .= "/".$matches[2];
+ else
+ $this->_redirectaddr .= $matches[2];
+ }
+ else
+ $this->_redirectaddr = $matches[2];
+ }
+
+ if(preg_match("|^HTTP/|",$currentHeader))
+ {
+ if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status))
+ {
+ $this->status= $status[1];
+ }
+ $this->response_code = $currentHeader;
+ }
+
+ if (preg_match("/Content-Encoding: gzip/", $currentHeader) ) {
+ $is_gzipped = true;
+ }
+
+ $this->headers[] = $currentHeader;
+ }
+
+ # $results = fread($fp, $this->maxlength);
+ $results = "";
+ while ( $data = fread($fp, $this->maxlength) ) {
+ $results .= $data;
+ if (
+ strlen($results) > $this->maxlength ) {
+ break;
+ }
+ }
+
+ // gunzip
+ if ( $is_gzipped ) {
+ // per http://www.php.net/manual/en/function.gzencode.php
+ $results = substr($results, 10);
+ $results = gzinflate($results);
+ }
+
+ if ($this->read_timeout > 0 && $this->_check_timeout($fp))
+ {
+ $this->status=-100;
+ return false;
+ }
+
+ // check if there is a a redirect meta tag
+
+ if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
+ {
+ $this->_redirectaddr = $this->_expandlinks($match[1],$URI);
+ }
+
+ // have we hit our frame depth and is there frame src to fetch?
+ if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
+ {
+ $this->results[] = $results;
+ for($x=0; $x<count($match[1]); $x++)
+ $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
+ }
+ // have we already fetched framed content?
+ elseif(is_array($this->results))
+ $this->results[] = $results;
+ // no framed content
+ else
+ $this->results = $results;
+
+ return true;
+ }
+
+/*======================================================================*\
+ Function: _httpsrequest
+ Purpose: go get the https data from the server using curl
+ Input: $url the url to fetch
+ $URI the full URI
+ $body body contents to send if any (POST)
+ Output:
+\*======================================================================*/
+
+ function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
+ {
+ if($this->passcookies && $this->_redirectaddr)
+ $this->setcookies();
+
+ $headers = array();
+
+ $URI_PARTS = parse_url($URI);
+ if(empty($url))
+ $url = "/";
+ // GET ... header not needed for curl
+ //$headers[] = $http_method." ".$url." ".$this->_httpversion;
+ if(!empty($this->agent))
+ $headers[] = "User-Agent: ".$this->agent;
+ if(!empty($this->host))
+ $headers[] = "Host: ".$this->host;
+ if(!empty($this->accept))
+ $headers[] = "Accept: ".$this->accept;
+ if(!empty($this->referer))
+ $headers[] = "Referer: ".$this->referer;
+ if(!empty($this->cookies))
+ {
+ if(!is_array($this->cookies))
+ $this->cookies = (array)$this->cookies;
+
+ reset($this->cookies);
+ if ( count($this->cookies) > 0 ) {
+ $cookie_str = 'Cookie: ';
+ foreach ( $this->cookies as $cookieKey => $cookieVal ) {
+ $cookie_str .= $cookieKey."=".urlencode($cookieVal)."; ";
+ }
+ $headers[] = substr($cookie_str,0,-2);
+ }
+ }
+ if(!empty($this->rawheaders))
+ {
+ if(!is_array($this->rawheaders))
+ $this->rawheaders = (array)$this->rawheaders;
+ while(list($headerKey,$headerVal) = each($this->rawheaders))
+ $headers[] = $headerKey.": ".$headerVal;
+ }
+ if(!empty($content_type)) {
+ if ($content_type == "multipart/form-data")
+ $headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary;
+ else
+ $headers[] = "Content-type: $content_type";
+ }
+ if(!empty($body))
+ $headers[] = "Content-length: ".strlen($body);
+ if(!empty($this->user) || !empty($this->pass))
+ $headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
+
+ for($curr_header = 0; $curr_header < count($headers); $curr_header++) {
+ $cmdline_params .= " -H \"".$headers[$curr_header]."\"";
+ }
+
+ if(!empty($body))
+ $cmdline_params .= " -d \"$body\"";
+
+ if($this->read_timeout > 0)
+ $cmdline_params .= " -m ".$this->read_timeout;
+
+ $headerfile = uniqid(time());
+
+ # accept self-signed certs
+ $cmdline_params .= " -k";
+ exec($this->curl_path." -D \"/tmp/$headerfile\"".escapeshellcmd($cmdline_params)." ".escapeshellcmd($URI),$results,$return);
+
+ if($return)
+ {
+ $this->error = "Error: cURL could not retrieve the document, error $return.";
+ return false;
+ }
+
+
+ $results = implode("\r\n",$results);
+
+ $result_headers = file("/tmp/$headerfile");
+
+ $this->_redirectaddr = false;
+ unset($this->headers);
+
+ for($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++)
+ {
+
+ // if a header begins with Location: or URI:, set the redirect
+ if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader]))
+ {
+ // get URL portion of the redirect
+ preg_match("/^(Location: |URI:)(.*)/",chop($result_headers[$currentHeader]),$matches);
+ // look for :// in the Location header to see if hostname is included
+ if(!preg_match("|\:\/\/|",$matches[2]))
+ {
+ // no host in the path, so prepend
+ $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
+ // eliminate double slash
+ if(!preg_match("|^/|",$matches[2]))
+ $this->_redirectaddr .= "/".$matches[2];
+ else
+ $this->_redirectaddr .= $matches[2];
+ }
+ else
+ $this->_redirectaddr = $matches[2];
+ }
+
+ if(preg_match("|^HTTP/|",$result_headers[$currentHeader]))
+ {
+ $this->response_code = $result_headers[$currentHeader];
+ if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$this->response_code, $match))
+ {
+ $this->status= $match[1];
+ }
+ }
+ $this->headers[] = $result_headers[$currentHeader];
+ }
+
+ // check if there is a a redirect meta tag
+
+ if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
+ {
+ $this->_redirectaddr = $this->_expandlinks($match[1],$URI);
+ }
+
+ // have we hit our frame depth and is there frame src to fetch?
+ if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
+ {
+ $this->results[] = $results;
+ for($x=0; $x<count($match[1]); $x++)
+ $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
+ }
+ // have we already fetched framed content?
+ elseif(is_array($this->results))
+ $this->results[] = $results;
+ // no framed content
+ else
+ $this->results = $results;
+
+ unlink("/tmp/$headerfile");
+
+ return true;
+ }
+
+/*======================================================================*\
+ Function: setcookies()
+ Purpose: set cookies for a redirection
+\*======================================================================*/
+
+ function setcookies()
+ {
+ for($x=0; $x<count($this->headers); $x++)
+ {
+ if(preg_match("/^set-cookie:[\s]+([^=]+)=([^;]+)/i", $this->headers[$x],$match))
+ $this->cookies[$match[1]] = $match[2];
+ }
+ }
+
+
+/*======================================================================*\
+ Function: _check_timeout
+ Purpose: checks whether timeout has occurred
+ Input: $fp file pointer
+\*======================================================================*/
+
+ function _check_timeout($fp)
+ {
+ if ($this->read_timeout > 0) {
+ $fp_status = socket_get_status($fp);
+ if ($fp_status["timed_out"]) {
+ $this->timed_out = true;
+ return true;
+ }
+ }
+ return false;
+ }
+
+/*======================================================================*\
+ Function: _connect
+ Purpose: make a socket connection
+ Input: $fp file pointer
+\*======================================================================*/
+
+ function _connect(&$fp)
+ {
+ if(!empty($this->proxy_host) && !empty($this->proxy_port))
+ {
+ $this->_isproxy = true;
+ $host = $this->proxy_host;
+ $port = $this->proxy_port;
+ }
+ else
+ {
+ $host = $this->host;
+ $port = $this->port;
+ }
+
+ $this->status = 0;
+
+ if($fp = fsockopen(
+ $host,
+ $port,
+ $errno,
+ $errstr,
+ $this->_fp_timeout
+ ))
+ {
+ // socket connection succeeded
+
+ return true;
+ }
+ else
+ {
+ // socket connection failed
+ $this->status = $errno;
+ switch($errno)
+ {
+ case -3:
+ $this->error="socket creation failed (-3)";
+ case -4:
+ $this->error="dns lookup failure (-4)";
+ case -5:
+ $this->error="connection refused or timed out (-5)";
+ default:
+ $this->error="connection failed (".$errno.")";
+ }
+ return false;
+ }
+ }
+/*======================================================================*\
+ Function: _disconnect
+ Purpose: disconnect a socket connection
+ Input: $fp file pointer
+\*======================================================================*/
+
+ function _disconnect($fp)
+ {
+ return(fclose($fp));
+ }
+
+
+/*======================================================================*\
+ Function: _prepare_post_body
+ Purpose: Prepare post body according to encoding type
+ Input: $formvars - form variables
+ $formfiles - form upload files
+ Output: post body
+\*======================================================================*/
+
+ function _prepare_post_body($formvars, $formfiles)
+ {
+ settype($formvars, "array");
+ settype($formfiles, "array");
+
+ if (count($formvars) == 0 && count($formfiles) == 0)
+ return;
+
+ switch ($this->_submit_type) {
+ case "application/x-www-form-urlencoded":
+ reset($formvars);
+ while(list($key,$val) = each($formvars)) {
+ if (is_array($val) || is_object($val)) {
+ while (list($cur_key, $cur_val) = each($val)) {
+ $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&";
+ }
+ } else
+ $postdata .= urlencode($key)."=".urlencode($val)."&";
+ }
+ break;
+
+ case "multipart/form-data":
+ $this->_mime_boundary = "Snoopy".md5(uniqid(microtime()));
+
+ reset($formvars);
+ while(list($key,$val) = each($formvars)) {
+ if (is_array($val) || is_object($val)) {
+ while (list($cur_key, $cur_val) = each($val)) {
+ $postdata .= "--".$this->_mime_boundary."\r\n";
+ $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n";
+ $postdata .= "$cur_val\r\n";
+ }
+ } else {
+ $postdata .= "--".$this->_mime_boundary."\r\n";
+ $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n";
+ $postdata .= "$val\r\n";
+ }
+ }
+
+ reset($formfiles);
+ while (list($field_name, $file_names) = each($formfiles)) {
+ settype($file_names, "array");
+ while (list(, $file_name) = each($file_names)) {
+ if (!is_readable($file_name)) continue;
+
+ $fp = fopen($file_name, "r");
+ $file_content = fread($fp, filesize($file_name));
+ fclose($fp);
+ $base_name = basename($file_name);
+
+ $postdata .= "--".$this->_mime_boundary."\r\n";
+ $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n";
+ $postdata .= "$file_content\r\n";
+ }
+ }
+ $postdata .= "--".$this->_mime_boundary."--\r\n";
+ break;
+ }
+
+ return $postdata;
+ }
+}
+
+?>
diff --git a/website/new/magpierss/rss_cache.inc b/website/new/magpierss/rss_cache.inc
new file mode 100644
index 0000000..b8d436c
--- /dev/null
+++ b/website/new/magpierss/rss_cache.inc
@@ -0,0 +1,200 @@
+<?php
+/*
+ * Project: MagpieRSS: a simple RSS integration tool
+ * File: rss_cache.inc, a simple, rolling(no GC), cache
+ * for RSS objects, keyed on URL.
+ * Author: Kellan Elliott-McCrea <kellan@protest.net>
+ * Version: 0.51
+ * License: GPL
+ *
+ * The lastest version of MagpieRSS can be obtained from:
+ * http://magpierss.sourceforge.net
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Magpie mailing list:
+ * http://lists.sourceforge.net/lists/listinfo/magpierss-general
+ *
+ */
+
+class RSSCache {
+ var $BASE_CACHE = './cache'; // where the cache files are stored
+ var $MAX_AGE = 3600; // when are files stale, default one hour
+ var $ERROR = ""; // accumulate error messages
+
+ function RSSCache ($base='', $age='') {
+ if ( $base ) {
+ $this->BASE_CACHE = $base;
+ }
+ if ( $age ) {
+ $this->MAX_AGE = $age;
+ }
+
+ // attempt to make the cache directory
+ if ( ! file_exists( $this->BASE_CACHE ) ) {
+ $status = @mkdir( $this->BASE_CACHE, 0755 );
+
+ // if make failed
+ if ( ! $status ) {
+ $this->error(
+ "Cache couldn't make dir '" . $this->BASE_CACHE . "'."
+ );
+ }
+ }
+ }
+
+/*=======================================================================*\
+ Function: set
+ Purpose: add an item to the cache, keyed on url
+ Input: url from wich the rss file was fetched
+ Output: true on sucess
+\*=======================================================================*/
+ function set ($url, $rss) {
+ $this->ERROR = "";
+ $cache_file = $this->file_name( $url );
+ $fp = @fopen( $cache_file, 'w' );
+
+ if ( ! $fp ) {
+ $this->error(
+ "Cache unable to open file for writing: $cache_file"
+ );
+ return 0;
+ }
+
+
+ $data = $this->serialize( $rss );
+ fwrite( $fp, $data );
+ fclose( $fp );
+
+ return $cache_file;
+ }
+
+/*=======================================================================*\
+ Function: get
+ Purpose: fetch an item from the cache
+ Input: url from wich the rss file was fetched
+ Output: cached object on HIT, false on MISS
+\*=======================================================================*/
+ function get ($url) {
+ $this->ERROR = "";
+ $cache_file = $this->file_name( $url );
+
+ if ( ! file_exists( $cache_file ) ) {
+ $this->debug(
+ "Cache doesn't contain: $url (cache file: $cache_file)"
+ );
+ return 0;
+ }
+
+ $fp = @fopen($cache_file, 'r');
+ if ( ! $fp ) {
+ $this->error(
+ "Failed to open cache file for reading: $cache_file"
+ );
+ return 0;
+ }
+
+ if ($filesize = filesize($cache_file) ) {
+ $data = fread( $fp, filesize($cache_file) );
+ $rss = $this->unserialize( $data );
+
+ return $rss;
+ }
+
+ return 0;
+ }
+
+/*=======================================================================*\
+ Function: check_cache
+ Purpose: check a url for membership in the cache
+ and whether the object is older then MAX_AGE (ie. STALE)
+ Input: url from wich the rss file was fetched
+ Output: cached object on HIT, false on MISS
+\*=======================================================================*/
+ function check_cache ( $url ) {
+ $this->ERROR = "";
+ $filename = $this->file_name( $url );
+
+ if ( file_exists( $filename ) ) {
+ // find how long ago the file was added to the cache
+ // and whether that is longer then MAX_AGE
+ $mtime = filemtime( $filename );
+ $age = time() - $mtime;
+ if ( $this->MAX_AGE > $age ) {
+ // object exists and is current
+ return 'HIT';
+ }
+ else {
+ // object exists but is old
+ return 'STALE';
+ }
+ }
+ else {
+ // object does not exist
+ return 'MISS';
+ }
+ }
+
+ function cache_age( $cache_key ) {
+ $filename = $this->file_name( $url );
+ if ( file_exists( $filename ) ) {
+ $mtime = filemtime( $filename );
+ $age = time() - $mtime;
+ return $age;
+ }
+ else {
+ return -1;
+ }
+ }
+
+/*=======================================================================*\
+ Function: serialize
+\*=======================================================================*/
+ function serialize ( $rss ) {
+ return serialize( $rss );
+ }
+
+/*=======================================================================*\
+ Function: unserialize
+\*=======================================================================*/
+ function unserialize ( $data ) {
+ return unserialize( $data );
+ }
+
+/*=======================================================================*\
+ Function: file_name
+ Purpose: map url to location in cache
+ Input: url from wich the rss file was fetched
+ Output: a file name
+\*=======================================================================*/
+ function file_name ($url) {
+ $filename = md5( $url );
+ return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );
+ }
+
+/*=======================================================================*\
+ Function: error
+ Purpose: register error
+\*=======================================================================*/
+ function error ($errormsg, $lvl=E_USER_WARNING) {
+ // append PHP's error message if track_errors enabled
+ if ( isset($php_errormsg) ) {
+ $errormsg .= " ($php_errormsg)";
+ }
+ $this->ERROR = $errormsg;
+ if ( MAGPIE_DEBUG ) {
+ trigger_error( $errormsg, $lvl);
+ }
+ else {
+ error_log( $errormsg, 0);
+ }
+ }
+
+ function debug ($debugmsg, $lvl=E_USER_NOTICE) {
+ if ( MAGPIE_DEBUG ) {
+ $this->error("MagpieRSS [debug] $debugmsg", $lvl);
+ }
+ }
+
+}
+
+?>
diff --git a/website/new/magpierss/rss_fetch.inc b/website/new/magpierss/rss_fetch.inc
new file mode 100644
index 0000000..f2fa2fa
--- /dev/null
+++ b/website/new/magpierss/rss_fetch.inc
@@ -0,0 +1,458 @@
+<?php
+/*
+ * Project: MagpieRSS: a simple RSS integration tool
+ * File: rss_fetch.inc, a simple functional interface
+ to fetching and parsing RSS files, via the
+ function fetch_rss()
+ * Author: Kellan Elliott-McCrea <kellan@protest.net>
+ * License: GPL
+ *
+ * The lastest version of MagpieRSS can be obtained from:
+ * http://magpierss.sourceforge.net
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Magpie mailing list:
+ * magpierss-general@lists.sourceforge.net
+ *
+ */
+
+// Setup MAGPIE_DIR for use on hosts that don't include
+// the current path in include_path.
+// with thanks to rajiv and smarty
+if (!defined('DIR_SEP')) {
+ define('DIR_SEP', DIRECTORY_SEPARATOR);
+}
+
+if (!defined('MAGPIE_DIR')) {
+ define('MAGPIE_DIR', dirname(__FILE__) . DIR_SEP);
+}
+
+require_once( MAGPIE_DIR . 'rss_parse.inc' );
+require_once( MAGPIE_DIR . 'rss_cache.inc' );
+
+// for including 3rd party libraries
+define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP);
+require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc');
+
+
+/*
+ * CONSTANTS - redefine these in your script to change the
+ * behaviour of fetch_rss() currently, most options effect the cache
+ *
+ * MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects?
+ * For me a built in cache was essential to creating a "PHP-like"
+ * feel to Magpie, see rss_cache.inc for rationale
+ *
+ *
+ * MAGPIE_CACHE_DIR - Where should Magpie cache parsed RSS objects?
+ * This should be a location that the webserver can write to. If this
+ * directory does not already exist Mapie will try to be smart and create
+ * it. This will often fail for permissions reasons.
+ *
+ *
+ * MAGPIE_CACHE_AGE - How long to store cached RSS objects? In seconds.
+ *
+ *
+ * MAGPIE_CACHE_FRESH_ONLY - If remote fetch fails, throw error
+ * instead of returning stale object?
+ *
+ * MAGPIE_DEBUG - Display debugging notices?
+ *
+*/
+
+
+/*=======================================================================*\
+ Function: fetch_rss:
+ Purpose: return RSS object for the give url
+ maintain the cache
+ Input: url of RSS file
+ Output: parsed RSS object (see rss_parse.inc)
+
+ NOTES ON CACHEING:
+ If caching is on (MAGPIE_CACHE_ON) fetch_rss will first check the cache.
+
+ NOTES ON RETRIEVING REMOTE FILES:
+ If conditional gets are on (MAGPIE_CONDITIONAL_GET_ON) fetch_rss will
+ return a cached object, and touch the cache object upon recieving a
+ 304.
+
+ NOTES ON FAILED REQUESTS:
+ If there is an HTTP error while fetching an RSS object, the cached
+ version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off)
+\*=======================================================================*/
+
+define('MAGPIE_VERSION', '0.72');
+
+$MAGPIE_ERROR = "";
+
+function fetch_rss ($url) {
+ // initialize constants
+ init();
+
+ if ( !isset($url) ) {
+ error("fetch_rss called without a url");
+ return false;
+ }
+
+ // if cache is disabled
+ if ( !MAGPIE_CACHE_ON ) {
+ // fetch file, and parse it
+ $resp = _fetch_remote_file( $url );
+ if ( is_success( $resp->status ) ) {
+ return _response_to_rss( $resp );
+ }
+ else {
+ error("Failed to fetch $url and cache is off");
+ return false;
+ }
+ }
+ // else cache is ON
+ else {
+ // Flow
+ // 1. check cache
+ // 2. if there is a hit, make sure its fresh
+ // 3. if cached obj fails freshness check, fetch remote
+ // 4. if remote fails, return stale object, or error
+
+ $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );
+
+ if (MAGPIE_DEBUG and $cache->ERROR) {
+ debug($cache->ERROR, E_USER_WARNING);
+ }
+
+
+ $cache_status = 0; // response of check_cache
+ $request_headers = array(); // HTTP headers to send with fetch
+ $rss = 0; // parsed RSS object
+ $errormsg = 0; // errors, if any
+
+ // store parsed XML by desired output encoding
+ // as character munging happens at parse time
+ $cache_key = $url . MAGPIE_OUTPUT_ENCODING;
+
+ if (!$cache->ERROR) {
+ // return cache HIT, MISS, or STALE
+ $cache_status = $cache->check_cache( $cache_key);
+ }
+
+ // if object cached, and cache is fresh, return cached obj
+ if ( $cache_status == 'HIT' ) {
+ $rss = $cache->get( $cache_key );
+ if ( isset($rss) and $rss ) {
+ // should be cache age
+ $rss->from_cache = 1;
+ if ( MAGPIE_DEBUG > 1) {
+ debug("MagpieRSS: Cache HIT", E_USER_NOTICE);
+ }
+ return $rss;
+ }
+ }
+
+ // else attempt a conditional get
+
+ // setup headers
+ if ( $cache_status == 'STALE' ) {
+ $rss = $cache->get( $cache_key );
+ if ( $rss and $rss->etag and $rss->last_modified ) {
+ $request_headers['If-None-Match'] = $rss->etag;
+ $request_headers['If-Last-Modified'] = $rss->last_modified;
+ }
+ }
+
+ $resp = _fetch_remote_file( $url, $request_headers );
+
+ if (isset($resp) and $resp) {
+ if ($resp->status == '304' ) {
+ // we have the most current copy
+ if ( MAGPIE_DEBUG > 1) {
+ debug("Got 304 for $url");
+ }
+ // reset cache on 304 (at minutillo insistent prodding)
+ $cache->set($cache_key, $rss);
+ return $rss;
+ }
+ elseif ( is_success( $resp->status ) ) {
+ $rss = _response_to_rss( $resp );
+ if ( $rss ) {
+ if (MAGPIE_DEBUG > 1) {
+ debug("Fetch successful");
+ }
+ // add object to cache
+ $cache->set( $cache_key, $rss );
+ return $rss;
+ }
+ }
+ else {
+ $errormsg = "Failed to fetch $url ";
+ if ( $resp->status == '-100' ) {
+ $errormsg .= "(Request timed out after " . MAGPIE_FETCH_TIME_OUT . " seconds)";
+ }
+ elseif ( $resp->error ) {
+ # compensate for Snoopy's annoying habbit to tacking
+ # on '\n'
+ $http_error = substr($resp->error, 0, -2);
+ $errormsg .= "(HTTP Error: $http_error)";
+ }
+ else {
+ $errormsg .= "(HTTP Response: " . $resp->response_code .')';
+ }
+ }
+ }
+ else {
+ $errormsg = "Unable to retrieve RSS file for unknown reasons.";
+ }
+
+ // else fetch failed
+
+ // attempt to return cached object
+ if ($rss) {
+ if ( MAGPIE_DEBUG ) {
+ debug("Returning STALE object for $url");
+ }
+ return $rss;
+ }
+
+ // else we totally failed
+ error( $errormsg );
+
+ return false;
+
+ } // end if ( !MAGPIE_CACHE_ON ) {
+} // end fetch_rss()
+
+/*=======================================================================*\
+ Function: error
+ Purpose: set MAGPIE_ERROR, and trigger error
+\*=======================================================================*/
+
+function error ($errormsg, $lvl=E_USER_WARNING) {
+ global $MAGPIE_ERROR;
+
+ // append PHP's error message if track_errors enabled
+ if ( isset($php_errormsg) ) {
+ $errormsg .= " ($php_errormsg)";
+ }
+ if ( $errormsg ) {
+ $errormsg = "MagpieRSS: $errormsg";
+ $MAGPIE_ERROR = $errormsg;
+ trigger_error( $errormsg, $lvl);
+ }
+}
+
+function debug ($debugmsg, $lvl=E_USER_NOTICE) {
+ trigger_error("MagpieRSS [debug] $debugmsg", $lvl);
+}
+
+/*=======================================================================*\
+ Function: magpie_error
+ Purpose: accessor for the magpie error variable
+\*=======================================================================*/
+function magpie_error ($errormsg="") {
+ global $MAGPIE_ERROR;
+
+ if ( isset($errormsg) and $errormsg ) {
+ $MAGPIE_ERROR = $errormsg;
+ }
+
+ return $MAGPIE_ERROR;
+}
+
+/*=======================================================================*\
+ Function: _fetch_remote_file
+ Purpose: retrieve an arbitrary remote file
+ Input: url of the remote file
+ headers to send along with the request (optional)
+ Output: an HTTP response object (see Snoopy.class.inc)
+\*=======================================================================*/
+function _fetch_remote_file ($url, $headers = "" ) {
+ // Snoopy is an HTTP client in PHP
+ $client = new Snoopy();
+ $client->agent = MAGPIE_USER_AGENT;
+ $client->read_timeout = MAGPIE_FETCH_TIME_OUT;
+ $client->use_gzip = MAGPIE_USE_GZIP;
+ if (is_array($headers) ) {
+ $client->rawheaders = $headers;
+ }
+
+ @$client->fetch($url);
+ return $client;
+
+}
+
+/*=======================================================================*\
+ Function: _response_to_rss
+ Purpose: parse an HTTP response object into an RSS object
+ Input: an HTTP response object (see Snoopy)
+ Output: parsed RSS object (see rss_parse)
+\*=======================================================================*/
+function _response_to_rss ($resp) {
+ $rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING );
+
+ // if RSS parsed successfully
+ if ( $rss and !$rss->ERROR) {
+
+ // find Etag, and Last-Modified
+ foreach($resp->headers as $h) {
+ // 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
+ if (strpos($h, ": ")) {
+ list($field, $val) = explode(": ", $h, 2);
+ }
+ else {
+ $field = $h;
+ $val = "";
+ }
+
+ if ( $field == 'ETag' ) {
+ $rss->etag = $val;
+ }
+
+ if ( $field == 'Last-Modified' ) {
+ $rss->last_modified = $val;
+ }
+ }
+
+ return $rss;
+ } // else construct error message
+ else {
+ $errormsg = "Failed to parse RSS file.";
+
+ if ($rss) {
+ $errormsg .= " (" . $rss->ERROR . ")";
+ }
+ error($errormsg);
+
+ return false;
+ } // end if ($rss and !$rss->error)
+}
+
+/*=======================================================================*\
+ Function: init
+ Purpose: setup constants with default values
+ check for user overrides
+\*=======================================================================*/
+function init () {
+ if ( defined('MAGPIE_INITALIZED') ) {
+ return;
+ }
+ else {
+ define('MAGPIE_INITALIZED', true);
+ }
+
+ if ( !defined('MAGPIE_CACHE_ON') ) {
+ define('MAGPIE_CACHE_ON', true);
+ }
+
+ if ( !defined('MAGPIE_CACHE_DIR') ) {
+ define('MAGPIE_CACHE_DIR', './cache');
+ }
+
+ if ( !defined('MAGPIE_CACHE_AGE') ) {
+ define('MAGPIE_CACHE_AGE', 60*60); // one hour
+ }
+
+ if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) {
+ define('MAGPIE_CACHE_FRESH_ONLY', false);
+ }
+
+ if ( !defined('MAGPIE_OUTPUT_ENCODING') ) {
+ define('MAGPIE_OUTPUT_ENCODING', 'ISO-8859-1');
+ }
+
+ if ( !defined('MAGPIE_INPUT_ENCODING') ) {
+ define('MAGPIE_INPUT_ENCODING', null);
+ }
+
+ if ( !defined('MAGPIE_DETECT_ENCODING') ) {
+ define('MAGPIE_DETECT_ENCODING', true);
+ }
+
+ if ( !defined('MAGPIE_DEBUG') ) {
+ define('MAGPIE_DEBUG', 0);
+ }
+
+ if ( !defined('MAGPIE_USER_AGENT') ) {
+ $ua = 'MagpieRSS/'. MAGPIE_VERSION . ' (+http://magpierss.sf.net';
+
+ if ( MAGPIE_CACHE_ON ) {
+ $ua = $ua . ')';
+ }
+ else {
+ $ua = $ua . '; No cache)';
+ }
+
+ define('MAGPIE_USER_AGENT', $ua);
+ }
+
+ if ( !defined('MAGPIE_FETCH_TIME_OUT') ) {
+ define('MAGPIE_FETCH_TIME_OUT', 5); // 5 second timeout
+ }
+
+ // use gzip encoding to fetch rss files if supported?
+ if ( !defined('MAGPIE_USE_GZIP') ) {
+ define('MAGPIE_USE_GZIP', true);
+ }
+}
+
+// NOTE: the following code should really be in Snoopy, or at least
+// somewhere other then rss_fetch!
+
+/*=======================================================================*\
+ HTTP STATUS CODE PREDICATES
+ These functions attempt to classify an HTTP status code
+ based on RFC 2616 and RFC 2518.
+
+ All of them take an HTTP status code as input, and return true or false
+
+ All this code is adapted from LWP's HTTP::Status.
+\*=======================================================================*/
+
+
+/*=======================================================================*\
+ Function: is_info
+ Purpose: return true if Informational status code
+\*=======================================================================*/
+function is_info ($sc) {
+ return $sc >= 100 && $sc < 200;
+}
+
+/*=======================================================================*\
+ Function: is_success
+ Purpose: return true if Successful status code
+\*=======================================================================*/
+function is_success ($sc) {
+ return $sc >= 200 && $sc < 300;
+}
+
+/*=======================================================================*\
+ Function: is_redirect
+ Purpose: return true if Redirection status code
+\*=======================================================================*/
+function is_redirect ($sc) {
+ return $sc >= 300 && $sc < 400;
+}
+
+/*=======================================================================*\
+ Function: is_error
+ Purpose: return true if Error status code
+\*=======================================================================*/
+function is_error ($sc) {
+ return $sc >= 400 && $sc < 600;
+}
+
+/*=======================================================================*\
+ Function: is_client_error
+ Purpose: return true if Error status code, and its a client error
+\*=======================================================================*/
+function is_client_error ($sc) {
+ return $sc >= 400 && $sc < 500;
+}
+
+/*=======================================================================*\
+ Function: is_client_error
+ Purpose: return true if Error status code, and its a server error
+\*=======================================================================*/
+function is_server_error ($sc) {
+ return $sc >= 500 && $sc < 600;
+}
+
+?>
diff --git a/website/new/magpierss/rss_parse.inc b/website/new/magpierss/rss_parse.inc
new file mode 100644
index 0000000..56d420f
--- /dev/null
+++ b/website/new/magpierss/rss_parse.inc
@@ -0,0 +1,605 @@
+<?php
+
+/**
+* Project: MagpieRSS: a simple RSS integration tool
+* File: rss_parse.inc - parse an RSS or Atom feed
+* return as a simple object.
+*
+* Handles RSS 0.9x, RSS 2.0, RSS 1.0, and Atom 0.3
+*
+* The lastest version of MagpieRSS can be obtained from:
+* http://magpierss.sourceforge.net
+*
+* For questions, help, comments, discussion, etc., please join the
+* Magpie mailing list:
+* magpierss-general@lists.sourceforge.net
+*
+* @author Kellan Elliott-McCrea <kellan@protest.net>
+* @version 0.7a
+* @license GPL
+*
+*/
+
+define('RSS', 'RSS');
+define('ATOM', 'Atom');
+
+require_once (MAGPIE_DIR . 'rss_utils.inc');
+
+/**
+* Hybrid parser, and object, takes RSS as a string and returns a simple object.
+*
+* see: rss_fetch.inc for a simpler interface with integrated caching support
+*
+*/
+class MagpieRSS {
+ var $parser;
+
+ var $current_item = array(); // item currently being parsed
+ var $items = array(); // collection of parsed items
+ var $channel = array(); // hash of channel fields
+ var $textinput = array();
+ var $image = array();
+ var $feed_type;
+ var $feed_version;
+ var $encoding = ''; // output encoding of parsed rss
+
+ var $_source_encoding = ''; // only set if we have to parse xml prolog
+
+ var $ERROR = "";
+ var $WARNING = "";
+
+ // define some constants
+
+ var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
+ var $_KNOWN_ENCODINGS = array('UTF-8', 'US-ASCII', 'ISO-8859-1');
+
+ // parser variables, useless if you're not a parser, treat as private
+ var $stack = array(); // parser stack
+ var $inchannel = false;
+ var $initem = false;
+ var $incontent = false; // if in Atom <content mode="xml"> field
+ var $intextinput = false;
+ var $inimage = false;
+ var $current_namespace = false;
+
+
+ /**
+ * Set up XML parser, parse source, and return populated RSS object..
+ *
+ * @param string $source string containing the RSS to be parsed
+ *
+ * NOTE: Probably a good idea to leave the encoding options alone unless
+ * you know what you're doing as PHP's character set support is
+ * a little weird.
+ *
+ * NOTE: A lot of this is unnecessary but harmless with PHP5
+ *
+ *
+ * @param string $output_encoding output the parsed RSS in this character
+ * set defaults to ISO-8859-1 as this is PHP's
+ * default.
+ *
+ * NOTE: might be changed to UTF-8 in future
+ * versions.
+ *
+ * @param string $input_encoding the character set of the incoming RSS source.
+ * Leave blank and Magpie will try to figure it
+ * out.
+ *
+ *
+ * @param bool $detect_encoding if false Magpie won't attempt to detect
+ * source encoding. (caveat emptor)
+ *
+ */
+ function MagpieRSS ($source, $output_encoding='ISO-8859-1',
+ $input_encoding=null, $detect_encoding=true)
+ {
+ # if PHP xml isn't compiled in, die
+ #
+ if (!function_exists('xml_parser_create')) {
+ $this->error( "Failed to load PHP's XML Extension. " .
+ "http://www.php.net/manual/en/ref.xml.php",
+ E_USER_ERROR );
+ }
+
+ list($parser, $source) = $this->create_parser($source,
+ $output_encoding, $input_encoding, $detect_encoding);
+
+
+ if (!is_resource($parser)) {
+ $this->error( "Failed to create an instance of PHP's XML parser. " .
+ "http://www.php.net/manual/en/ref.xml.php",
+ E_USER_ERROR );
+ }
+
+
+ $this->parser = $parser;
+
+ # pass in parser, and a reference to this object
+ # setup handlers
+ #
+ xml_set_object( $this->parser, $this );
+ xml_set_element_handler($this->parser,
+ 'feed_start_element', 'feed_end_element' );
+
+ xml_set_character_data_handler( $this->parser, 'feed_cdata' );
+
+ $status = xml_parse( $this->parser, $source );
+
+ if (! $status ) {
+ $errorcode = xml_get_error_code( $this->parser );
+ if ( $errorcode != XML_ERROR_NONE ) {
+ $xml_error = xml_error_string( $errorcode );
+ $error_line = xml_get_current_line_number($this->parser);
+ $error_col = xml_get_current_column_number($this->parser);
+ $errormsg = "$xml_error at line $error_line, column $error_col";
+
+ $this->error( $errormsg );
+ }
+ }
+
+ xml_parser_free( $this->parser );
+
+ $this->normalize();
+ }
+
+ function feed_start_element($p, $element, &$attrs) {
+ $el = $element = strtolower($element);
+ $attrs = array_change_key_case($attrs, CASE_LOWER);
+
+ // check for a namespace, and split if found
+ $ns = false;
+ if ( strpos( $element, ':' ) ) {
+ list($ns, $el) = split( ':', $element, 2);
+ }
+ if ( $ns and $ns != 'rdf' ) {
+ $this->current_namespace = $ns;
+ }
+
+ # if feed type isn't set, then this is first element of feed
+ # identify feed from root element
+ #
+ if (!isset($this->feed_type) ) {
+ if ( $el == 'rdf' ) {
+ $this->feed_type = RSS;
+ $this->feed_version = '1.0';
+ }
+ elseif ( $el == 'rss' ) {
+ $this->feed_type = RSS;
+ $this->feed_version = $attrs['version'];
+ }
+ elseif ( $el == 'feed' ) {
+ $this->feed_type = ATOM;
+ $this->feed_version = $attrs['version'];
+ $this->inchannel = true;
+ }
+ return;
+ }
+
+ if ( $el == 'channel' )
+ {
+ $this->inchannel = true;
+ }
+ elseif ($el == 'item' or $el == 'entry' )
+ {
+ $this->initem = true;
+ if ( isset($attrs['rdf:about']) ) {
+ $this->current_item['about'] = $attrs['rdf:about'];
+ }
+ }
+
+ // if we're in the default namespace of an RSS feed,
+ // record textinput or image fields
+ elseif (
+ $this->feed_type == RSS and
+ $this->current_namespace == '' and
+ $el == 'textinput' )
+ {
+ $this->intextinput = true;
+ }
+
+ elseif (
+ $this->feed_type == RSS and
+ $this->current_namespace == '' and
+ $el == 'image' )
+ {
+ $this->inimage = true;
+ }
+
+ # handle atom content constructs
+ elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
+ {
+ // avoid clashing w/ RSS mod_content
+ if ($el == 'content' ) {
+ $el = 'atom_content';
+ }
+
+ $this->incontent = $el;
+
+
+ }
+
+ // if inside an Atom content construct (e.g. content or summary) field treat tags as text
+ elseif ($this->feed_type == ATOM and $this->incontent )
+ {
+ // if tags are inlined, then flatten
+ $attrs_str = join(' ',
+ array_map('map_attrs',
+ array_keys($attrs),
+ array_values($attrs) ) );
+
+ $this->append_content( "<$element $attrs_str>" );
+
+ array_unshift( $this->stack, $el );
+ }
+
+ // Atom support many links per containging element.
+ // Magpie treats link elements of type rel='alternate'
+ // as being equivalent to RSS's simple link element.
+ //
+ elseif ($this->feed_type == ATOM and $el == 'link' )
+ {
+ if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
+ {
+ $link_el = 'link';
+ }
+ else {
+ $link_el = 'link_' . $attrs['rel'];
+ }
+
+ $this->append($link_el, $attrs['href']);
+ }
+ // set stack[0] to current element
+ else {
+ array_unshift($this->stack, $el);
+ }
+ }
+
+
+
+ function feed_cdata ($p, $text) {
+ if ($this->feed_type == ATOM and $this->incontent)
+ {
+ $this->append_content( $text );
+ }
+ else {
+ $current_el = join('_', array_reverse($this->stack));
+ $this->append($current_el, $text);
+ }
+ }
+
+ function feed_end_element ($p, $el) {
+ $el = strtolower($el);
+
+ if ( $el == 'item' or $el == 'entry' )
+ {
+ $this->items[] = $this->current_item;
+ $this->current_item = array();
+ $this->initem = false;
+ }
+ elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
+ {
+ $this->intextinput = false;
+ }
+ elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
+ {
+ $this->inimage = false;
+ }
+ elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
+ {
+ $this->incontent = false;
+ }
+ elseif ($el == 'channel' or $el == 'feed' )
+ {
+ $this->inchannel = false;
+ }
+ elseif ($this->feed_type == ATOM and $this->incontent ) {
+ // balance tags properly
+ // note: i don't think this is actually neccessary
+ if ( $this->stack[0] == $el )
+ {
+ $this->append_content("</$el>");
+ }
+ else {
+ $this->append_content("<$el />");
+ }
+
+ array_shift( $this->stack );
+ }
+ else {
+ array_shift( $this->stack );
+ }
+
+ $this->current_namespace = false;
+ }
+
+ function concat (&$str1, $str2="") {
+ if (!isset($str1) ) {
+ $str1="";
+ }
+ $str1 .= $str2;
+ }
+
+
+
+ function append_content($text) {
+ if ( $this->initem ) {
+ $this->concat( $this->current_item[ $this->incontent ], $text );
+ }
+ elseif ( $this->inchannel ) {
+ $this->concat( $this->channel[ $this->incontent ], $text );
+ }
+ }
+
+ // smart append - field and namespace aware
+ function append($el, $text) {
+ if (!$el) {
+ return;
+ }
+ if ( $this->current_namespace )
+ {
+ if ( $this->initem ) {
+ $this->concat(
+ $this->current_item[ $this->current_namespace ][ $el ], $text);
+ }
+ elseif ($this->inchannel) {
+ $this->concat(
+ $this->channel[ $this->current_namespace][ $el ], $text );
+ }
+ elseif ($this->intextinput) {
+ $this->concat(
+ $this->textinput[ $this->current_namespace][ $el ], $text );
+ }
+ elseif ($this->inimage) {
+ $this->concat(
+ $this->image[ $this->current_namespace ][ $el ], $text );
+ }
+ }
+ else {
+ if ( $this->initem ) {
+ $this->concat(
+ $this->current_item[ $el ], $text);
+ }
+ elseif ($this->intextinput) {
+ $this->concat(
+ $this->textinput[ $el ], $text );
+ }
+ elseif ($this->inimage) {
+ $this->concat(
+ $this->image[ $el ], $text );
+ }
+ elseif ($this->inchannel) {
+ $this->concat(
+ $this->channel[ $el ], $text );
+ }
+
+ }
+ }
+
+ function normalize () {
+ // if atom populate rss fields
+ if ( $this->is_atom() ) {
+ $this->channel['description'] = $this->channel['tagline'];
+ for ( $i = 0; $i < count($this->items); $i++) {
+ $item = $this->items[$i];
+ if ( isset($item['summary']) )
+ $item['description'] = $item['summary'];
+ if ( isset($item['atom_content']))
+ $item['content']['encoded'] = $item['atom_content'];
+
+ $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified'];
+ if ( $atom_date ) {
+ $epoch = @parse_w3cdtf($atom_date);
+ if ($epoch and $epoch > 0) {
+ $item['date_timestamp'] = $epoch;
+ }
+ }
+
+ $this->items[$i] = $item;
+ }
+ }
+ elseif ( $this->is_rss() ) {
+ $this->channel['tagline'] = $this->channel['description'];
+ for ( $i = 0; $i < count($this->items); $i++) {
+ $item = $this->items[$i];
+ if ( isset($item['description']))
+ $item['summary'] = $item['description'];
+ if ( isset($item['content']['encoded'] ) )
+ $item['atom_content'] = $item['content']['encoded'];
+
+ if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) {
+ $epoch = @parse_w3cdtf($item['dc']['date']);
+ if ($epoch and $epoch > 0) {
+ $item['date_timestamp'] = $epoch;
+ }
+ }
+ elseif ( isset($item['pubdate']) ) {
+ $epoch = @strtotime($item['pubdate']);
+ if ($epoch > 0) {
+ $item['date_timestamp'] = $epoch;
+ }
+ }
+
+ $this->items[$i] = $item;
+ }
+ }
+ }
+
+
+ function is_rss () {
+ if ( $this->feed_type == RSS ) {
+ return $this->feed_version;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function is_atom() {
+ if ( $this->feed_type == ATOM ) {
+ return $this->feed_version;
+ }
+ else {
+ return false;
+ }
+ }
+
+ /**
+ * return XML parser, and possibly re-encoded source
+ *
+ */
+ function create_parser($source, $out_enc, $in_enc, $detect) {
+ if ( substr(phpversion(),0,1) == 5) {
+ $parser = $this->php5_create_parser($in_enc, $detect);
+ }
+ else {
+ list($parser, $source) = $this->php4_create_parser($source, $in_enc, $detect);
+ }
+ if ($out_enc) {
+ $this->encoding = $out_enc;
+ xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc);
+ }
+
+ return array($parser, $source);
+ }
+
+ /**
+ * Instantiate an XML parser under PHP5
+ *
+ * PHP5 will do a fine job of detecting input encoding
+ * if passed an empty string as the encoding.
+ *
+ * All hail libxml2!
+ *
+ */
+ function php5_create_parser($in_enc, $detect) {
+ // by default php5 does a fine job of detecting input encodings
+ if(!$detect && $in_enc) {
+ return xml_parser_create($in_enc);
+ }
+ else {
+ return xml_parser_create('');
+ }
+ }
+
+ /**
+ * Instaniate an XML parser under PHP4
+ *
+ * Unfortunately PHP4's support for character encodings
+ * and especially XML and character encodings sucks. As
+ * long as the documents you parse only contain characters
+ * from the ISO-8859-1 character set (a superset of ASCII,
+ * and a subset of UTF-8) you're fine. However once you
+ * step out of that comfy little world things get mad, bad,
+ * and dangerous to know.
+ *
+ * The following code is based on SJM's work with FoF
+ * @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
+ *
+ */
+ function php4_create_parser($source, $in_enc, $detect) {
+ if ( !$detect ) {
+ return array(xml_parser_create($in_enc), $source);
+ }
+
+ if (!$in_enc) {
+ if (preg_match('/<?xml.*encoding=[\'"](.*?)[\'"].*?>/m', $source, $m)) {
+ $in_enc = strtoupper($m[1]);
+ $this->source_encoding = $in_enc;
+ }
+ else {
+ $in_enc = 'UTF-8';
+ }
+ }
+
+ if ($this->known_encoding($in_enc)) {
+ return array(xml_parser_create($in_enc), $source);
+ }
+
+ // the dectected encoding is not one of the simple encodings PHP knows
+
+ // attempt to use the iconv extension to
+ // cast the XML to a known encoding
+ // @see http://php.net/iconv
+
+ if (function_exists('iconv')) {
+ $encoded_source = iconv($in_enc,'UTF-8', $source);
+ if ($encoded_source) {
+ return array(xml_parser_create('UTF-8'), $encoded_source);
+ }
+ }
+
+ // iconv didn't work, try mb_convert_encoding
+ // @see http://php.net/mbstring
+ if(function_exists('mb_convert_encoding')) {
+ $encoded_source = mb_convert_encoding($source, 'UTF-8', $in_enc );
+ if ($encoded_source) {
+ return array(xml_parser_create('UTF-8'), $encoded_source);
+ }
+ }
+
+ // else
+ $this->error("Feed is in an unsupported character encoding. ($in_enc) " .
+ "You may see strange artifacts, and mangled characters.",
+ E_USER_NOTICE);
+
+ return array(xml_parser_create(), $source);
+ }
+
+ function known_encoding($enc) {
+ $enc = strtoupper($enc);
+ if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) {
+ return $enc;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function error ($errormsg, $lvl=E_USER_WARNING) {
+ // append PHP's error message if track_errors enabled
+ if ( isset($php_errormsg) ) {
+ $errormsg .= " ($php_errormsg)";
+ }
+ if ( MAGPIE_DEBUG ) {
+ trigger_error( $errormsg, $lvl);
+ }
+ else {
+ error_log( $errormsg, 0);
+ }
+
+ $notices = E_USER_NOTICE|E_NOTICE;
+ if ( $lvl&$notices ) {
+ $this->WARNING = $errormsg;
+ } else {
+ $this->ERROR = $errormsg;
+ }
+ }
+
+
+} // end class RSS
+
+function map_attrs($k, $v) {
+ return "$k=\"$v\"";
+}
+
+// patch to support medieval versions of PHP4.1.x,
+// courtesy, Ryan Currie, ryan@digibliss.com
+
+if (!function_exists('array_change_key_case')) {
+ define("CASE_UPPER",1);
+ define("CASE_LOWER",0);
+
+
+ function array_change_key_case($array,$case=CASE_LOWER) {
+ if ($case=CASE_LOWER) $cmd=strtolower;
+ elseif ($case=CASE_UPPER) $cmd=strtoupper;
+ foreach($array as $key=>$value) {
+ $output[$cmd($key)]=$value;
+ }
+ return $output;
+ }
+
+}
+
+?>
diff --git a/website/new/magpierss/rss_utils.inc b/website/new/magpierss/rss_utils.inc
new file mode 100644
index 0000000..2a29e72
--- /dev/null
+++ b/website/new/magpierss/rss_utils.inc
@@ -0,0 +1,67 @@
+<?php
+/*
+ * Project: MagpieRSS: a simple RSS integration tool
+ * File: rss_utils.inc, utility methods for working with RSS
+ * Author: Kellan Elliott-McCrea <kellan@protest.net>
+ * Version: 0.51
+ * License: GPL
+ *
+ * The lastest version of MagpieRSS can be obtained from:
+ * http://magpierss.sourceforge.net
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Magpie mailing list:
+ * magpierss-general@lists.sourceforge.net
+ */
+
+
+/*======================================================================*\
+ Function: parse_w3cdtf
+ Purpose: parse a W3CDTF date into unix epoch
+
+ NOTE: http://www.w3.org/TR/NOTE-datetime
+\*======================================================================*/
+
+function parse_w3cdtf ( $date_str ) {
+
+ # regex to match wc3dtf
+ $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
+
+ if ( preg_match( $pat, $date_str, $match ) ) {
+ list( $year, $month, $day, $hours, $minutes, $seconds) =
+ array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
+
+ # calc epoch for current date assuming GMT
+ $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);
+
+ $offset = 0;
+ if ( $match[10] == 'Z' ) {
+ # zulu time, aka GMT
+ }
+ else {
+ list( $tz_mod, $tz_hour, $tz_min ) =
+ array( $match[8], $match[9], $match[10]);
+
+ # zero out the variables
+ if ( ! $tz_hour ) { $tz_hour = 0; }
+ if ( ! $tz_min ) { $tz_min = 0; }
+
+ $offset_secs = (($tz_hour*60)+$tz_min)*60;
+
+ # is timezone ahead of GMT? then subtract offset
+ #
+ if ( $tz_mod == '+' ) {
+ $offset_secs = $offset_secs * -1;
+ }
+
+ $offset = $offset_secs;
+ }
+ $epoch = $epoch + $offset;
+ return $epoch;
+ }
+ else {
+ return -1;
+ }
+}
+
+?>
diff --git a/website/new/nav.php b/website/new/nav.php
new file mode 100755
index 0000000..c12a2de
--- /dev/null
+++ b/website/new/nav.php
@@ -0,0 +1,80 @@
+<?php
+
+
+ switch ($current_page) {
+
+ case "about":
+ echo "<ul id=\"nav\">
+ <li id=\"active\"><a href=\"index.php\">About</a></li>
+ <li><a href=\"news.php\">News</a></li>
+ <li><a href=\"download.php\">Download</a></li>
+ <li><a href=\"faq.php\">FAQ</a></li>
+ <li><a href=\"documentation.php\">Documentation</a></li>
+ <li><a href=\"communicate.php\">Communicate</a></li>
+ </ul>";
+ break;
+ case "news":
+ echo "<ul id=\"nav\">
+ <li><a href=\"index.php\">About</a></li>
+ <li id=\"active\"><a href=\"news.php\">News</a></li>
+ <li><a href=\"download.php\">Download</a></li>
+ <li><a href=\"faq.php\">FAQ</a></li>
+ <li><a href=\"documentation.php\">Documentation</a></li>
+ <li><a href=\"communicate.php\">Communicate</a></li>
+ </ul>";
+ break;
+ case "download":
+ echo "<ul id=\"nav\">
+ <li><a href=\"index.php\">About</a></li>
+ <li><a href=\"news.php\">News</a></li>
+ <li id=\"active\"><a href=\"#\">Download</a></li>
+ <li><a href=\"faq.php\">FAQ</a></li>
+ <li><a href=\"documentation.php\">Documentation</a></li>
+ <li><a href=\"communicate.php\">Communicate</a></li>
+ </ul>";
+ break;
+ case "faq":
+ echo "<ul id=\"nav\">
+ <li><a href=\"index.php\">About</a></li>
+ <li><a href=\"news.php\">News</a></li>
+ <li><a href=\"download.php\">Download</a></li>
+ <li id=\"active\"><a href=\"faq.php\">FAQ</a></li>
+ <li><a href=\"documentation.php\">Documentation</a></li>
+ <li><a href=\"communicate.php\">Communicate</a></li>
+ </ul>";
+ break;
+ case "communicate":
+ echo "<ul id=\"nav\">
+ <li><a href=\"index.php\">About</a></li>
+ <li><a href=\"news.php\">News</a></li>
+ <li><a href=\"download.php\">Download</a></li>
+ <li><a href=\"faq.php\">FAQ</a></li>
+ <li><a href=\"documentation.php\">Documentation</a></li>
+ <li id=\"active\"><a href=\"communicate.php\">Communicate</a></li>
+ </ul>";
+ break;
+ case "documentation":
+ echo "<ul id=\"nav\">
+ <li><a href=\"index.php\">About</a></li>
+ <li><a href=\"news.php\">News</a></li>
+ <li><a href=\"download.php\">Download</a></li>
+ <li><a href=\"faq.php\">FAQ</a></li>
+ <li id=\"active\"><a href=\"documentation.php\">Documentation</a></li>
+ <li><a href=\"communicate.php\">Communicate</a></li>
+ </ul>";
+ break;
+ default:
+ echo " <ul id=\"nav\">
+ <li id=\"active\"><a href=\"index.php\">About</a></li>
+ <li><a href=\"news.php\">News</a></li>
+ <li><a href=\"download.php\">Download</a></li>
+ <li><a href=\"faq.php\">FAQ</a></li>
+ <li><a href=\"documentation.php\">Documentation</a></li>
+ <li><a href=\"communicate.php\">Communicate</a></li>
+ </ul>";
+ break;
+
+}
+
+?>
+
diff --git a/website/new/news-feed.php b/website/new/news-feed.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/website/new/news-feed.php
diff --git a/website/new/news.html b/website/new/news.html
new file mode 100644
index 0000000..2981fd1
--- /dev/null
+++ b/website/new/news.html
@@ -0,0 +1 @@
+news goes here.
diff --git a/website/new/news.php b/website/new/news.php
new file mode 100755
index 0000000..6aa58a8
--- /dev/null
+++ b/website/new/news.php
@@ -0,0 +1,70 @@
+<?php
+ $current_page = 'news';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="description" content="" />
+<meta name="keywords" content="" />
+<title>UMP: Update and Management Platform</title>
+
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
+</head>
+
+<body>
+<div id="wrap">
+<?php
+ include("top.html");
+?>
+
+<div id="main">
+<div id="sidebar">
+<?php
+ include("nav.php");
+?>
+</div>
+
+<div id="content">
+
+<h2>News</h2>
+
+<?php
+
+require_once('magpierss/rss_fetch.inc');
+
+$url = 'http://cobbler.wordpress.com/feed/';
+$rss = fetch_rss($url);
+
+ foreach ($rss->items as $item) {
+ $href = $item['link'];
+ $title = $item['title'];
+ $body = $item['content']['encoded'];
+ $author = $item['dc']['creator'];
+ $category = $item['category'];
+ $comment_url = $item['comments'];
+ $raw_timestamp = $item['pubdate'];
+ $unixtime = strtotime($raw_timestamp);
+ $timestamp = date('g:i A T j F Y', $unixtime);
+
+ echo "<h3>$title</h3>";
+ echo "<p>$body</p>";
+ echo "<p class=\"metadata\">Posted $timestamp by $author in $category &nbsp;|&nbsp; <a href=$href>Comment on this!</a></p>";
+ }
+
+
+?>
+
+</div>
+</div>
+<div id="footer">
+<?php
+ include("footer.html");
+?>
+</div>
+</div>
+</body>
+</html>
diff --git a/website/new/rss-aggregator.php b/website/new/rss-aggregator.php
new file mode 100755
index 0000000..9cbb837
--- /dev/null
+++ b/website/new/rss-aggregator.php
@@ -0,0 +1,73 @@
+<h1>Simple RSS agregator</h1>
+<a href="http://www.webdot.cz/lastrss/">
+<img src="lastrss_button.gif" alt="" width="88" height="31" border="0">
+</a><hr>
+<!-- / Heading -->
+
+<?php
+/*
+ ======================================================================
+ lastRSS usage DEMO 3 - Simple RSS agregator
+ ----------------------------------------------------------------------
+ This example shows, how to create simple RSS agregator
+ - create lastRSS object
+ - set transparent cache
+ - show a few RSS files at once
+ ======================================================================
+*/
+
+function ShowOneRSS($url) {
+ global $rss;
+ if ($rs = $rss->get($url)) {
+ echo "<big><b><a href=\"$rs[link]\">$rs[title]</a></b></big><br />\n";
+ echo "$rs[description]<br />\n";
+
+ echo "<ul>\n";
+ foreach ($rs['items'] as $item) {
+ echo "\t<li><a href=\"$item[link]\" title=\"$item[description]\">$item[title]</a></li>\n";
+ }
+ if ($rs['items_count'] <= 0) { echo "<li>Sorry, no items found in the RSS file :-(</li>"; }
+ echo "</ul>\n";
+ }
+ else {
+ echo "Sorry: It's not possible to reach RSS file $url\n<br />";
+ // you will probably hide this message in a live version
+ }
+}
+
+// ===============================================================================
+
+// include lastRSS
+include "./rss-parser.php";
+
+// List of RSS URLs
+$rss_left = array(
+ 'http://freshmeat.net/backend/fm.rdf',
+ 'http://slashdot.org/slashdot.rdf'
+);
+$rss_right = array(
+ 'http://www.freshfolder.com/rss.php',
+ 'http://phpbuilder.com/rss_feed.php'
+);
+
+// Create lastRSS object
+$rss = new lastRSS;
+
+// Set cache dir and cache time limit (5 seconds)
+// (don't forget to chmod cahce dir to 777 to allow writing)
+$rss->cache_dir = './temp';
+$rss->cache_time = 1200;
+
+
+// Show all rss files
+echo "<table cellpadding=\"10\" border=\"0\"><tr><td width=\"50%\" valign=\"top\">";
+foreach ($rss_left as $url) {
+ ShowOneRSS($url);
+}
+echo "</td><td width=\"50%\" valign=\"top\">";
+foreach ($rss_right as $url) {
+ ShowOneRSS($url);
+}
+echo "</td></tr></table>";
+?>
+
diff --git a/website/new/rss-parser.php b/website/new/rss-parser.php
new file mode 100755
index 0000000..cfe1637
--- /dev/null
+++ b/website/new/rss-parser.php
@@ -0,0 +1,221 @@
+<?php
+/*
+ ======================================================================
+ lastRSS 0.9.1
+
+ Simple yet powerfull PHP class to parse RSS files.
+
+ by Vojtech Semecky, webmaster @ oslab . net
+
+ Latest version, features, manual and examples:
+ http://lastrss.oslab.net/
+
+ ----------------------------------------------------------------------
+ LICENSE
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License (GPL)
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ To read the license please visit http://www.gnu.org/copyleft/gpl.html
+ ======================================================================
+*/
+
+/**
+* lastRSS
+* Simple yet powerfull PHP class to parse RSS files.
+*/
+class lastRSS {
+ // -------------------------------------------------------------------
+ // Public properties
+ // -------------------------------------------------------------------
+ var $default_cp = 'UTF-8';
+ var $CDATA = 'nochange';
+ var $cp = '';
+ var $items_limit = 0;
+ var $stripHTML = False;
+ var $date_format = '';
+
+ // -------------------------------------------------------------------
+ // Private variables
+ // -------------------------------------------------------------------
+ var $channeltags = array ('title', 'link', 'description', 'language', 'copyright', 'managingEditor', 'webMaster', 'lastBuildDate', 'rating', 'docs');
+ var $itemtags = array('title', 'link', 'description', 'author', 'category', 'comments', 'enclosure', 'guid', 'pubDate', 'source');
+ var $imagetags = array('title', 'url', 'link', 'width', 'height');
+ var $textinputtags = array('title', 'description', 'name', 'link');
+
+ // -------------------------------------------------------------------
+ // Parse RSS file and returns associative array.
+ // -------------------------------------------------------------------
+ function Get ($rss_url) {
+ // If CACHE ENABLED
+ if ($this->cache_dir != '') {
+ $cache_file = $this->cache_dir . '/rsscache_' . md5($rss_url);
+ $timedif = @(time() - filemtime($cache_file));
+ if ($timedif < $this->cache_time) {
+ // cached file is fresh enough, return cached array
+ $result = unserialize(join('', file($cache_file)));
+ // set 'cached' to 1 only if cached file is correct
+ if ($result) $result['cached'] = 1;
+ } else {
+ // cached file is too old, create new
+ $result = $this->Parse($rss_url);
+ $serialized = serialize($result);
+ if ($f = @fopen($cache_file, 'w')) {
+ fwrite ($f, $serialized, strlen($serialized));
+ fclose($f);
+ }
+ if ($result) $result['cached'] = 0;
+ }
+ }
+ // If CACHE DISABLED >> load and parse the file directly
+ else {
+ $result = $this->Parse($rss_url);
+ if ($result) $result['cached'] = 0;
+ }
+ // return result
+ return $result;
+ }
+
+ // -------------------------------------------------------------------
+ // Modification of preg_match(); return trimed field with index 1
+ // from 'classic' preg_match() array output
+ // -------------------------------------------------------------------
+ function my_preg_match ($pattern, $subject) {
+ // start regullar expression
+ preg_match($pattern, $subject, $out);
+
+ // if there is some result... process it and return it
+ if(isset($out[1])) {
+ // Process CDATA (if present)
+ if ($this->CDATA == 'content') { // Get CDATA content (without CDATA tag)
+ $out[1] = strtr($out[1], array('<![CDATA['=>'', ']]>'=>''));
+ } elseif ($this->CDATA == 'strip') { // Strip CDATA
+ $out[1] = strtr($out[1], array('<![CDATA['=>'', ']]>'=>''));
+ }
+
+ // If code page is set convert character encoding to required
+ if ($this->cp != '')
+ //$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
+ $out[1] = iconv($this->rsscp, $this->cp.'//TRANSLIT', $out[1]);
+ // Return result
+ return trim($out[1]);
+ } else {
+ // if there is NO result, return empty string
+ return '';
+ }
+ }
+
+ // -------------------------------------------------------------------
+ // Replace HTML entities &something; by real characters
+ // -------------------------------------------------------------------
+ function unhtmlentities ($string) {
+ // Get HTML entities table
+ $trans_tbl = get_html_translation_table (HTML_ENTITIES, ENT_QUOTES);
+ // Flip keys<==>values
+ $trans_tbl = array_flip ($trans_tbl);
+ // Add support for &apos; entity (missing in HTML_ENTITIES)
+ $trans_tbl += array('&apos;' => "'");
+ // Replace entities by values
+ return strtr ($string, $trans_tbl);
+ }
+
+ // -------------------------------------------------------------------
+ // Parse() is private method used by Get() to load and parse RSS file.
+ // Don't use Parse() in your scripts - use Get($rss_file) instead.
+ // -------------------------------------------------------------------
+ function Parse ($rss_url) {
+ // Open and load RSS file
+ if ($f = @fopen($rss_url, 'r')) {
+ $rss_content = '';
+ while (!feof($f)) {
+ $rss_content .= fgets($f, 4096);
+ }
+ fclose($f);
+
+ // Parse document encoding
+ $result['encoding'] = $this->my_preg_match("'encoding=[\'\"](.*?)[\'\"]'si", $rss_content);
+ // if document codepage is specified, use it
+ if ($result['encoding'] != '')
+ { $this->rsscp = $result['encoding']; } // This is used in my_preg_match()
+ // otherwise use the default codepage
+ else
+ { $this->rsscp = $this->default_cp; } // This is used in my_preg_match()
+
+ // Parse CHANNEL info
+ preg_match("'<channel.*?>(.*?)</channel>'si", $rss_content, $out_channel);
+ foreach($this->channeltags as $channeltag)
+ {
+ $temp = $this->my_preg_match("'<$channeltag.*?>(.*?)</$channeltag>'si", $out_channel[1]);
+ if ($temp != '') $result[$channeltag] = $temp; // Set only if not empty
+ }
+ // If date_format is specified and lastBuildDate is valid
+ if ($this->date_format != '' && ($timestamp = strtotime($result['lastBuildDate'])) !==-1) {
+ // convert lastBuildDate to specified date format
+ $result['lastBuildDate'] = date($this->date_format, $timestamp);
+ }
+
+ // Parse TEXTINPUT info
+ preg_match("'<textinput(|[^>]*[^/])>(.*?)</textinput>'si", $rss_content, $out_textinfo);
+ // This a little strange regexp means:
+ // Look for tag <textinput> with or without any attributes, but skip truncated version <textinput /> (it's not beggining tag)
+ if (isset($out_textinfo[2])) {
+ foreach($this->textinputtags as $textinputtag) {
+ $temp = $this->my_preg_match("'<$textinputtag.*?>(.*?)</$textinputtag>'si", $out_textinfo[2]);
+ if ($temp != '') $result['textinput_'.$textinputtag] = $temp; // Set only if not empty
+ }
+ }
+ // Parse IMAGE info
+ preg_match("'<image.*?>(.*?)</image>'si", $rss_content, $out_imageinfo);
+ if (isset($out_imageinfo[1])) {
+ foreach($this->imagetags as $imagetag) {
+ $temp = $this->my_preg_match("'<$imagetag.*?>(.*?)</$imagetag>'si", $out_imageinfo[1]);
+ if ($temp != '') $result['image_'.$imagetag] = $temp; // Set only if not empty
+ }
+ }
+ // Parse ITEMS
+ preg_match_all("'<item(| .*?)>(.*?)</item>'si", $rss_content, $items);
+ $rss_items = $items[2];
+ $i = 0;
+ $result['items'] = array(); // create array even if there are no items
+ foreach($rss_items as $rss_item) {
+ // If number of items is lower then limit: Parse one item
+ if ($i < $this->items_limit || $this->items_limit == 0) {
+ foreach($this->itemtags as $itemtag) {
+ $temp = $this->my_preg_match("'<$itemtag.*?>(.*?)</$itemtag>'si", $rss_item);
+ if ($temp != '') $result['items'][$i][$itemtag] = $temp; // Set only if not empty
+ }
+ // Strip HTML tags and other bullshit from DESCRIPTION
+ if ($this->stripHTML && $result['items'][$i]['description'])
+ $result['items'][$i]['description'] = strip_tags($this->unhtmlentities(strip_tags($result['items'][$i]['description'])));
+ // Strip HTML tags and other bullshit from TITLE
+ if ($this->stripHTML && $result['items'][$i]['title'])
+ $result['items'][$i]['title'] = strip_tags($this->unhtmlentities(strip_tags($result['items'][$i]['title'])));
+ // If date_format is specified and pubDate is valid
+ if ($this->date_format != '' && ($timestamp = strtotime($result['items'][$i]['pubDate'])) !==-1) {
+ // convert pubDate to specified date format
+ $result['items'][$i]['pubDate'] = date($this->date_format, $timestamp);
+ }
+ // Item counter
+ $i++;
+ }
+ }
+
+ $result['items_count'] = $i;
+ return $result;
+ }
+ else // Error in opening return False
+ {
+ return False;
+ }
+ }
+}
+
+?>
+
diff --git a/website/new/top.html b/website/new/top.html
new file mode 100644
index 0000000..2fb6ab2
--- /dev/null
+++ b/website/new/top.html
@@ -0,0 +1,3 @@
+<h1 id="masthead">
+<a href="index.php"><img src="img/logo-cobbler.png" alt="Cobbler: Provisioning Made Simple" /></a>
+</h1>
diff --git a/website/old/cobbler.html b/website/old/cobbler.html
new file mode 100644
index 0000000..a16bbc6
--- /dev/null
+++ b/website/old/cobbler.html
@@ -0,0 +1,578 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>NAME</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rev="made" href="mailto:root@localhost" />
+</head>
+
+<body style="background-color: white">
+
+<p><a name="__index__"></a></p>
+<!-- INDEX BEGIN -->
+
+<ul>
+
+ <li><a href="#name">NAME</a></li>
+ <li><a href="#synopsis">SYNOPSIS</a></li>
+ <li><a href="#description">DESCRIPTION</a></li>
+ <li><a href="#see_also">SEE ALSO</a></li>
+ <li><a href="#cobbler_usage">COBBLER USAGE</a></li>
+ <ul>
+
+ <li><a href="#setup">SETUP</a></li>
+ <li><a href="#adding_a_distribution">ADDING A DISTRIBUTION</a></li>
+ <li><a href="#adding_a_profile">ADDING A PROFILE</a></li>
+ <li><a href="#adding_a_system">ADDING A SYSTEM</a></li>
+ <li><a href="#adding_a_repository_to_mirror">ADDING A REPOSITORY TO MIRROR</a></li>
+ <li><a href="#displaying_configuration_entries">DISPLAYING CONFIGURATION ENTRIES</a></li>
+ <li><a href="#deleting_configuration_entries">DELETING CONFIGURATION ENTRIES</a></li>
+ <li><a href="#rebuilding_configurations">REBUILDING CONFIGURATIONS</a></li>
+ </ul>
+
+ <li><a href="#examples">EXAMPLES</a></li>
+ <ul>
+
+ <li><a href="#import_workflow">IMPORT WORKFLOW</a></li>
+ <li><a href="#normal_workflow">NORMAL WORKFLOW</a></li>
+ <li><a href="#repository_mirroring_workflow">REPOSITORY MIRRORING WORKFLOW</a></li>
+ <li><a href="#xen">XEN</a></li>
+ </ul>
+
+ <li><a href="#advanced_topics">ADVANCED TOPICS</a></li>
+ <ul>
+
+ <li><a href="#pxe_menus">PXE MENUS</a></li>
+ <li><a href="#kickstart_templating">KICKSTART TEMPLATING</a></li>
+ <li><a href="#dhcp_configuration_management">DHCP CONFIGURATION MANAGEMENT</a></li>
+ <li><a href="#enchant">ENCHANT</a></li>
+ <li><a href="#importing_trees">IMPORTING TREES</a></li>
+ <li><a href="#default_pxe_boot_behavior">DEFAULT PXE BOOT BEHAVIOR</a></li>
+ <li><a href="#repo_management">REPO MANAGEMENT</a></li>
+ <li><a href="#kickstart_tracking">KICKSTART TRACKING</a></li>
+ <li><a href="#tweaking">TWEAKING</a></li>
+ <li><a href="#api">API</a></li>
+ </ul>
+
+ <li><a href="#exit_status">EXIT_STATUS</a></li>
+ <li><a href="#mailing_list">MAILING LIST</a></li>
+ <li><a href="#author">AUTHOR</a></li>
+</ul>
+<!-- INDEX END -->
+
+<hr />
+<p>
+</p>
+<h1><a name="name">NAME</a></h1>
+<p>cobbler is a command line tool for configuring a provisioning and update server. It supports provisioning via PXE, virtualization (Xen), and remotely re-provisioning a existing Linux system when PXE booting isn't possible. The latter two features are enabled by usage of 'koan' (a client side provisioning application) on the remote system. Update server features include yum mirroring over rsync:// and integration of those mirrors with kickstart.</p>
+<p>
+</p>
+<hr />
+<h1><a name="synopsis">SYNOPSIS</a></h1>
+<p>cobbler command [subcommand] [--arg1=] [--arg2=]</p>
+<p>
+</p>
+<hr />
+<h1><a name="description">DESCRIPTION</a></h1>
+<p>Cobbler manages provisioning using a tiered concept of Distributions, Profiles, Systems, and Repositories.</p>
+<p>Distributions contain information about what kernel and initrd are used, along with various other information, such as required kernel parameters.</p>
+<p>Profiles associate a Distribution with a kickstart file and optionally customize it further.</p>
+<p>Systems associate a hostname, IP, or MAC with a distribution and optionally customize the Profile further.</p>
+<p>Repositories contain yum mirror information. Using cobbler to mirror repositories is an optional/advanced
+feature and is covered further down in this manpage.</p>
+<p>The main advantages of cobbler is that it glues together a lot of disjoint technologies and concepts and abstracts the user from the need to understand them. It allows the systems administrator to concentrate on what he needs to do, and not how it is done.</p>
+<p>
+</p>
+<hr />
+<h1><a name="see_also">SEE ALSO</a></h1>
+<p>For help in building kickstarts, try using the ``system-config-kickstart'' tool, or install a new system and look at the /root/anaconda-ks.cfg file left over from the installer. General kickstart questions can also be asked at <a href="mailto:kickstart-list@redhat.com.">kickstart-list@redhat.com.</a> Cobbler ships some kickstart templates in /etc/cobbler that may also prove helpful.</p>
+<p>
+</p>
+<hr />
+<h1><a name="cobbler_usage">COBBLER USAGE</a></h1>
+<p>
+</p>
+<h2><a name="setup">SETUP</a></h2>
+<p>Running ``cobbler check'' after installation will verify that cobbler's prerequisites are installed and configured correctly. This is a good first command to run after installing cobbler.</p>
+<p>Any problems detected should be corrected, with the potential exception of DHCP related warnings. Run ``cobbler sync'' after making any changes to the configuration files to ensure those changes are applied.</p>
+<p>It is especially important that the server name field be accurate in /var/lib/cobbler/settings, without this field being correct, kickstart trees may not be found, and provisioning won't work.</p>
+<p>For PXE, if DHCP is to be run from the cobbler server, the dhcp configuration file should be changed as suggested. If DHCP is not run locally, the ``next-server'' field on the DHCP server should point to the cobbler server's IP and the filename should be set to ``pxelinux.0''.</p>
+<p>Cobbler can also manage (generate) your dhcp configuration file -- this is covered in a later section. If you don't already have a dhcp setup, allowing cobbler to manage it may prove to be useful. If you already have a setup, moving an existing setup to be managed from within cobbler is relatively painless and is entirely optional.</p>
+<p>
+</p>
+<h2><a name="adding_a_distribution">ADDING A DISTRIBUTION</a></h2>
+<p>This first step towards configurating what you want to provision is to add a distribution to the cobbler's configuration.</p>
+<p>If there is an rsync mirror or filesystem tree that you would rather import instead, skip down to the documentation about the ``import'' command. It's really a lot easier, but it requires waiting for the mirror to sync data across. Imported mirrors also save time during install since they don't have to hit external install sources.</p>
+<p>The manual distro add command is:</p>
+<p><strong>cobbler distro add --name=string --kernel=path --initrd=path [--kopts=string] [--ksmeta=string] [--arch=x86|x86_64|ia64] [--breed=redhat|suse]</strong></p>
+<dl>
+<dt><strong><a name="item_name">name</a></strong>
+
+<dd>
+<p>a string identifying the distribution, this should be something like ``rhel4''.</p>
+</dd>
+</li>
+<dt><strong><a name="item_kernel">kernel</a></strong>
+
+<dd>
+<p>an absolute filesystem path to a kernel image</p>
+</dd>
+</li>
+<dt><strong><a name="item_initrd">initrd</a></strong>
+
+<dd>
+<p>an absolute filesystem path to a initrd image</p>
+</dd>
+</li>
+<dt><strong><a name="item_kopts">kopts</a></strong>
+
+<dd>
+<p>(optional) sets kernel command-line arguments that the distro, and profiles/systems dependant
+on it, will use.</p>
+</dd>
+<dd>
+<p>Example: --kopts=``foo=bar baz=3 asdf''</p>
+</dd>
+</li>
+<dt><strong><a name="item_arch">arch</a></strong>
+
+<dd>
+<p>(optional) sets the architecture for the PXE bootloader</p>
+</dd>
+<dd>
+<p>x86 and x86_64 are interchangable, both use syslinux.</p>
+</dd>
+<dd>
+<p>ia64 uses the IA64 build of elilo.</p>
+</dd>
+<dd>
+<p>if you don't use IA64 systems, leaving this parameter off is fine.</p>
+</dd>
+</li>
+<dt><strong><a name="item_ksmeta">ksmeta</a></strong>
+
+<dd>
+<p>(optional)</p>
+</dd>
+<dd>
+<p>This is an advanced feature that sets kickstart variables to substitute, thus enabling kickstart files to be treated as templates.</p>
+</dd>
+<dd>
+<p>Example: --ksmeta=``foo=bar baz=3 asdf''</p>
+</dd>
+<dd>
+<p>See the section below on templating.</p>
+</dd>
+</li>
+<dt><strong><a name="item_breed">breed</a></strong>
+
+<dd>
+<p>Defaults to ``redhat'', which is a suitable value for Fedora and Centos as well. Specifying ``suse'' allows the kickstart file parameters to be treated instead like AutoYaST answer files, such that the proper parameters for SuSE answer files
+are put on the kernel command line. Support for other types of distributions is possible in the future. The file used for the answer file, regardless of
+distro breed, is the value used for --kickstart when creating the profile. See the profile add commands for further information. This feature is still rather experimental.</p>
+</dd>
+</li>
+</dl>
+<p>
+</p>
+<h2><a name="adding_a_profile">ADDING A PROFILE</a></h2>
+<p>A profile associates a distribution to additional specialized options, such as a kickstart automation file. Profiles are the core unit of provisioning and at least one profile must exist for every distribution to be provisioned. A profile might represent, for instance, a web server or desktop configuration.</p>
+<p><strong>cobbler profile add --name=string --distro=string [--kickstart=url] [--kopts=string] [--ksmeta=string] [--virt-file-size=gigabytes] [--virt-ram=megabytes]</strong></p>
+<p>Arguments are as listed for distributions, except for the ``arch'' parameter, and with the additions listed below:</p>
+<dl>
+<dt><strong>name</strong>
+
+<dd>
+<p>a descriptive name. This could be something like ``rhel4webservers'' or ``fc6desktops''.</p>
+</dd>
+</li>
+<dt><strong><a name="item_distro">distro</a></strong>
+
+<dd>
+<p>the name of a previously defined cobbler distribution</p>
+</dd>
+</li>
+<dt><strong><a name="item_kickstart">kickstart</a></strong>
+
+<dd>
+<p>Local filesystem path to a kickstart file.</p>
+</dd>
+<dd>
+<p>If this parameter is not provided, the kickstart file will default to /etc/cobbler/default.ks (or whatever is set in /var/lib/cobbler/settings). This file is initially blank, meaning default kickstarts are not automated. Admins can change the default.ks or can leave it blank.</p>
+</dd>
+</li>
+<dt><strong><a name="item_virt_2dfile_2dsize">virt-file-size</a></strong>
+
+<dd>
+<p>(optional) (Virt-only) how large the disk image should be in gigabytes. The default is ``5''.</p>
+</dd>
+</li>
+<dt><strong><a name="item_virt_2dram">virt-ram</a></strong>
+
+<dd>
+<p>(optional) (Virt-only) how many megabytes of RAM to consume. The default is 512 MB.</p>
+</dd>
+</li>
+<dt><strong><a name="item_repos">repos</a></strong>
+
+<dd>
+<p>(optional) a space delimited list of all the repos (created with ``cobbler repo add'' and ``cobbler reposync'') that this profile
+can make use of during kickstart installation. For example, an example might be --repos=``fc6i386updates fc6i386extras''.</p>
+</dd>
+</li>
+</dl>
+<p>
+</p>
+<h2><a name="adding_a_system">ADDING A SYSTEM</a></h2>
+<p>Systems assign a piece of hardware with the cobbler profile to be assigned to it. Systems can be defined by hostname, IP, or MAC address. When available, use of the MAC address to assign systems is preferred.</p>
+<p><strong>cobbler system add --name=ip|mac|hostname --profile=string [--kopts=string] [--pxe-address=string] [--ksmeta=string]</strong></p>
+<p>Adds a cobbler System to the configuration. Arguments are specified as per ``profile add'' with
+the following changes:</p>
+<dl>
+<dt><strong>name</strong>
+
+<dd>
+<p>The system name must be either a currently-resolvable hostname, an IP address, or a MAC address.</p>
+</dd>
+<dd>
+<p>When defining Virtualized systems, using a MAC address causes the Virt MAC address to be used for creation,
+so that is the preferred usage. To restate this, unless you have a better reason, use the MAC
+address here, as it makes things a lot easier and more powerful across the board.</p>
+</dd>
+<dd>
+<p>There is also the magic name ``default'', which allows creation of the default PXE profile. Without
+a ``default'' system name created, PXE will fall through to local boot for unconfigured systems.</p>
+</dd>
+</li>
+<dt><strong><a name="item_pxe_2daddress">pxe-address</a></strong>
+
+<dd>
+<p>Advanced feature.</p>
+</dd>
+<dd>
+<p>If cobbler is configured to generate the dhcpd.conf file, use this
+setting to pin a certain hostname or IP to a given MAC address. This corresponds to the ``fixed-address'' field in dhcpd.conf.</p>
+</dd>
+<dd>
+<p>When using this setting for IA64 machines, be sure that the ``--name'' given to the ``system add'' command is a MAC address or no per-system record in dhcpd.conf can be generated.</p>
+</dd>
+<dd>
+<p>Example: ---pxe-address=192.168.1.50</p>
+</dd>
+<dd>
+<p>NOTE: Due to a limitation in elilo (IA64 bootloader), this parameter must ALSO be used even if dhcpd.conf files are not being managed by cobbler AND you want to PXE provision IA64 systems using a handwritten dhcpd.conf. Also, for IA64, the value of pxe-address must be an IP, and not a hostname, even though hostnames work for X86. Thankfully, if you don't have IA64 systems, there are a lot less rules.</p>
+</dd>
+</li>
+</dl>
+<p>
+</p>
+<h2><a name="adding_a_repository_to_mirror">ADDING A REPOSITORY TO MIRROR</a></h2>
+<p>Repository mirroring allows cobbler to mirror not only install trees (``cobbler import'' does this for you) but
+also optional packages, 3rd party content, and even updates. Mirroring all of this content locally
+on your network will result in faster, more up-to-date installations and faster updates. If you
+are only provisioning a home setup, this will probably be overkill, though it can be very useful
+for larger setups (labs, datacenters, etc).</p>
+<p><strong>cobbler repo add --mirror=url --name=string [--local-filename=string]</strong></p>
+<dl>
+<dt><strong><a name="item_mirror">mirror</a></strong>
+
+<dd>
+<p>The addresss of the yum mirror. This can be an rsync:// URL, an ssh location, or
+a http:// or ftp:// mirror location.</p>
+</dd>
+<dd>
+<p>The mirror address should specify an exact repository to mirror -- just one architecture
+and just one distribution. If you have a seperate repo to mirror for a different arch, add that
+repo seperately.</p>
+</dd>
+<dd>
+<p>Here's an example of what looks like a good URL:</p>
+</dd>
+<dd>
+<p><a href="rsync://yourmirror.example.com/fedora-linux-core/updates/6/i386">rsync://yourmirror.example.com/fedora-linux-core/updates/6/i386</a> (for rsync protocol)
+<a href="http://mirrors.kernel.org/fedora/extras/6/i386/">http://mirrors.kernel.org/fedora/extras/6/i386/</a> (for http://)
+<a href="mailto:user@yourmirror.example.com/fedora-linux-core/updates/6/i386">user@yourmirror.example.com/fedora-linux-core/updates/6/i386</a> (for SSH)</p>
+</dd>
+<dd>
+<p>Experimental support is also provided for mirroring (RHEL5) and later RHN content when you need
+a fast local mirror. The mirror syntax for this is --mirror=rhn://channel-name and you must
+have entitlements for this to work.</p>
+</dd>
+</li>
+<dt><strong>name</strong>
+
+<dd>
+<p>This name is used as the save location for the mirror. If the mirror represented, say, Fedora Core
+6 i386 updates, a good name would be ``fc6i386updates''. Again, be specific.</p>
+</dd>
+<dd>
+<p>This name corresponds with values given to the --repos parameter of ``cobbler profile add''. If a profile
+has a --repos value that matches the name here, that repo can be automatically set up during provisioning.
+This means that, if supported by Anaconda, the repo can be used during kickstart install -- and -- either way,
+it can be automatically configured on the clients.</p>
+</dd>
+<dd>
+<p>See the documentation on ``cobbler profile add'' for more information.</p>
+</dd>
+</li>
+<dt><strong><a name="item_local_2dfilename">local-filename</a></strong>
+
+<dd>
+<p>Local filename specifies, for kickstarts containing the template parameter ``yum_config_stanza'',
+what files to populate on provisioned clients in /etc/yum.repos.d.</p>
+</dd>
+<dd>
+<p>In other words, if this value is ``foo'', the repo would be installed on provisioned clients as ``/etc/yum.repos.d/foo.repo''.</p>
+</dd>
+<dd>
+<p>If you don't want clients to have this repo installed, don't add a name for the repo, and provisioned machines
+will not configure yum to know about this repo -- you can still do it manually if you choose. The repository will
+still be used for installation, it just won't get installed automatically in /etc/yum.repos.d on the client.</p>
+</dd>
+<dd>
+<p>See /etc/cobbler/kickstart_fc6.ks for an example of how to employ this within a kickstart template.</p>
+</dd>
+</li>
+</dl>
+<p>
+</p>
+<h2><a name="displaying_configuration_entries">DISPLAYING CONFIGURATION ENTRIES</a></h2>
+<p>This is a rather simple command, usable regardless of how you are using cobbler.</p>
+<p><strong>cobbler report [--settings] [--profiles] [--distros] [--systems] [--repos]</strong></p>
+<p>Prints the current cobbler configuration for systems, profiles, and groups. If one of the switches is given, only information for those is printed.</p>
+<p>The list command gives an abbreviated version of what ``report'' gives.
+It only returns the names of each item.</p>
+<p><strong>cobbler list [--settings] [--profiles] [--distros] [--systems] [--repos]</strong></p>
+<p>Alternatively, you could look at the configuration files in /var/lib/cobbler to see the same information.</p>
+<p>
+</p>
+<h2><a name="deleting_configuration_entries">DELETING CONFIGURATION ENTRIES</a></h2>
+<p>If you want to remove a specific object, use the remove command with the name that was used to add it.</p>
+<p><strong>cobbler distro remove --name=string</strong></p>
+<p><strong>cobbler profile remove --name=string</strong></p>
+<p><strong>cobbler system remove --name=string</strong></p>
+<p><strong>cobbler remove repo --name=string</strong></p>
+<p>
+</p>
+<h2><a name="rebuilding_configurations">REBUILDING CONFIGURATIONS</a></h2>
+<p><strong>cobbler sync</strong></p>
+<p>Cobbler sync is used to repair or rebuild the contents /tftpboot or /var/www/cobbler when something has changed behind the scenes. It brings the filesystem up to date with the configuration as understood by cobbler.</p>
+<p>Sync should be run whenever files in /var/www/cobbler are manually edited or when making changes to kickstart files. In practice, this should not happen often, though running sync too many times does not cause any adverse effects.</p>
+<p>If using cobbler to manage a DHCP server (see the advanced section of this manpage), sync does need to be
+run after systems are added to regenerate and reload the DHCP configuration.</p>
+<p>
+</p>
+<hr />
+<h1><a name="examples">EXAMPLES</a></h1>
+<p>
+</p>
+<h2><a name="import_workflow">IMPORT WORKFLOW</a></h2>
+<p>This example shows how to create a provisioning infrastructure from a distribution mirror.
+Then a default PXE configuration is created, so that by default systems will PXE boot into
+a fully automated install process for that distribution.</p>
+<p>You can use a network rsync mirror or a mounted DVD location.</p>
+<p><strong>cobbler check</strong></p>
+<p><strong>cobbler import --mirror=rsync://yourfavoritemirror.com/foo --mirror-name=anyname</strong></p>
+<p># OR</p>
+<p><strong>cobbler import --mirror=root@localhost:/mnt/dvd --mirror-name=anyname</strong></p>
+<p># wait for mirror to rsync...</p>
+<p><strong>cobbler report</strong></p>
+<p><strong>cobbler system add --name=default --profile=name_of_a_profile1</strong></p>
+<p><strong>cobbler system add --name=AA:BB:CC:DD:EE:FF --profile=name_of_a_profile2</strong></p>
+<p><strong>cobbler sync</strong></p>
+<p>
+</p>
+<h2><a name="normal_workflow">NORMAL WORKFLOW</a></h2>
+<p>The following example uses a local kernel and initrd file (already downloaded), and
+shows how profiles would be created using two different kickstarts -- one for a web server
+configuration and one for a database server. Then, a machine is assigned to each profile.</p>
+<p><strong>cobbler check</strong></p>
+<p><strong>cobbler distro add --name=rhel4u3 --kernel=/dir1/vmlinuz --initrd=/dir1/initrd.img</strong></p>
+<p><strong>cobbler distro add --name=fc5 --kernel=/dir2/vmlinuz --initrd=/dir2/initrd.img</strong></p>
+<p><strong>cobbler profile add --name=fc5webservers --distro=fc5-i386 --kickstart=/dir4/kick.ks --kopts=``something_to_make_my_gfx_card_work=42,some_other_parameter=foo''</strong></p>
+<p><strong>cobbler profile add --name=rhel4u3dbservers --distro=rhel4u3 --kickstart=/dir5/kick.ks</strong></p>
+<p><strong>cobbler system add --name=AA:BB:CC:DD:EE:FF --profile=fc5-webservers</strong></p>
+<p><strong>cobbler system add --name=AA:BB:CC:DD:EE:FE --profile=rhel4u3-dbservers</strong></p>
+<p><strong>cobbler report</strong></p>
+<p>
+</p>
+<h2><a name="repository_mirroring_workflow">REPOSITORY MIRRORING WORKFLOW</a></h2>
+<p>The following example shows how to set up a repo mirror for two repositories, and create a profile
+that will auto install those repository configurations on provisioned systems using that profile.</p>
+<p><strong>cobbler check</strong></p>
+<p># set up your cobbler distros here.</p>
+<p><strong>cobbler repo add --mirror=http://mirrors.kernel.org/fedora/core/updates/6/i386/ --name=fc6i386updates</strong></p>
+<p><strong>cobbler repo add --mirror=http://mirrors.kernel.org/fedora/extras/6/i386/ --name=fc6i386extras</strong></p>
+<p><strong>cobbler reposync</strong></p>
+<p><strong>cobbler profile add --name=p1 --distro=existing_distro_name --kickstart=/etc/cobbler/kickstart_fc6.ks --repos=``fc6i386updates fc6i386extras''</strong></p>
+<p>
+</p>
+<h2><a name="xen">XEN</a></h2>
+<p>For Virt, be sure the distro uses a Virt kernel and initrd and follow similar steps as above, adding additional parameters as desired:</p>
+<p><strong>cobbler distro add --name=fc5virt --kernel=/dir3/vmlinuz --initrd=/dir6/initrd.img</strong></p>
+<p>Specify reasonable values for the Virt image size (in GB) and RAM requirements:</p>
+<p><strong>cobbler profile add --name=virtwebservers --distro=fc5virt --kickstart=/dir7/kick.ks --virt-file-size=10 --virt-ram=512</strong></p>
+<p>And define systems (if desired) using MAC addresses, not IP's or hostnames:</p>
+<p><strong>cobbler system add --name=AA:BB:CC:DD:EE:FE --profile=virtwebservers</strong></p>
+<p>
+</p>
+<hr />
+<h1><a name="advanced_topics">ADVANCED TOPICS</a></h1>
+<p>
+</p>
+<h2><a name="pxe_menus">PXE MENUS</a></h2>
+<p>Cobbler will automatically generate PXE menus for all profiles it has defined. Running ``cobbler sync'' is required
+to generate and update these menus.</p>
+<p>To access the menus, type ``menu'' at the ``boot:'' prompt while a system is PXE booting. If nothing is typed, the network boot
+will default to a local boot. If ``menu'' is typed, the user can then choose and provision any cobbler profile the system
+knows about.</p>
+<p>If the association between a system (MAC address) and a profile is already known, it may be more useful to just use
+``system add'' commands and declare that relationship in cobbler; however many use cases will prefer having a PXE system, especially when provisioning is done at the same time as installing new physical machines.</p>
+<p>If this behavior is not desired, run ``cobbler system add --name=default --profile=plugh'' to default all PXE booting machines to get a new copy of the profile ``plugh''. To go back to the menu system, run ``cobbler system remove --name=default'' and then ``cobbler sync'' to regenerate the menus.</p>
+<p>
+</p>
+<h2><a name="kickstart_templating">KICKSTART TEMPLATING</a></h2>
+<p>The --ksmeta options above require more explanation.</p>
+<p>If and only if --kickstart options reference filesystem URLs, --ksmeta allows for templating of the kickstart files
+to achieve advanced functions. If the --ksmeta option for a profile read --ksmeta=``foo=7 bar=llama'', anywhere
+in the kickstart file where the string ``TEMPLATE::bar'' appeared would be replaced with the string ``llama''. (Actually $bar is also replaced, if you prefer that syntax).</p>
+<p>To apply these changes, ``cobbler sync'' must be run to generate custom kickstarts for each profile/system.</p>
+<p>For NFS and HTTP URLs, the ``--ksmeta'' options will have no effect. This is a good reason to let
+cobbler manage your kickstart files, though the URL functionality is provided for integration with
+legacy infrastructure, possibly including web apps that already generate kickstarts.</p>
+<p>Templated kickstart files are processed by the templating program/package Cheetah, so anything you can do in a Cheetah template can be done to a kickstart template. Learn more at <a href="http://www.cheetahtemplate.org/learn.html">http://www.cheetahtemplate.org/learn.html</a></p>
+<p>When working with Cheetah, be sure to escape any shell macros that look like ``$(this)'' with something like ``\$(this)'' or errors may show up during the sync process.</p>
+<p>Should you want to express larger sections of templating (more that can be decently expressed on the command line), you may want to edit /var/lib/cobbler/ files directly. Keep in mind that changes need to be valid YAML 1.0 syntax and ``cobbler sync'' should be run after making any changes to those files.</p>
+<p>
+</p>
+<h2><a name="dhcp_configuration_management">DHCP CONFIGURATION MANAGEMENT</a></h2>
+<p>By default, cobbler does not write a dhcpd.conf and leaves configuration
+of DHCP up to the user. If manage_dhcp is set to 1 in /var/lib/cobbler/settings,
+this changes, and cobbler *will* write it's own dhcp.conf file, replacing any dhcpd.conf
+that already exists.</p>
+<p>The file is based on a template in /etc/cobbler/dhcpd.conf.template -- and must be user edited for
+the user's particular networking environment. Read the file and understand dhcpd.conf files before proceeding.
+If you already have dhcpd.conf data that you would like to preserve (say DHCP was manually configured earlier),
+insert the relevant portions of it into the template file.</p>
+<p>So, if this manage_dhcp bit is enabled, the following features are enabled:</p>
+<p>(A) pinning dhcp hostnames to MAC addresses automatically.
+(B) relatively seamless mixing of Itanium and x86/x86_64 machines in a PXE environment</p>
+<p>Per-system records in DHCP will only be written if the cobbler system name is a MAC address, so it's recommended that those be used if manage_dhcp is turned on.</p>
+<p>Itanium systems names also need to be specified by the MAC address, and their distribution needs to be created with the ``--arch=ia64'' parameter.</p>
+<p>The dhcpd.conf file will be updated each time ``cobbler sync'' is run, and not until then, so it is important
+to remember to use ``cobbler sync'' when using this feature.</p>
+<p>
+</p>
+<h2><a name="enchant">ENCHANT</a></h2>
+<p>While the normal provisioning procedure is either to PXE bare-metal, or use koan to do something else (kickstart an existing system or deploy Virt), cobbler contains yet another option, called ``enchant''.</p>
+<p>Enchant takes a configuration that has already been defined (be sure to run ``cobbler sync'' before using ``cobbler enchant'') and applies it to a remote system that might not have koan installed. Users might want to use this command to replace a server that is being repurposed, or when no PXE environment can be created.</p>
+<p>Essentially what enchant does is allow koan to be executed remotely from the cobbler server. Running ``enchant'' in it's normal mode will replace the operating system of the target machine, so use it with caution.</p>
+<p>Usage: <strong>cobbler enchant --address=ip|hostname --profile=string</strong>
+Usage: <strong>cobbler enchant --address=ip|hostname --system=string</strong></p>
+<p>Adding a ``--virt=yes'' to either form will provision a virtualized image rather than reprovisioning
+the remote machine. The default behavior is machine (not virtual) re-provisioning.</p>
+<p>Example: <strong>cobbler enchant --virt=yes --address=192.168.10.10 --profile=fc6xen</strong></p>
+<p>Before using enchant, configure the location of the koan noarch RPM in /var/lib/cobbler/settings (a local path) and re-run ``cobbler sync''.</p>
+<p>
+</p>
+<h2><a name="importing_trees">IMPORTING TREES</a></h2>
+<p>Cobbler can auto-add distributions and profiles from remote sources, whether this is an NFS path or an rsync mirror. This can save a lot of time when setting up a new provisioning environment.</p>
+<p>When importing a rsync mirror, cobbler will try to detect the distribution type and automatically assign kickstarts. By default, it will provision the system by erasing the hard drive, setting up eth0 for dhcp, and using a default password of ``cobbler''. If this is undesirable, edit the kickstart files in /etc/cobbler to do something else or change the kickstart setting after cobbler creates the profile.</p>
+<p>Note that if you use --path instead of --mirror, no files will actually be copied. Most of the time, usage of --mirror is preferred, to create a local copy of the files you are importing. These files are saved automatically in /var/www/cobbler/ks_mirror.</p>
+<p>Example: <strong>cobbler import --mirror=rsync://mirrorserver.example.com/path/ --mirror-name=fedora</strong></p>
+<p>Example2: <strong>cobbler import <a href="mailto:--mirror=root@192.168.1.10:/stuff">--mirror=root@192.168.1.10:/stuff</a> --mirror-name=bar</strong></p>
+<p>Example3: <strong>cobbler import --mirror=root@localhost:/mnt/dvd --mirror-name=baz</strong></p>
+<p>Example4: <strong>cobbler import --path=/path/to/stuff --mirror-name=glorp</strong></p>
+<p>Once imported, run a ``cobbler list'' or ``cobbler report'' to see what you've added.</p>
+<p>``Cobbler sync'' should still be run after an import to get the system ready to provision what was just imported.</p>
+<p>By default, the rsync operations will exclude PPC content, debug RPMs, and ISO images -- to change what is excluded during an import, see /etc/cobbler/rsync.exclude.</p>
+<p>
+</p>
+<h2><a name="default_pxe_boot_behavior">DEFAULT PXE BOOT BEHAVIOR</a></h2>
+<p>What happens when PXE booting a system when cobbler has no record
+of the system being booted?</p>
+<p>By default, cobbler will configure PXE to boot to the contents of
+/etc/cobbler/default.pxe, which (if unmodified) will just fall through
+to the local boot process. Administrators can modify this file if they
+like to change that behavior.</p>
+<p>An easy way to specify a default cobbler profile to PXE boot is to
+create a system named ``default''. This will cause /etc/cobbler/default.pxe
+to be ignored. To restore the previous behavior do a ``cobbler system remove''
+on the ``default'' system.</p>
+<p><strong>cobbler system add --name=default --profile=boot_this</strong></p>
+<p><strong>cobbler system remove --name=default</strong></p>
+<p>
+</p>
+<h2><a name="repo_management">REPO MANAGEMENT</a></h2>
+<p>This has already been covered a good bit in the command reference section.</p>
+<p>Yum repository management is an optional feature, and is not required to provision through cobbler.
+However, if cobbler is configured to mirror certain repositories, it can then be used to associate
+profiles with those repositories. Systems installed under those profiles will then be autoconfigured
+to use these repository mirrors in /etc/yum.repos.d, and if supported (Fedora Core 6 and later) these
+repositories can be leveraged even within Anaconda. This can be useful if (A) you have a large
+install base, (B) you want fast installation and upgrades for your systems, or (C) have some
+extra software not in a standard repository but want provisioned systems to know about that repository.</p>
+<p>Make sure there is plenty of space in cobbler's webdir, which defaults to /var/www/cobbler.</p>
+<p><strong>cobbler reposync</strong></p>
+<p>Cobbler reposync is the command to use to update repos as configured with ``cobbler repo add''. Mirroring
+can take a long time, and usage of cobbler reposync prior to cobbler sync is needed to ensure
+provisioned systems have the files they need to actually use the mirrored repositories. If you just
+add repos and never run ``cobbler reposync'', the repos will never be mirrored. This is probably a command
+you would want to put on a crontab, though the frequency of that crontab and where the output
+goes is left up to the systems administrator.</p>
+<p>For those familiar with yum's reposync, cobbler's reposync is a wrapper around the yum command. Please
+use ``cobbler reposync'' to update cobbler mirrors, as reposync does not perform all required steps. Also
+cobbler adds support for rsync and SSH locations, where as yum's reposync only supports what yum supports
+(http/ftp).</p>
+<p>Note that if a cobbler import provides enough information to use the boot server as a yum mirror for
+core packages, cobbler will set up kickstarts to use the cobbler server as a mirror instead of the
+outside world. If this feature is undesirable, it can be turned off by setting yum_core_mirror_from_server
+to 0 in /var/lib/cobbler/settings (and rerunning ``cobbler sync''). You may want to disable this feature
+if machines are provisioned on a different VLAN/network than production.</p>
+<p>
+</p>
+<h2><a name="kickstart_tracking">KICKSTART TRACKING</a></h2>
+<p>Cobbler knows how to keep track of the status of kickstarting machines.</p>
+<p><strong>cobbler status</strong></p>
+<p>Using the status command will show when cobbler thinks a machine started kickstarting and when it last requested a file.
+This is a good way to track machines that may have gone interactive during kickstarts. Cobbler will also make a special
+request in the post section of the kickstart to signal when a machine is finished kickstarting.</p>
+<p>To use this feature, the kickstart tree files need to be served via a <a href="http://server/cblr/...">http://server/cblr/...</a> URL, which happens
+automatically when using the ``cobbler import'' command to pull in a kickstart tree from an rsync mirror.</p>
+<p>If kickstart trees are somewhere else, one can still benefit from the kickstart tracking feature by adding a symlink to
+/var/www/cobbler/localmirror/distroname will allow the kickstarts to be served through the tracking URL mentioned above. Be sure to use the <a href="http://server/cblr/">http://server/cblr/</a> URL to point to the kickstart tree for each distro you want to track.</p>
+<p>Note that kickstart tracking support using syslog requires an Anaconda that supports syslog forwarding.
+RHEL5 is good, as is FC6 and later. URL tracking currently requires python2.3 or higher on the server
+for the mod_python piece to work. This will likely be improved later to better support older distros acting
+as a cobbler server.</p>
+<p>
+</p>
+<h2><a name="tweaking">TWEAKING</a></h2>
+<p>Enterprising users can edit the files in /var/lib/cobbler directly versus using the command line. The repair
+mechanism for user error here is to delete the files in /var/lib/cobbler. There are also a few configuration
+files in /etc/cobbler that can be edited.</p>
+<p>Running ``cobbler sync'' is required to apply any changes that are made manually.</p>
+<p>
+</p>
+<h2><a name="api">API</a></h2>
+<p>Cobbler also makes itself available as a Python API for use by higher level management software.</p>
+<p>
+</p>
+<hr />
+<h1><a name="exit_status">EXIT_STATUS</a></h1>
+<p>cobbler's command line returns a zero for success and non-zero for failure.</p>
+<p>
+</p>
+<hr />
+<h1><a name="mailing_list">MAILING LIST</a></h1>
+<p>Cobbler has a mailing list for user and development-related questions/comments at <a href="mailto:et-mgmt-tools@redhat.com.">et-mgmt-tools@redhat.com.</a></p>
+<p>
+</p>
+<hr />
+<h1><a name="author">AUTHOR</a></h1>
+<p>Michael DeHaan &lt;<a href="mailto:mdehaan@redhat.com">mdehaan@redhat.com</a>&gt;</p>
+
+</body>
+
+</html>
diff --git a/website/img/black-red/callout-bg.png b/website/old/img/black-red/callout-bg.png
index 7d300a4..7d300a4 100644
--- a/website/img/black-red/callout-bg.png
+++ b/website/old/img/black-red/callout-bg.png
Binary files differ
diff --git a/website/img/black-red/content-left-bg.png b/website/old/img/black-red/content-left-bg.png
index 78d9856..78d9856 100644
--- a/website/img/black-red/content-left-bg.png
+++ b/website/old/img/black-red/content-left-bg.png
Binary files differ
diff --git a/website/img/black-red/content-right-bg.png b/website/old/img/black-red/content-right-bg.png
index de10d7d..de10d7d 100644
--- a/website/img/black-red/content-right-bg.png
+++ b/website/old/img/black-red/content-right-bg.png
Binary files differ
diff --git a/website/img/black-red/hr.png b/website/old/img/black-red/hr.png
index ec23c73..ec23c73 100644
--- a/website/img/black-red/hr.png
+++ b/website/old/img/black-red/hr.png
Binary files differ
diff --git a/website/img/black-red/topbar-bg.png b/website/old/img/black-red/topbar-bg.png
index 423be96..423be96 100644
--- a/website/img/black-red/topbar-bg.png
+++ b/website/old/img/black-red/topbar-bg.png
Binary files differ
diff --git a/website/img/black-red/topbar-graphic.png b/website/old/img/black-red/topbar-graphic.png
index 353ea02..353ea02 100644
--- a/website/img/black-red/topbar-graphic.png
+++ b/website/old/img/black-red/topbar-graphic.png
Binary files differ
diff --git a/website/index.html b/website/old/index.html
index 3c6fe94..3c6fe94 100644
--- a/website/index.html
+++ b/website/old/index.html
diff --git a/website/style.css b/website/old/style.css
index aeeb9c9..aeeb9c9 100644
--- a/website/style.css
+++ b/website/old/style.css
diff --git a/website/push.sh b/website/push.sh
index b785147..a77f816 100644
--- a/website/push.sh
+++ b/website/push.sh
@@ -1,6 +1,2 @@
#!/bin/sh
-scp *.html et.redhat.com:/var/www/sites/cobbler.et.redhat.com/
-scp *.odp et.redhat.com:/var/www/sites/cobbler.et.redhat.com/
-scp *.ico et.redhat.com:/var/www/sites/cobbler.et.redhat.com/
-scp *.css et.redhat.com:/var/www/sites/cobbler.et.redhat.com/
-scp -r img et.redhat.com:/var/www/sites/cobbler.et.redhat.com/
+scp -r new/* et.redhat.com:/var/www/sites/cobbler.et.redhat.com/new