[31472] trunk/www/includes

jmpp at macports.org jmpp at macports.org
Sat Nov 24 19:21:19 PST 2007


Revision: 31472
          http://trac.macosforge.org/projects/macports/changeset/31472
Author:   jmpp at macports.org
Date:     2007-11-24 19:21:18 -0800 (Sat, 24 Nov 2007)

Log Message:
-----------

 * Rename "check_referer" function to "print_warnings" and move all of its contents into a new trun/www/includes/warnings.inc file;
 * Remove the warning about not being the official website out of trunk/www/includes/header.inc and put it into the new warnings.inc file.
   With the 'if' conditional suggested by Ryan on the dev list, this warning should "just work" and disappear when the site is run from the
   official web server, at which time we'll reword it to something different (from claiming we're a temporary installation to a mirror).

Modified Paths:
--------------
    trunk/www/includes/common.inc
    trunk/www/includes/header.inc

Added Paths:
-----------
    trunk/www/includes/warnings.inc

Modified: trunk/www/includes/common.inc
===================================================================
--- trunk/www/includes/common.inc	2007-11-25 02:44:12 UTC (rev 31471)
+++ trunk/www/includes/common.inc	2007-11-25 03:21:18 UTC (rev 31472)
@@ -47,7 +47,7 @@
     
     header("Content-Type: application/xhtml+xml; charset=$encoding");
     include("$MPWEB/includes/header.inc");
-    check_referer();
+    print_warnings();
 }
 
 
@@ -97,25 +97,10 @@
 
 ###################################################################### 
 
-# Warning against darwinports.com leach!
-function check_referer() {
-    global $_SERVER;
+# Print some useful warnings:
+function print_warnings() {
+    global $_SERVER, $MPWEB;
+    
+    include("$MPWEB/includes/warnings.inc");
 
-    if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'darwinports.com') !== false) {
-?>
-        <div class="warning">
-        
-            <p>You have arrived at the <b>Official MacPorts Web Site</b> from <i>darwinports.com</i>.</p>
-            
-            <p><i>darwinports.com</i> <b>is not the official MacPorts Web Site</b>, nor is it a mirror of the <i>Official MacPorts
-            Web Site</i>. There is <b>no relationship</b> between <i>The MacPorts Project</i> and <i>darwinports.com</i>.</p>
-
-            <p>The information you may have been presented with on <i>darwinports.com</i> may be incorrect or outdated and is
-            not endorsed in any way by <i>The MacPorts Project</i>. For the most accurate information about MacPorts, please
-            bookmark this site, <a href="http://www.macports.org">http://www.macports.org</a>.</p>
-            
-        </div>
-<?php
-    }
 }
-?>

Modified: trunk/www/includes/header.inc
===================================================================
--- trunk/www/includes/header.inc	2007-11-25 02:44:12 UTC (rev 31471)
+++ trunk/www/includes/header.inc	2007-11-25 03:21:18 UTC (rev 31472)
@@ -97,7 +97,3 @@
                 </dd>
             </dl>
         </div>
-
-
-        <p class="warning"> Warning: This is a temporary installation of the new &amp; re-designed website for The MacPorts
-        Project. Official site is located at <a href="http://www.macports.org">http://www.macports.org</a> as always.</p>

Added: trunk/www/includes/warnings.inc
===================================================================
--- trunk/www/includes/warnings.inc	                        (rev 0)
+++ trunk/www/includes/warnings.inc	2007-11-25 03:21:18 UTC (rev 31472)
@@ -0,0 +1,38 @@
+<?php
+    /* -*- coding: utf-8; mode: php; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=php:et:sw=4:ts=4:sts=4 */
+    /* $Id$ */
+    /* Copyright (c) 2004-2007, The MacPorts Project. */
+?>
+
+
+<div class="warning">
+
+<?php
+# Warning against darwinports.com leech!
+if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'darwinports.com') !== false) {
+?>
+
+    <p>You have arrived at the <b>Official MacPorts Web Site</b> from <i>darwinports.com</i>.</p>
+
+    <p><i>darwinports.com</i> <b>is not the official MacPorts Web Site</b>, nor is it a mirror of the <i>Official MacPorts Web
+    Site</i>. There is <b>no relationship</b> between <i>The MacPorts Project</i> and <i>darwinports.com</i>.</p>
+
+    <p>The information you may have been presented with on <i>darwinports.com</i> may be incorrect or outdated and is not endorsed
+    in any way by <i>The MacPorts Project</i>. For the most accurate information about MacPorts, please bookmark this site,
+    <a href="http://www.macports.org">http://www.macports.org</a>.</p>
+
+<?php        
+}
+
+# Warn about us being a valid mirror if we're not being served off htt://www.macports.org itself
+if (isset($_SERVER['HTTP_HOST']) && !preg_match('%(^|\.)macports\.org$%', $_SERVER['HTTP_HOST'])) {    
+?>
+
+    <p>Warning: This is a temporary installation of the new &amp; re-designed website for The MacPorts Project. Official site
+    is located at <a href="http://www.macports.org">http://www.macports.org</a> as always.</p>
+
+<?php
+}
+?>
+
+</div>


Property changes on: trunk/www/includes/warnings.inc
___________________________________________________________________
Name: svn:mime-type
   + text/x-php
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071124/b4e7ca74/attachment.html


More information about the macports-changes mailing list