# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346171330 -7200 # Node ID 5cd084e0397a53d5cc852b2024affb65c600da8c # Parent 7d4d11d301d6f749b24b877d78b9a73016f74d52 Update version and correct typical german english grammar mistakes. diff -r 7d4d11d301d6 -r 5cd084e0397a drupal/drupal.patch --- a/drupal/drupal.patch Tue Aug 28 18:28:45 2012 +0200 +++ b/drupal/drupal.patch Tue Aug 28 18:28:50 2012 +0200 @@ -1,25 +1,21 @@ -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 -@@ -272,6 +272,7 @@ +@@ -730,6 +730,7 @@ */ - function conf_init() { + function drupal_settings_initialize() { global $base_url, $base_path, $base_root; + global $base_url_local; // 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. + global $databases, $cookie_domain, $conf, $installed_profile, $update_free_access, $db_url, $db_prefix, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url; +@@ -1613,8 +1614,22 @@ + * 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)) { @@ -36,95 +32,24 @@ } else { if (isset($_SERVER['argv'])) { -@@ -792,6 +806,7 @@ +@@ -1628,6 +1643,7 @@ } } - // Prevent multiple slashes to avoid cross site requests via the FAPI. + // Prevent multiple slashes to avoid cross site requests via the Form API. + if (substr($uri, 0, 1) == "/") - $uri = '/'. ltrim($uri, '/'); + $uri = '/' . ltrim($uri, '/'); return $uri; -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 - ------------------------------------------------------------------------------ - -1. 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) - -2. Fix CSS Cache Building Procedure -http://drupal.org/node/275381 -http://drupal.org/files/issues/drupal-css-cache-building.patch -(created by RSE) - Index: includes/common.inc --- includes/common.inc.orig 2008-04-09 23:11:44 +0200 +++ includes/common.inc 2008-06-26 20:16:16 +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 @@ +@@ -848,9 +848,14 @@ } // Construct the path to act on. - $path = isset($uri['path']) ? $uri['path'] : '/'; - if (isset($uri['query'])) { -- $path .= '?'. $uri['query']; +- $path .= '?' . $uri['query']; + if (variable_get('proxy_server', '') != '') { + $path = $url; + } @@ -135,9 +60,9 @@ + } } - // Create HTTP request. -@@ -482,6 +501,14 @@ - $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : '')); + // Merge the default headers. +@@ -872,6 +877,14 @@ + $options['headers']['Authorization'] = 'Basic ' . base64_encode($uri['user'] . (isset($uri['pass']) ? ':' . $uri['pass'] : '')); } + // If the proxy server required a username then attempt to authenticate with it @@ -148,13 +73,13 @@ + $defaults['Proxy-Authorization'] = 'Proxy-Authorization: Basic '. $auth_string ."\r\n"; + } + - foreach ($headers as $header => $value) { - $defaults[$header] = $header .': '. $value; - } + // If the database prefix is being used by SimpleTest to run the tests in a copied + // database then set the user-agent header to the database prefix so that any + // calls to other Drupal pages will run the SimpleTest prefixed database. The 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 @@ +@@ -1766,6 +1766,124 @@ } /** @@ -217,23 +142,73 @@ +} + +/** ++ * 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 .= '
  • '. t('support for enabling and disabling themes, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the Drupal.org theme page.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) .'
  • '; - $output .= '
  • '. t('a robust caching system 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'))) .'
  • '; - $output .= '
  • '. t('a set of routine administrative operations that rely on a correctly-configured cron maintenance task to run automatically. A number of other modules, including the feed aggregator, ping module and search also rely on cron maintenance tasks. For more information, see the online handbook entry for configuring cron jobs.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) .'
  • '; -- $output .= '
  • '. t('basic configuration options for your site, including date and time settings, file system settings, clean URL support, site name and other information, and a site maintenance 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'))) .'
  • '; -+ $output .= '
  • '. t('basic configuration options for your site, including date and time settings, file system settings, clean URL support, proxy server settings, a href="@site-info">site name and other information, and a site maintenance 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'))) .'
  • '; - $output .= '

    '. t('For more information, see the online handbook entry for System module.', array('@system' => 'http://drupal.org/handbook/modules/system/')) .'

    '; - return $output; - case 'admin': -@@ -406,6 +406,14 @@ - 'access arguments' => array('administer site configuration'), +@@ -723,6 +723,14 @@ + 'access arguments' => array('access administration pages'), 'file' => 'system.admin.inc', ); + $items['admin/settings/proxy'] = array( @@ -244,130 +219,46 @@ + 'access arguments' => array('administer site configuration'), + 'file' => 'system.admin.inc', + ); - $items['admin/settings/file-system'] = array( + $items['admin/config/media/file-system'] = array( 'title' => 'File system', 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.', - ------------------------------------------------------------------------------ - -Disable "Update notifications" check by default during installation. - -Index: install.php ---- install.php.orig 2008-02-08 23:00:45 +0100 -+++ install.php 2008-05-09 13:18:09 +0200 -@@ -1069,7 +1069,7 @@ - '#type' => 'checkboxes', - '#title' => st('Update notifications'), - '#options' => array(1 => st('Check for updates automatically')), -- '#default_value' => array(1), +Index: includes/install.core.inc +--- includes/install.core.inc.orig 2012-08-01 18:27:42.000000000 +0200 ++++ includes/install.core.inc 2012-08-22 21:55:27.582420660 +0200 +@@ -1771,7 +1771,7 @@ + 1 => st('Check for updates automatically'), + 2 => st('Receive e-mail notifications'), + ), +- '#default_value' => array(1, 2), + '#default_value' => array(), - '#description' => st('With this option enabled, Drupal will notify you when new releases are available. This will significantly enhance your site\'s security and is highly recommended. This requires your site to periodically send anonymous information on its installed components to drupal.org. For more information please see the update notification information.', array('@drupal' => 'http://drupal.org', '@update' => 'http://drupal.org/handbook/modules/update')), + '#description' => st('The system will notify you when updates and important security releases are available for installed components. Anonymous information about your site is sent to Drupal.org.', array('@drupal' => 'http://drupal.org')), '#weight' => 15, ); - ------------------------------------------------------------------------------ - -No need to always expand the "Menu settings" on node edit pages. - -Index: modules/menu/menu.module ---- modules/menu/menu.module.orig 2008-04-09 23:11:48 +0200 -+++ modules/menu/menu.module 2008-05-16 20:03:48 +0200 -@@ -366,7 +366,7 @@ - '#title' => t('Menu settings'), - '#access' => user_access('administer menu'), - '#collapsible' => TRUE, -- '#collapsed' => FALSE, -+ '#collapsed' => TRUE, - '#tree' => TRUE, - '#weight' => -2, - '#attributes' => array('class' => 'menu-item-form'), - ------------------------------------------------------------------------------ - -Use a larger text-area on node edit pages. - -Index: modules/node/node.pages.inc ---- modules/node/node.pages.inc.orig 2008-02-27 20:44:44 +0100 -+++ modules/node/node.pages.inc 2008-05-16 20:06:45 +0200 -@@ -287,7 +287,8 @@ - '#type' => 'textarea', - '#title' => check_plain($label), - '#default_value' => $include ? $node->body : ($node->teaser . $node->body), -- '#rows' => 20, -+ '#rows' => 30, -+ '#cols' => 80, - '#required' => ($word_count > 0), - ); - ------------------------------------------------------------------------------ - -Avoid incorrect ordering of BLOG entries by removing the -db_rewrite_sql() calls which seem to introduce a wrong ordering. - -Index: modules/blog/blog.module ---- modules/blog/blog.module.orig 2008-05-19 09:27:35 +0200 -+++ modules/blog/blog.module 2008-07-29 21:20:42 +0200 -@@ -182,13 +182,13 @@ - * Helper function to determine if a user has blog posts already. - */ - function _blog_post_exists($account) { -- return (bool)db_result(db_query_range(db_rewrite_sql("SELECT 1 FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1"), $account->uid, 0, 1)); -+ return (bool)db_result(db_query_range("SELECT 1 FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1", $account->uid, 0, 1)); - } +Index: sites/default/default.settings.php +--- sites/default/default.settings.php.orig 2012-08-01 18:27:42.000000000 +0200 ++++ sites/default/default.settings.php 2012-08-22 21:39:06.793031214 +0200 +@@ -257,6 +257,24 @@ + # $base_url = 'http://www.example.com'; // NO trailing slash! /** - * Implementation of hook_block(). ++ * 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: * -- * Displays the most recent 10 blog titles. -+ * Displays the most recent 5 blog titles. - */ - function blog_block($op = 'list', $delta = 0) { - global $user; -@@ -198,7 +198,7 @@ - } - else if ($op == 'view') { - if (user_access('access content')) { -- $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10); -+ $result = db_query_range("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, 5); - if ($node_title_list = node_title_list($result)) { - $block['content'] = $node_title_list; - $block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.')); -Index: modules/blog/blog.pages.inc ---- modules/blog/blog.pages.inc.orig 2009-09-14 17:08:00 +0200 -+++ modules/blog/blog.pages.inc 2009-09-19 08:53:18 +0200 -@@ -25,7 +25,7 @@ - - $output = theme('item_list', $items); - -- $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid); -+ $result = pager_query("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC", variable_get('default_nodes_main', 10), 0, NULL, $account->uid); - $has_posts = FALSE; - - while ($node = db_fetch_object($result)) { -@@ -64,7 +64,7 @@ - - $output = theme('item_list', $items); - -- $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10)); -+ $result = pager_query("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC", variable_get('default_nodes_main', 10)); - $has_posts = FALSE; - - while ($node = db_fetch_object($result)) { -@@ -87,7 +87,7 @@ - * Menu callback; displays an RSS feed containing recent blog entries of a given user. - */ - function blog_feed_user($account) { -- $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10)); -+ $result = db_query_range("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC", $account->uid, 0, variable_get('feed_default_items', 10)); - $channel['title'] = t("!name's blog", array('!name' => $account->name)); - $channel['link'] = url('blog/'. $account->uid, array('absolute' => TRUE)); - -@@ -102,7 +102,7 @@ - * Menu callback; displays an RSS feed containing recent blog entries of all users. - */ - function blog_feed_last() { -- $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10)); -+ $result = db_query_range("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, variable_get('feed_default_items', 10)); - $channel['title'] = t('!site_name blogs', array('!site_name' => variable_get('site_name', 'Drupal'))); - $channel['link'] = url('blog', array('absolute' => TRUE)); - + * To see what PHP settings are possible, including whether they can be set at diff -r 7d4d11d301d6 -r 5cd084e0397a drupal/drupal.spec --- a/drupal/drupal.spec Tue Aug 28 18:28:45 2012 +0200 +++ b/drupal/drupal.spec Tue Aug 28 18:28:50 2012 +0200 @@ -31,8 +31,8 @@ Class: PLUS Group: CMS License: GPL -Version: 6.22 -Release: 20110526 +Version: 7.15 +Release: 20120800 # package options %option with_mysql yes @@ -41,14 +41,14 @@ # checking for option conflicts %if "%{with_mysql}" == "no" && "%{with_pgsql}" == "no" - %{error:one of the build-time options 'with_mysql' or 'with_pgsql' have to be enabled} + %{error:one of the buildtime options 'with_mysql' or 'with_pgsql' have to be enabled} %endif %if "%{with_mysql}" == "yes" && "%{with_pgsql}" == "yes" - %{error:only one of the build-time options 'with_mysql' or 'with_pgsql' can be enabled at a time} + %{error:only one of the buildtime options 'with_mysql' or 'with_pgsql' can be enabled at a time} %endif # list of sources -Source0: http://ftp.drupal.org/files/projects/drupal-%{version}.tar.gz +Source0: ftp://ftp.drupal.org/pub/drupal/files/projects/drupal-%{version}.tar.gz Source1: drupal-setup.sh Source2: drupal-cron.sh Source3: drupal-apache.conf @@ -84,15 +84,15 @@ %description Drupal is a dynamic web site platform which allows an individual or community of users to publish, manage and organize a - variety of content, Drupal integrates many popular features of + variety of content. Drupal integrates many popular features of content management systems, weblogs, collaborative tools and - discussion-based community software into one easy-to-use package. + discussion based community software into one easy to use package. %track prog drupal = { version = %{version} url = http://ftp.drupal.org/files/projects/ - regex = drupal-(6\.\d+)\.tar\.gz + regex = drupal-(\d\.\d+)\.tar\.gz } %prep @@ -126,21 +126,11 @@ cp -rp * .htaccess \ $RPM_BUILD_ROOT%{l_prefix}/share/drupal/ - # pre-configure settings.php - %{l_shtool} subst \ -%if "%{with_mysql}" == "yes" - -e 's|^\( *\$db_url\) *=.*$|\1 = "mysql://drupal:drupal@127.0.0.1/drupal";|' \ -%endif -%if "%{with_pgsql}" == "yes" - -e 's|^\( *\$db_url\) *=.*$|\1 = "pgsql://drupal:drupal@127.0.0.1/drupal";|' \ -%endif - $RPM_BUILD_ROOT%{l_prefix}/share/drupal/sites/default/default.settings.php - # set data location ln -s ../../../../var/drupal/files \ $RPM_BUILD_ROOT%{l_prefix}/share/drupal/sites/default/files - # install run-command script + # install runcommand script %if "%{with_dcron}" == "yes" l_drupal_cron="no" %else