Skip to content
Snippets Groups Projects
Commit d5085e12 authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-229] Merging from testing into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1071 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 6481b022
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,10 @@ Hacks of Core:
includes/bootstrap.inc
function drupal_settings_initialize()
* UNL change: include a "global" settings file that applies to all sites.
function conf_path()
* UNL change: Add $default_domains array support for sites.php to list which domains are ok to use with 'unl.edu.*' site_dirs.
If no $default_domains array is defined in sites.php, this code will do nothing.
------------------------------------
......@@ -20,4 +24,14 @@ used to allow public files to be accessed without the sites/<site_dir>/files pre
modules/image/image.field.inc
* theme_image_formatter ignores attributes so classes can't be added to an image in a theme (needed for photo frame)
* http://drupal.org/node/1025796#comment-4298698
* http://drupal.org/files/issues/1025796.patch
\ No newline at end of file
* http://drupal.org/files/issues/1025796.patch
------------------------------------
sites/sites.php
* Added support for $default_domains array. See includes/bootstrap.inc conf_path().
------------------------------------
sites/example.sites.php
* Added an example of the $default_domains array.
......@@ -363,6 +363,9 @@ function conf_path($require_settings = TRUE, $reset = FALSE) {
$confdir = 'sites';
$sites = array();
// UNL Change
$default_domains = array();
// End UNL Change
if (file_exists(DRUPAL_ROOT . '/' . $confdir . '/sites.php')) {
// This will overwrite $sites with the desired mappings.
include(DRUPAL_ROOT . '/' . $confdir . '/sites.php');
......@@ -373,6 +376,21 @@ function conf_path($require_settings = TRUE, $reset = FALSE) {
for ($i = count($uri) - 1; $i > 0; $i--) {
for ($j = count($server); $j > 0; $j--) {
$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
// UNL Change
// Since we're truncating site_dir domains to just unl.edu, we need to skip any site_dir that
// Starts with "unl.edu" unless we're on the default site's domain (ie: unlcms.unl.edu)
if (substr($dir, 0, 7) == 'unl.edu' && count($default_domains) > 0) {
$is_primary_domain = FALSE;
foreach ($default_domains as $default_domain) {
if (substr($_SERVER['HTTP_HOST'], 0, strlen($default_domain)) == $default_domain) {
$is_primary_domain = TRUE;
}
}
if (!$is_primary_domain) {
continue;
}
}
// End UNL Change
if (isset($sites[$dir]) && file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $sites[$dir])) {
$dir = $sites[$dir];
}
......
......@@ -41,3 +41,13 @@
*/
# $sites['devexample.com'] = 'example.com';
# $sites['localhost.example'] = 'example.com';
/**
* Default domains
*
* Used to specify which domains are allowed to use "universal" site dirs
* (starting with unl.edu). The purpose is to prevent sites like
* unlcms.unl.edu/ncard from showing up at bike.unl.edu/ncard.
*/
# $default_domains = array('example.unl.edu', 'example-test.unl.edu');
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment