[open-ils-commits] r17337 - trunk/Open-ILS/src/perlmods/OpenILS/WWW (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Aug 25 12:58:13 EDT 2010
Author: erickson
Date: 2010-08-25 12:58:09 -0400 (Wed, 25 Aug 2010)
New Revision: 17337
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/WWW/Redirect.pm
Log:
added support for configuring redirect depth, skin, and locale during IP-based org unit redirection
Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/Redirect.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/Redirect.pm 2010-08-25 16:38:04 UTC (rev 17336)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/Redirect.pm 2010-08-25 16:58:09 UTC (rev 17337)
@@ -56,13 +56,18 @@
my $apache_obj = shift;
my $cgi = CGI->new( $apache_obj );
+
+ my $skin = $apache_obj->dir_config('OILSRedirectSkin') || 'default';
+ my $depth = $apache_obj->dir_config('OILSRedirectDepth') || undef;
+ my $locale = $apache_obj->dir_config('OILSRedirectLocale') || 'en-US';
+
my $hostname = $cgi->server_name();
my $port = $cgi->server_port();
my $proto = "http";
if($cgi->https) { $proto = "https"; }
- my $url = "$proto://$hostname:$port/opac/en-US/skin/default/xml/index.xml";
+ my $url = "$proto://$hostname:$port/opac/$locale/skin/$skin/xml/index.xml";
my $path = $apache_obj->path_info();
@@ -77,7 +82,10 @@
'open-ils.actor.org_unit.retrieve_by_shortname',
$shortname)->gather(1);
- if($org) { $url .= "?ol=" . $org->id; }
+ if($org) {
+ $url .= "?ol=" . $org->id;
+ $url .= "d=$depth" if defined $depth;
+ }
}
print "Location: $url\n\n";
More information about the open-ils-commits
mailing list