OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   09-Apr-2008 20:49:48
  Branch: HEAD                             Handle: 2008040919494601

  Modified files:
    openpkg-src/drupal      drupal.patch drupal.spec

  Log:
    apply a patch for allowing one to drive a Drupal behind a reverse
    proxy without breaking forms

  Summary:
    Revision    Changes     Path
    1.2         +61 -11     openpkg-src/drupal/drupal.patch
    1.192       +2  -0      openpkg-src/drupal/drupal.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/drupal/drupal.patch
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 drupal.patch
  --- openpkg-src/drupal/drupal.patch   6 Jul 2007 20:40:42 -0000       1.1
  +++ openpkg-src/drupal/drupal.patch   9 Apr 2008 18:49:46 -0000       1.2
  @@ -1,12 +1,62 @@
  -Index: modules/system/system.install
  ---- modules/system/system.install.orig       2007-01-11 00:22:34 +0100
  -+++ modules/system/system.install    2007-07-05 18:35:56 +0200
  -@@ -1108,6 +1108,7 @@
  -   db_query("INSERT INTO {menu} (mid, pid, path, title, description, weight, 
type) VALUES (2, 0, '', 'Primary links', '', 0, 115)");
  -   db_query("INSERT INTO {variable} VALUES ('menu_primary_menu', 'i:2;')");
  -   db_query("INSERT INTO {variable} VALUES ('menu_secondary_menu', 'i:2;')");
  -+  db_query("INSERT INTO {variable} VALUES ('site_footer', 's:56:\"powered 
by <a href=\\\"http://www.openpkg.org/\\\";>OpenPKG</a>\";')");
  - }
  +Index: includes/bootstrap.inc
  +--- includes/bootstrap.inc.orig      2008-02-11 15:36:21 +0100
  ++++ includes/bootstrap.inc   2008-04-09 20:47:49 +0200
  +@@ -272,6 +272,7 @@
  +  */
  + function conf_init() {
  +   global $base_url, $base_path, $base_root;
  ++  global $base_url_local;
    
  - // Updates for core
  -
  +   // Export the following settings.php variables to the global namespace
  +   global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, 
$update_free_access;
  +@@ -723,9 +724,22 @@
  +  * generate an equivalent using other environment variables.
  +  */
  + function request_uri() {
  ++  global $base_url;
  ++  global $base_url_local;
  + 
  +   if (isset($_SERVER['REQUEST_URI'])) {
  +     $uri = $_SERVER['REQUEST_URI'];
  ++    if (isset($base_url) && isset($base_url_local)) {
  ++      $parts = parse_url($base_url_local);
  ++      if (   strlen($uri) >= strlen($base_url_local)
  ++          && substr($uri, 0, strlen($base_url_local)) == $base_url_local) {
  ++        $uri = $base_url .  substr($uri, strlen($base_url_local));
  ++      }
  ++      elseif (   strlen($uri) >= strlen($parts["path"])
  ++          && substr($uri, 0, strlen($parts["path"])) == $parts["path"]) {
  ++        $uri = $base_url .  substr($uri, strlen($parts["path"]));
  ++      }
  ++    }
  +   }
  +   else {
  +     if (isset($_SERVER['argv'])) {
  +Index: sites/default/default.settings.php
  +--- sites/default/default.settings.php.orig  2007-12-20 10:35:10 +0100
  ++++ sites/default/default.settings.php       2008-04-09 20:47:32 +0200
  +@@ -126,6 +126,24 @@
  + # $base_url = 'http://www.example.com';  // NO trailing slash!
  + 
  + /**
  ++ * Local Base URL (optional).
  ++ *
  ++ * If you are running Drupal behind a reverse proxy, $base_url (see above)
  ++ * usually points to the URL of the reverse proxy. Drupal uses this for
  ++ * all sorts of external URLs. In order to correctly calculate sub-URLs
  ++ * below $base_url for embedded HTML forms, Drupal also has to know the
  ++ * URL on the local/origin server under which Drupal is contacted by the
  ++ * reverse proxy. This is what $base_url_local is for.
  ++ *
  ++ * Examples:
  ++ *   $base_url_local = 'http://www.example.com:8080/drupal';
  ++ *
  ++ * It is not allowed to have a trailing slash; Drupal will add it
  ++ * for you.
  ++ */
  ++# $base_url_local = 'http://www.example.com:8080/drupal';  // NO trailing 
slash!
  ++
  ++/**
  +  * PHP settings:
  +  *
  +  * To see what PHP settings are possible, including whether they can
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/drupal/drupal.spec
  ============================================================================
  $ cvs diff -u -r1.191 -r1.192 drupal.spec
  --- openpkg-src/drupal/drupal.spec    9 Apr 2008 09:11:44 -0000       1.191
  +++ openpkg-src/drupal/drupal.spec    9 Apr 2008 18:49:47 -0000       1.192
  @@ -360,6 +360,7 @@
   Source401:    drupal-cron.sh
   Source402:    drupal-apache.conf
   Source403:    rc.drupal
  +Patch0:       drupal.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -1145,6 +1146,7 @@
   
   %prep
       %setup -q -n drupal-%{version}
  +    %patch -p0
       %{l_shtool} mkdir -f -p -m 755 \
           sites/all/modules \
           sites/all/themes
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to