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:   24-Apr-2008 11:46:45
  Branch: HEAD                             Handle: 2008042410464400

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

  Log:
    Support HTTP Proxies

  Summary:
    Revision    Changes     Path
    1.3         +174 -0     openpkg-src/drupal/drupal.patch
    1.208       +1  -1      openpkg-src/drupal/drupal.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/drupal/drupal.patch
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 drupal.patch
  --- openpkg-src/drupal/drupal.patch   9 Apr 2008 18:49:46 -0000       1.2
  +++ openpkg-src/drupal/drupal.patch   24 Apr 2008 09:46:44 -0000      1.3
  @@ -1,3 +1,7 @@
  +Fix Reverse Proxy Support:
  +http://drupal.org/node/244593
  +http://drupal.org/files/issues/drupal_80.patch
  +
   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
  @@ -60,3 +64,173 @@
     * PHP settings:
     *
     * To see what PHP settings are possible, including whether they can
  +
  +-----------------------------------------------------------------------------
  +
  +Support HTTP Proxies (mainly for update checks, RSS fetching, etc)
  +http://drupal.org/node/7881
  +http://drupal.org/files/issues/proxy_11.patch
  +(post-adjusted and improved by RSE)
  +
  +Index: includes/common.inc
  +--- includes/common.inc.orig 2008-04-09 23:11:44 +0200
  ++++ includes/common.inc      2008-04-24 11:41:40 +0200
  +@@ -439,13 +439,27 @@
  +     case 'http':
  +       $port = isset($uri['port']) ? $uri['port'] : 80;
  +       $host = $uri['host'] . ($port != 80 ? ':'. $port : '');
  +-      $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
  ++      if (variable_get('proxy_server', '') != '') {
  ++        $proxy_server = variable_get('proxy_server', '');
  ++        $proxy_port = variable_get('proxy_port', 8080);
  ++        $fp = @fsockopen($proxy_server, $proxy_port, $errno, $errstr, 15);
  ++      }
  ++      else {
  ++        $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
  ++      }
  +       break;
  +     case 'https':
  +       // Note: Only works for PHP 4.3 compiled with OpenSSL.
  +       $port = isset($uri['port']) ? $uri['port'] : 443;
  +       $host = $uri['host'] . ($port != 443 ? ':'. $port : '');
  +-      $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20);
  ++      if (variable_get('proxy_server', '') != '') {
  ++        $proxy_server = variable_get('proxy_server', '');
  ++        $proxy_port = variable_get('proxy_port', 8080);
  ++        $fp = @fsockopen($proxy_server, $proxy_port, $errno, $errstr, 15);
  ++      }
  ++      else {
  ++        $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 
20);
  ++      }
  +       break;
  +     default:
  +       $result->error = 'invalid schema '. $uri['scheme'];
  +@@ -462,9 +476,14 @@
  +   }
  + 
  +   // Construct the path to act on.
  +-  $path = isset($uri['path']) ? $uri['path'] : '/';
  +-  if (isset($uri['query'])) {
  +-    $path .= '?'. $uri['query'];
  ++  if (variable_get('proxy_server', '') != '') {
  ++    $path = $url;
  ++  }
  ++  else {
  ++    $path = isset($uri['path']) ? $uri['path'] : '/';
  ++    if (isset($uri['query'])) {
  ++      $path .= '?'. $uri['query'];
  ++    }
  +   }
  + 
  +   // Create HTTP request.
  +@@ -482,6 +501,14 @@
  +     $defaults['Authorization'] = 'Authorization: Basic '. 
base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : ''));
  +   }
  + 
  ++  // If the proxy server required a username then attempt to authenticate 
with it
  ++  if (variable_get('proxy_username', '') != '') {
  ++    $username = variable_get('proxy_username', '');
  ++    $password = variable_get('proxy_password', '');
  ++    $auth_string = base64_encode($username . ($password != '' ? ':'. 
$password : ''));
  ++    $defaults['Proxy-Authorization'] = 'Proxy-Authorization: Basic '. 
$auth_string ."\r\n";
  ++  }
  ++
  +   foreach ($headers as $header => $value) {
  +     $defaults[$header] = $header .': '. $value;
  +   }
  +Index: modules/system/system.admin.inc
  +--- modules/system/system.admin.inc.orig     2008-03-25 12:58:16 +0100
  ++++ modules/system/system.admin.inc  2008-04-24 11:43:07 +0200
  +@@ -1363,6 +1363,65 @@
  + }
  + 
  + /**
  ++ * Form builder; Configure the site proxy settings.
  ++ *
  ++ * @ingroup forms
  ++ * @see system_settings_form()
  ++ */
  ++function system_proxy_settings() {
  ++
  ++  $form['forward_proxy'] = array(
  ++    '#type' => 'fieldset',
  ++    '#title' => t('Forward proxy settings'),
  ++    '#description' => t('The proxy server used when Drupal needs to connect 
to other sites on the Internet.'),
  ++  );
  ++  $form['forward_proxy']['proxy_server'] = array(
  ++    '#type' => 'textfield',
  ++    '#title' => t('Proxy host name'),
  ++    '#default_value' => variable_get('proxy_server', ''),
  ++    '#description' => t('The host name of the proxy server, eg. localhost. 
If this is empty Drupal will connect directly to the internet.')
  ++  );
  ++  $form['forward_proxy']['proxy_port'] = array(
  ++    '#type' => 'textfield',
  ++    '#title' => t('Proxy port number'),
  ++    '#default_value' => variable_get('proxy_port', 8080),
  ++    '#description' => t('The port number of the proxy server, eg. 8080'),
  ++  );
  ++  $form['forward_proxy']['proxy_username'] = array(
  ++    '#type' => 'textfield',
  ++    '#title' => t('Proxy username'),
  ++    '#default_value' => variable_get('proxy_username', ''),
  ++    '#description' => t('The username used to authenticate with the proxy 
server.'),
  ++  );
  ++  $form['forward_proxy']['proxy_password'] = array(
  ++    '#type' => 'textfield',
  ++    '#title' => t('Proxy password'),
  ++    '#default_value' => variable_get('proxy_password', ''),
  ++    '#description' => t('The password used to connect to the proxy server. 
This is kept as plain text.', '')
  ++  );
  ++  $form['#validate'][] = 'system_proxy_settings_validate';
  ++
  ++  return system_settings_form($form);
  ++}
  ++
  ++/**
  ++ * Validate the submitted proxy form.
  ++ */
  ++function system_proxy_settings_validate($form, &$form_state) {
  ++  // Validate the proxy settings
  ++  $form_state['values']['proxy_server'] = 
trim($form_state['values']['proxy_server']);
  ++  if ($form_state['values']['proxy_server'] != '') {
  ++    // TCP allows the port to be between 0 and 65536 inclusive
  ++    if (!is_numeric($form_state['values']['proxy_port'])) {
  ++      form_set_error('proxy_port', t('The proxy port is invalid. It must be 
a number between 0 and 65535.'));
  ++    }
  ++    elseif ($form_state['values']['proxy_port'] < 0 || 
$form_state['values']['proxy_port'] >= 65536) {
  ++      form_set_error('proxy_port', t('The proxy port is invalid. It must be 
between 0 and 65535.'));
  ++    }
  ++  }
  ++}
  ++
  ++/**
  +  * Form builder; Configure the site file handling.
  +  *
  +  * @ingroup forms
  +Index: modules/system/system.module
  +--- modules/system/system.module.orig        2008-04-09 23:11:49 +0200
  ++++ modules/system/system.module     2008-04-24 11:43:47 +0200
  +@@ -55,7 +55,7 @@
  +       $output .= '<li>'. t('support for enabling and disabling <a 
href="@themes">themes</a>, which determine the design and presentation of your 
site. Drupal comes packaged with several core themes and additional contributed 
themes are available at the <a href="@drupal-themes">Drupal.org theme 
page</a>.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 
'http://drupal.org/project/themes')) .'</li>';
  +       $output .= '<li>'. t('a robust <a href="@cache-settings">caching 
system</a> that allows the efficient re-use of previously-constructed web pages 
and web page components. Drupal stores the pages requested by anonymous users 
in a compressed format; depending on your site configuration and the amount of 
your web traffic tied to anonymous visitors, Drupal\'s caching system may 
significantly increase the speed of your site.', array('@cache-settings' => 
url('admin/settings/performance'))) .'</li>';
  +       $output .= '<li>'. t('a set of routine administrative operations that 
rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run 
automatically. A number of other modules, including the feed aggregator, ping 
module and search also rely on <a href="@cron">cron maintenance tasks</a>. For 
more information, see the online handbook entry for <a 
href="@handbook">configuring cron jobs</a>.', array('@cron' => 
url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) .'</li>';
  +-      $output .= '<li>'. t('basic configuration options for your site, 
including <a href="@date-settings">date and time settings</a>, <a 
href="@file-system">file system settings</a>, <a href="@clean-url">clean URL 
support</a>, <a href="@site-info">site name and other information</a>, and a <a 
href="@site-maintenance">site maintenance</a> function for taking your site 
temporarily off-line.', array('@date-settings' => 
url('admin/settings/date-time'), '@file-system' => 
url('admin/settings/file-system'), '@clean-url' => 
url('admin/settings/clean-urls'), '@site-info' => 
url('admin/settings/site-information'), '@site-maintenance' => 
url('admin/settings/site-maintenance'))) .'</li></ul>';
  ++      $output .= '<li>'. t('basic configuration options for your site, 
including <a href="@date-settings">date and time settings</a>, <a 
href="@file-system">file system settings</a>, <a href="@clean-url">clean URL 
support</a>, <a href="@proxy-server">proxy server settings</a>, a 
href="@site-info">site name and other information</a>, and a <a 
href="@site-maintenance">site maintenance</a> function for taking your site 
temporarily off-line.', array('@date-settings' => 
url('admin/settings/date-time'), '@file-system' => 
url('admin/settings/file-system'), '@clean-url' => 
url('admin/settings/clean-urls'), '@site-info' => 
url('admin/settings/site-information'), '@site-maintenance' => 
url('admin/settings/site-maintenance'))) .'</li></ul>';
  +       $output .= '<p>'. t('For more information, see the online handbook 
entry for <a href="@system">System module</a>.', array('@system' => 
'http://drupal.org/handbook/modules/system/')) .'</p>';
  +       return $output;
  +     case 'admin':
  +@@ -406,6 +406,14 @@
  +     'access arguments' => array('administer site configuration'),
  +     'file' => 'system.admin.inc',
  +   );
  ++  $items['admin/settings/proxy'] = array(
  ++    'title' => 'Proxy server',
  ++    'description' => 'Configure settings when the site is behind a proxy 
server.',
  ++    'page callback' => 'drupal_get_form',
  ++    'page arguments' => array('system_proxy_settings'),
  ++    'access arguments' => array('administer site configuration'),
  ++    'file' => 'system.admin.inc',
  ++  );
  +   $items['admin/settings/file-system'] = array(
  +     'title' => 'File system',
  +     'description' => 'Tell Drupal where to store uploaded files and how 
they are accessed.',
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/drupal/drupal.spec
  ============================================================================
  $ cvs diff -u -r1.207 -r1.208 drupal.spec
  --- openpkg-src/drupal/drupal.spec    23 Apr 2008 17:25:56 -0000      1.207
  +++ openpkg-src/drupal/drupal.spec    24 Apr 2008 09:46:44 -0000      1.208
  @@ -191,7 +191,7 @@
   Group:        CMS
   License:      GPL
   Version:      %{V_drupal}
  -Release:      20080423
  +Release:      20080424
   
   #   package options
   %option       with_mysql   yes
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to