[Rt-commit] r4417 - in rt/branches/3.7-EXPERIMENTAL: . bin etc html html/Admin/Elements html/Admin/Users html/Approvals html/Approvals/Elements html/Download/CustomFieldValue html/Elements html/NoAuth html/NoAuth/css/3.4-compat html/NoAuth/css/3.5-default html/NoAuth/js html/Prefs html/REST/1.0/Forms/ticket html/REST/1.0/search html/Search html/Search/Elements html/SelfService/Elements html/Ticket html/Ticket/Attachment html/Ticket/Elements html/Tools html/Widgets lib lib/RT lib/RT/Action lib/RT/Interface lib/RT/Interface/Web lib/RT/URI lib/t/regression sbin

ruz at bestpractical.com ruz at bestpractical.com
Fri Jan 20 07:27:28 EST 2006


Author: ruz
Date: Fri Jan 20 07:26:28 2006
New Revision: 4417

Added:
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm
Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.fcgi.in
   rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.svc.in
   rt/branches/3.7-EXPERIMENTAL/bin/standalone_httpd.in
   rt/branches/3.7-EXPERIMENTAL/bin/webmux.pl.in
   rt/branches/3.7-EXPERIMENTAL/etc/RT_Config.pm.in
   rt/branches/3.7-EXPERIMENTAL/etc/acl.Informix
   rt/branches/3.7-EXPERIMENTAL/etc/acl.Oracle
   rt/branches/3.7-EXPERIMENTAL/etc/acl.Pg
   rt/branches/3.7-EXPERIMENTAL/etc/acl.Sybase
   rt/branches/3.7-EXPERIMENTAL/etc/acl.mysql
   rt/branches/3.7-EXPERIMENTAL/etc/initialdata
   rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditQueueWatchers
   rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/PickCustomFields
   rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/Modify.html
   rt/branches/3.7-EXPERIMENTAL/html/Approvals/Display.html
   rt/branches/3.7-EXPERIMENTAL/html/Approvals/Elements/Approve
   rt/branches/3.7-EXPERIMENTAL/html/Download/CustomFieldValue/dhandler
   rt/branches/3.7-EXPERIMENTAL/html/Elements/Callback
   rt/branches/3.7-EXPERIMENTAL/html/Elements/CreateTicket
   rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomFieldSelect
   rt/branches/3.7-EXPERIMENTAL/html/Elements/Header
   rt/branches/3.7-EXPERIMENTAL/html/Elements/Login
   rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu
   rt/branches/3.7-EXPERIMENTAL/html/Elements/MessageBox
   rt/branches/3.7-EXPERIMENTAL/html/Elements/MyRT
   rt/branches/3.7-EXPERIMENTAL/html/Elements/MyReminders
   rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout
   rt/branches/3.7-EXPERIMENTAL/html/Elements/Quicksearch
   rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldBinary
   rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldImage
   rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldWikitext
   rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowMemberships
   rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowSearch
   rt/branches/3.7-EXPERIMENTAL/html/Elements/SimpleSearch
   rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/Logout.html
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.4-compat/nav.css
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/footer.css
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/header.css
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav-left.css
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav.css
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/titlebox.css
   rt/branches/3.7-EXPERIMENTAL/html/NoAuth/js/titlebox-state.js
   rt/branches/3.7-EXPERIMENTAL/html/Prefs/MyRT.html
   rt/branches/3.7-EXPERIMENTAL/html/Prefs/Search.html
   rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/Forms/ticket/history
   rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/search/ticket
   rt/branches/3.7-EXPERIMENTAL/html/Search/Bulk.html
   rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/BuildFormatString
   rt/branches/3.7-EXPERIMENTAL/html/Search/Results.html
   rt/branches/3.7-EXPERIMENTAL/html/Search/Results.rdf
   rt/branches/3.7-EXPERIMENTAL/html/SelfService/CreateTicketInQueue.html
   rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests
   rt/branches/3.7-EXPERIMENTAL/html/SelfService/Prefs.html
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Attachment/dhandler
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/EditWatchers
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/Reminders
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowDates
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowHistory
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowRequestor
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowSummary
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransaction
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransactionAttachments
   rt/branches/3.7-EXPERIMENTAL/html/Tools/MyDay.html
   rt/branches/3.7-EXPERIMENTAL/html/Widgets/ComboBox
   rt/branches/3.7-EXPERIMENTAL/html/Widgets/SelectionBox
   rt/branches/3.7-EXPERIMENTAL/html/autohandler
   rt/branches/3.7-EXPERIMENTAL/html/index.html
   rt/branches/3.7-EXPERIMENTAL/lib/RT.pm.in
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Autoreply.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Notify.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/EmailParser.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Handle.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/I18N.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Queue_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/StyleGuide.pod
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/fsck_com_rt.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/t.pm
   rt/branches/3.7-EXPERIMENTAL/lib/RT/User_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/02basic_web.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/04send_email.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/07acl.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/08web_cf_access.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/17custom_search.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/19-rtname.t
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/21query-builder.t
   rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in

Log:
 r1632 at cubic-pc:  cubic | 2006-01-20 05:39:21 +0300
 Applied patch from http://rt3.fsck.com/Ticket/Display.html?id=7051
 all rejections were skipped.
 
 Rework RT configs handling
 r1064 at cubic-pc: cubic | 2005-09-30 23:03:19 +0400
 * load main config before site's
 * load main config from local/etc or from etc
 * set values unconditionaly
 * TODO: facility for loading extensions configs
 * TODO: load site config from local/et too
 r1066 at cubic-pc: cubic | 2005-10-03 13:56:01 +0400
 * LoadConfig now searches in local/etc too
 * search extensions's configs by mask *_Config.pm,
 for example RTIR_Config.pm or RTFM_Config.pm.
 * for each "main"(default) config tries to load "site"
 config, skip if couldn't find such, on other errors dies.
 * add local function that finds global's name by ref in name table
 * local Set function now checks several conditions(below),
 all this situations lead to warnings output to the STDERR
 if ENV{RT_DEBUG} is true.
 ** "main" config override option that was set by other
 "main" config, so we can catch situations when extension's
 config overlaps with RT or other extension configs.
 ** "site" config set option that hasn't been set yet, so we could
 analize situations when user's "site" configs have typos.
 ** "site" config set option that was defined not in
 its "main" config.
 r1082 at cubic-pc: cubic | 2005-10-05 21:11:03 +0400
 config handling via RT::Config class
 


Modified: rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.fcgi.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.fcgi.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.fcgi.in	Fri Jan 20 07:26:28 2006
@@ -65,7 +65,7 @@
     $ENV{'ENV'}    = '' if defined $ENV{'ENV'};
     $ENV{'IFS'}    = '' if defined $ENV{'IFS'};
 
-    Module::Refresh->refresh if $RT::DevelMode;
+    Module::Refresh->refresh if RT->Config->Get('DevelMode');
     RT::ConnectToDatabase();
 
     if ( ( !$Handler->interp->comp_exists( $cgi->path_info ) )

Modified: rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.svc.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.svc.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/bin/mason_handler.svc.in	Fri Jan 20 07:26:28 2006
@@ -110,7 +110,7 @@
 	$Win32::TieRegistry::Registry->{
 	    'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\\'.
 	    'W3SVC\Parameters\Virtual Roots\\'
-	}->{$RT::WebPath || '/'} = "$path,,205";
+	}->{RT->Config->Get('WebPath') || '/'} = "$path,,205";
 	    
 	$Win32::TieRegistry::Registry->{
 	    'HKEY_LOCAL_MACHINE\Software\FASTCGI\.html\\'
@@ -230,7 +230,8 @@
     my $comp = $ENV{'PATH_INFO'};
 
     $comp = $1 if ($comp =~ /^(.*)$/);
-    $comp =~ s|^$RT::WebPath\b||i;
+    my $web_path = RT->Config->Get('WebPath');
+    $comp =~ s|^\Q$web_path\E\b||i;
     $comp .= "index.html" if ($comp =~ /\/$/);
     $comp =~ s/.pl$/.html/g;
     

Modified: rt/branches/3.7-EXPERIMENTAL/bin/standalone_httpd.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/bin/standalone_httpd.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/bin/standalone_httpd.in	Fri Jan 20 07:26:28 2006
@@ -52,12 +52,12 @@
     use lib( "@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
     use RT;
     RT::LoadConfig();
-    if ($RT::DevelMode) { require Module::Refresh; }
+    if (RT->Config->Get('DevelMode')) { require Module::Refresh; }
 }
 
 RT::Init();
 
-my $port = shift @ARGV || $RT::WebPort || '8080';
+my $port = shift @ARGV || RT->Config->Get('WebPort') || '8080';
 use RT::Interface::Web::Standalone;
 my $server = RT::Interface::Web::Standalone->new;
 $server->port($port);

Modified: rt/branches/3.7-EXPERIMENTAL/bin/webmux.pl.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/bin/webmux.pl.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/bin/webmux.pl.in	Fri Jan 20 07:26:28 2006
@@ -72,7 +72,7 @@
 #This drags in RT's config.pm
 BEGIN {
     RT::LoadConfig();
-    if ($RT::DevelMode) { require Module::Refresh; }
+    if (RT->Config->Get('DevelMode')) { require Module::Refresh; }
 }
 
 
@@ -84,9 +84,9 @@
 
 use RT::Interface::Web;
 use RT::Interface::Web::Handler;
-$Handler = RT::Interface::Web::Handler->new(@RT::MasonParameters);
+$Handler = RT::Interface::Web::Handler->new(RT->Config->Get('MasonParameters'));
 
-if ($ENV{'MOD_PERL'} && !$RT::DevelMode) {
+if ($ENV{'MOD_PERL'} && !RT->Config->Get('DevelMode')) {
     # Under static_source, we need to purge the component cache
     # each time we restart, so newer components may be reloaded.
     #
@@ -113,7 +113,7 @@
         #$r->content_type !~ m!(^text/|\bxml\b)!i or return -1;
 #    }
 
-    Module::Refresh->refresh if $RT::DevelMode;
+    Module::Refresh->refresh if RT->Config->Get('DevelMode');
 
     RT::Init();
 

Modified: rt/branches/3.7-EXPERIMENTAL/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/etc/RT_Config.pm.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/etc/RT_Config.pm.in	Fri Jan 20 07:26:28 2006
@@ -238,7 +238,7 @@
 
 # sprintf() format of the friendly 'From:' header; its arguments
 # are WatcherType and TicketId.
-Set($FriendlyToLineFormat, "\"%s of $RT::rtname Ticket #%s\":;");
+Set($FriendlyToLineFormat, "\"%s of $Config->Get('rtname') Ticket #%s\":;");
 
 # By default, RT doesn't notify the person who performs an update, as they
 # already know what they've done. If you'd like to change this behaviour,
@@ -246,7 +246,8 @@
 
 Set($NotifyActor, 0);
 
-# By default, RT records each message it sends out to its own internal database.# To change this behaviour, set $RecordOutgoingEmail to 0 
+# By default, RT records each message it sends out to its own internal database.
+# To change this behaviour, set $RecordOutgoingEmail to 0 
 
 Set($RecordOutgoingEmail, 1);
 
@@ -285,7 +286,7 @@
 # Log::Dispatch::Syslog documentation for more information.)  (Maybe
 # ident too, if you have multiple RT installations.)
 
- at LogToSyslogConf = () unless (@LogToSyslogConf);
+Set(@LogToSyslogConf, ());
 
 # RT has rudimentary SQL statement logging support if you have
 # DBIx-SearchBuilder 1.31_1 or higher; simply set $StatementLog to be
@@ -327,17 +328,17 @@
 # This is the Scheme, server and port for constructing urls to webrt
 # $WebBaseURL doesn't need a trailing /
 
-Set($WebBaseURL , "http://localhost:$WebPort");
+Set($WebBaseURL , "http://localhost:". $Config->Get('WebPort'));
 
-Set($WebURL , $WebBaseURL . $WebPath . "/");
+Set($WebURL , $Config->Get('WebBaseURL') . $Config->Get('WebPath') . "/");
 
 # $WebImagesURL points to the base URL where RT can find its images.
 
-Set($WebImagesURL , $WebPath . "/NoAuth/images/");
+Set($WebImagesURL , $Config->Get('WebPath') . "/NoAuth/images/");
 
 # $LogoURL points to the URL of the RT logo displayed in the web UI
 
-Set($LogoURL , $WebImagesURL . "bplogo.gif");
+Set($LogoURL , $Config->Get('WebImagesURL') . "bplogo.gif");
 
 # WebNoAuthRegex - What portion of RT's URLspace should not require
 # authentication.
@@ -450,12 +451,12 @@
 #     use MasonX::Profiler; # available on CPAN
 #     @MasonParameters = (preamble => 'my $p = MasonX::Profiler->new($m, $r);');
 
- at MasonParameters = () unless (@MasonParameters);
+Set(@MasonParameters, ());
 
 # $DefaultSearchResultFormat is the default format for RT search results
 Set ($DefaultSearchResultFormat, qq{
-   '<B><A HREF="$RT::WebPath/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#',
-   '<B><A HREF="$RT::WebPath/Ticket/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject',
+   '<B><A HREF="}. RT->Config->Get('WebPath') .qq{/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#',
+   '<B><A HREF="}. RT->Config->Get('WebPath') .qq{/Ticket/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject',
    Status,
    QueueName, 
    OwnerName, 
@@ -477,13 +478,13 @@
 # interface.  Defaults to all *.po lexicons; setting it to qw(en ja) will make
 # RT bilingual instead of multilingual, but will save some memory.
 
- at LexiconLanguages = qw(*) unless (@LexiconLanguages);
+Set(@LexiconLanguages, qw(*));
 
 # An array that contains default encodings used to guess which charset
 # an attachment uses if not specified.  Must be recognized by
 # Encode::Guess.
 
- at EmailInputEncodings = qw(utf-8 iso-8859-1 us-ascii) unless (@EmailInputEncodings);
+Set(@EmailInputEncodings, qw(utf-8 iso-8859-1 us-ascii));
 
 # The charset for localized email.  Must be recognized by Encode.
 
@@ -521,8 +522,8 @@
 # WARNING. DO NOT DELETE ANY OF THE DEFAULT STATUSES. If you do, RT
 # will break horribly.
 
- at ActiveStatus = qw(new open stalled) unless @ActiveStatus;
- at InactiveStatus = qw(resolved rejected deleted) unless @InactiveStatus;
+Set(@ActiveStatus, qw(new open stalled));
+Set(@InactiveStatus, qw(resolved rejected deleted));
 
 # }}}
 

Modified: rt/branches/3.7-EXPERIMENTAL/etc/acl.Informix
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/etc/acl.Informix	(original)
+++ rt/branches/3.7-EXPERIMENTAL/etc/acl.Informix	Fri Jan 20 07:26:28 2006
@@ -1,5 +1,6 @@
+
 sub acl {
-return  (
-"GRANT RESOURCE TO ${RT::DatabaseUser};");
+    return ("GRANT RESOURCE TO ". RT->Config->Get('DatabaseUser') .";");
 }
+
 1;

Modified: rt/branches/3.7-EXPERIMENTAL/etc/acl.Oracle
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/etc/acl.Oracle	(original)
+++ rt/branches/3.7-EXPERIMENTAL/etc/acl.Oracle	Fri Jan 20 07:26:28 2006
@@ -1,10 +1,15 @@
+
 sub acl {
-return (
-"CREATE USER ${RT::DatabaseUser} identified by ${RT::DatabasePassword} ".
-"default tablespace USERS " .
-"temporary tablespace TEMP " .
-"quota unlimited on USERS" ,
-"grant connect, resource to ${RT::DatabaseUser}"
-);
+    my $db_user = RT->Config->Get('DatabaseUser');
+    my $db_pass = RT->Config->Get('DatabasePassword');
+
+    return (
+        "CREATE USER $db_name identified by $db_pass"
+            . " default tablespace USERS"
+            . " temporary tablespace TEMP"
+            . " quota unlimited on USERS",
+        "grant connect, resource to $db_user",
+    );
 }
+
 1;

Modified: rt/branches/3.7-EXPERIMENTAL/etc/acl.Pg
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/etc/acl.Pg	(original)
+++ rt/branches/3.7-EXPERIMENTAL/etc/acl.Pg	Fri Jan 20 07:26:28 2006
@@ -1,67 +1,67 @@
+
 sub acl {
     my $dbh = shift;
 
     my @acls;
 
     my @tables = qw (
-
-      attachments_id_seq
-      Attachments
-      Attributes
-      attributes_id_seq
-      queues_id_seq
- Queues 
-      links_id_seq
- Links 
-      principals_id_seq
- Principals 
-      groups_id_seq
- Groups 
-      scripconditions_id_seq
- ScripConditions 
-      transactions_id_seq
- Transactions 
-      scrips_id_seq
- Scrips 
-      acl_id_seq
- ACL 
-      groupmembers_id_seq
- GroupMembers 
-      cachedgroupmembers_id_seq
- CachedGroupMembers 
-      users_id_seq
- Users 
-      tickets_id_seq
- Tickets 
-      scripactions_id_seq
- ScripActions 
-      templates_id_seq
- Templates 
- objectcustomfieldvalues_id_s
- ObjectCustomFieldValues 
-      customfields_id_seq
- CustomFields 
- objectcustomfields_id_s
- ObjectCustomFields 
-      customfieldvalues_id_seq
-      CustomFieldValues
-      sessions
+        attachments_id_seq
+        Attachments
+        Attributes
+        attributes_id_seq
+        queues_id_seq
+        Queues 
+        links_id_seq
+        Links 
+        principals_id_seq
+        Principals 
+        groups_id_seq
+        Groups 
+        scripconditions_id_seq
+        ScripConditions 
+        transactions_id_seq
+        Transactions 
+        scrips_id_seq
+        Scrips 
+        acl_id_seq
+        ACL 
+        groupmembers_id_seq
+        GroupMembers 
+        cachedgroupmembers_id_seq
+        CachedGroupMembers 
+        users_id_seq
+        Users 
+        tickets_id_seq
+        Tickets 
+        scripactions_id_seq
+        ScripActions 
+        templates_id_seq
+        Templates 
+        objectcustomfieldvalues_id_s
+        ObjectCustomFieldValues 
+        customfields_id_seq
+        CustomFields 
+        objectcustomfields_id_s
+        ObjectCustomFields 
+        customfieldvalues_id_seq
+        CustomFieldValues
+        sessions
     );
 
+    my $db_user = RT->Config->Get('DatabaseUser');
+    my $db_pass = RT->Config->Get('DatabasePassword');
+
     # if there's already an rt_user, drop it.
-    my @row =
-      $dbh->selectrow_array( "select usename from pg_user where usename = '" . $RT::DatabaseUser."'" );
+    my @row = $dbh->selectrow_array( "select usename from pg_user where usename = '$db_user'" );
     if ( $row[0] ) {
-        push @acls, "drop user ${RT::DatabaseUser};",;
+        push @acls, "drop user $db_user;";
     }
 
-    push @acls, "create user ${RT::DatabaseUser} with password '${RT::DatabasePassword}' NOCREATEDB NOCREATEUSER;";
+    push @acls, "create user $db_user with password '$db_pass' NOCREATEDB NOCREATEUSER;";
     foreach my $table (@tables) {
-        push @acls,
-          "GRANT SELECT, INSERT, UPDATE, DELETE ON $table to "
-          . $RT::DatabaseUser . ";";
-
+        push @acls, "GRANT SELECT, INSERT, UPDATE, DELETE ON $table to $db_user;"
     }
     return (@acls);
 }
+
 1;

Modified: rt/branches/3.7-EXPERIMENTAL/etc/acl.Sybase
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/etc/acl.Sybase	(original)
+++ rt/branches/3.7-EXPERIMENTAL/etc/acl.Sybase	Fri Jan 20 07:26:28 2006
@@ -1,6 +1,10 @@
+
 sub acl {
-return (
-"SP_ADDLOGIN ${RT::DatabaseUser}, ${RT::DatabasePassword}, ${RT::DatabaseName} ",
-);
+    my $db_name = RT->Config->Get('DatabaseName');
+    my $db_user = RT->Config->Get('DatabaseUser');
+    my $db_pass = RT->Config->Get('DatabasePassword');
+
+    return ("SP_ADDLOGIN $db_user, $db_pass, $db_name");
 }
+
 1;

Modified: rt/branches/3.7-EXPERIMENTAL/etc/acl.mysql
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/etc/acl.mysql	(original)
+++ rt/branches/3.7-EXPERIMENTAL/etc/acl.mysql	Fri Jan 20 07:26:28 2006
@@ -1,9 +1,19 @@
+
 sub acl {
-return () if !$RT::DatabaseUser or $RT::DatabaseUser eq 'root';
-return  (
-"USE mysql;",
-"DELETE FROM user WHERE user = '${RT::DatabaseUser}';",
-"DELETE FROM db where db = '${RT::DatabaseName}';",
-"GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE ON ${RT::DatabaseName}.* TO ${RT::DatabaseUser}\@'${RT::DatabaseRTHost}' IDENTIFIED BY '${RT::DatabasePassword}';");
+    my $db_name = RT->Config->Get('DatabaseName');
+    my $db_rthost = RT->Config->Get('DatabaseRTHost');
+    my $db_user = RT->Config->Get('DatabaseUser');
+    my $db_pass = RT->Config->Get('DatabasePassword');
+    return () if !$db_user || $db_user eq 'root';
+    return  (
+        "USE mysql;",
+        "DELETE FROM user WHERE user = '$db_user';",
+        "DELETE FROM db where db = '$db_name';",
+        "GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE
+               ON $db_name.*
+               TO $db_name\@'$db_rthost'
+               IDENTIFIED BY '$db_pass';",
+    );
 }
+
 1;

Modified: rt/branches/3.7-EXPERIMENTAL/etc/initialdata
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/etc/initialdata	(original)
+++ rt/branches/3.7-EXPERIMENTAL/etc/initialdata	Fri Jan 20 07:26:28 2006
@@ -231,11 +231,11 @@
 a summary of which appears below.
 
 There is no need to reply to this message right now.  Your ticket has been
-assigned an ID of [{$rtname} #{$Ticket->id()}].
+assigned an ID of [{RT->Config->Get(\'rtname\')} #{$Ticket->id()}].
 
 Please include the string:
 
-         [{$rtname} #{$Ticket->id}]
+         [{RT->Config->Get(\'rtname\')} #{$Ticket->id}]
 
 in the subject line of all future correspondence about this issue. To do so, 
 you may reply to this message.
@@ -261,7 +261,7 @@
        Owner: {$Ticket->OwnerObj->Name}
   Requestors: {$Ticket->RequestorAddresses}
       Status: {$Ticket->Status}
- Ticket <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
+ Ticket <URL: {RT->Config->Get(\'WebURL\')}/Ticket/Display.html?id={$Ticket->id} >
 
 
 {$Transaction->Content()}
@@ -276,7 +276,7 @@
       Content     => 'RT-Attach-Message: yes
 
 
-<URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
+<URL: {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id} >
 
 {$Transaction->Content()}
 '
@@ -298,7 +298,7 @@
 'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject); $s =~ s/\\[Comment\\]//g; $comment =~ s/^Re//i; $s;}
 
 
-{$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
+{RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id}
 This is a comment.  It is not sent to the Requestor(s):
 
 {$Transaction->Content()}
@@ -311,7 +311,7 @@
        Content     => 'Subject: Status Changed to: {$Transaction->NewValue}
 
 
-{$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
+{RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id}
 
 {$Transaction->Content()}
 '
@@ -339,8 +339,8 @@
 There is a new item pending your approval: "{$Ticket->Subject()}", 
 a summary of which appears below.
 
-Please visit {$RT::WebURL}Approvals/Display.html?id={$Ticket->id}
-to approve or reject this ticket, or {$RT::WebURL}Approvals/ to
+Please visit {RT->Config->Get(\'WebURL\')}Approvals/Display.html?id={$Ticket->id}
+to approve or reject this ticket, or {RT->Config->Get(\'WebURL\')}Approvals/ to
 batch-process all your pending approvals.
 
 -------------------------------------------------------------------------
@@ -547,6 +547,7 @@
 	$obj->SetStatus( Status => 'open', Force => 1 );
     }
     elsif ($RT::UseCodeTickets and $obj->Type eq 'code') {
+        #XXX: $RT::UseCodeTickets used only once here!!!
 	my $code = $obj->Transactions->First->Content;
 	my $rv;
 
@@ -592,19 +593,26 @@
     { Name => 'Search - My Tickets',
       Description => '[_1] highest priority tickets I own', # loc
       Content     =>
-      { Format => "'<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', Priority, QueueName, ExtendedStatus",
+      { Format =>  q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
+                 . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
+                 . q{Priority, QueueName, ExtendedStatus},
         Query   => " Owner = '__CurrentUser__' AND ( Status = 'new' OR Status = 'open')",
         OrderBy => 'Priority',
-        Order   => 'DESC' },
+        Order   => 'DESC'
+      },
     },
     { Name => 'Search - Unowned Tickets',
       Description => '[_1] newest unowned tickets', # loc
       Content     =>
 # 'Take' #loc
-      { Format => "'<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', QueueName, ExtendedStatus, CreatedRelative, '<A HREF=\"__WebPath__/Ticket/Display.html?Action=Take&id=__id__\">__loc(Take)__</a>/TITLE:&nbsp;' ",
+      { Format =>  q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
+                 . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
+                 . q{QueueName, ExtendedStatus, CreatedRelative, }
+                 . q{'<A HREF="__WebPath__/Ticket/Display.html?Action=Take&id=__id__">__loc(Take)__</a>/TITLE:&nbsp;'},
         Query   => " Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')",
         OrderBy => 'Created',
-        Order   => 'DESC' },
+        Order   => 'DESC'
+      },
     },
     { Name => 'HomepageSettings',
       Description => 'HomepageSettings',

Modified: rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditQueueWatchers
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditQueueWatchers	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditQueueWatchers	Fri Jan 20 07:26:28 2006
@@ -54,9 +54,9 @@
 <input type="checkbox" class="checkbox" name="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1"
         unchecked />
 % if ($watcher->MemberObj->IsUser) { 
-<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->ObjectId%>">
+<a href="<%RT->Config->Get('WebPath')%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->ObjectId%>">
 % } else {
-<a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->ObjectId%>">
+<a href="<%RT->Config->Get('WebPath')%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->ObjectId%>">
 % }
 <%$watcher->MemberObj->Object->Name%></a>
 % }

Modified: rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/PickCustomFields
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/PickCustomFields	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/PickCustomFields	Fri Jan 20 07:26:28 2006
@@ -80,7 +80,7 @@
 %  # show 'move down' unless it's the last item
 %  if ($count != @CustomFields and $Checked) {
 %  $m->print(' | ') if $count > 1;
-    [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>]
+    [<a href="<%RT->Config->Get('WebPath')%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>]
 %  }
   </td>
 </tr>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/Modify.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/Modify.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/Modify.html	Fri Jan 20 07:26:28 2006
@@ -112,7 +112,7 @@
 <input type="hidden" class="hidden" name="SetPrivileged" value="1" />
 <input type="checkbox" class="checkbox" name="Privileged" value="1" <%$PrivilegedChecked%> /> <&|/l&>Let this user be granted rights</&><br />
 		    
-% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
+% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) {
 <table>
 <tr>
 <td align="right">

Modified: rt/branches/3.7-EXPERIMENTAL/html/Approvals/Display.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Approvals/Display.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Approvals/Display.html	Fri Jan 20 07:26:28 2006
@@ -48,7 +48,7 @@
 <& Elements/Tabs, 
     current_tab => "Approvals/Display.html", 
     Title =>  $title &>
-<form method="post" action="<%$RT::WebPath%>/Approvals/index.html">
+<form method="post" action="<%RT->Config->Get('WebPath')%>/Approvals/index.html">
 
 <&| /Widgets/TitleBox, title => $title &>
 <& /Ticket/Elements/ShowHistory , Ticket => $Ticket, Collapsed => 0, ShowTitle => 0, ShowHeaders => 0, ShowDisplayModes => 0, ShowTitleBarCommands => 0 &>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Approvals/Elements/Approve
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Approvals/Elements/Approve	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Approvals/Elements/Approve	Fri Jan 20 07:26:28 2006
@@ -45,12 +45,12 @@
 %# END BPS TAGGED BLOCK }}}
 <div class="approval">
   <div class="name">
-    <a href="<%$RT::WebPath%>/Approvals/Display.html?id=<%$ticket->Id%>"><% loc("#[_1]: [_2]", $ticket->Id, $ticket->Subject) %></a> (<%loc($ticket->Status)%>)</font>
+    <a href="<%RT->Config->Get('WebPath')%>/Approvals/Display.html?id=<%$ticket->Id%>"><% loc("#[_1]: [_2]", $ticket->Id, $ticket->Subject) %></a> (<%loc($ticket->Status)%>)</font>
   </div>
 % if ($ShowApproving) {
 %     foreach my $approving ( $ticket->AllDependedOnBy( Type => 'ticket' ) ) {
   <div class="originating-ticket">
-    <span class="link"><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<% $approving->Id %>"><&|/l, $approving->Id, $approving->Subject &>Originating ticket: #[_1]</&></a></span>
+    <span class="link"><a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<% $approving->Id %>"><&|/l, $approving->Id, $approving->Subject &>Originating ticket: #[_1]</&></a></span>
     <div class="info">
       <& /Ticket/Elements/ShowCustomFields, Ticket => $approving &>
       <& /Ticket/Elements/ShowHistory, Ticket => $approving, Collapsed => 0, ShowTitle => 0, ShowHeaders => 0, ShowDisplayModes => 0, ShowTitleBarCommands => 0 &>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Download/CustomFieldValue/dhandler
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Download/CustomFieldValue/dhandler	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Download/CustomFieldValue/dhandler	Fri Jan 20 07:26:28 2006
@@ -61,7 +61,7 @@
 
 my $content_type = $OCFV->ContentType || 'text/plain';
     
-unless ($RT::TrustHTMLAttachments) {
+unless (RT->Config->Get('TrustHTMLAttachments')) {
     $content_type = 'text/plain' if ($content_type =~ /^text\/html/i);
 }
 

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/Callback
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/Callback	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/Callback	Fri Jan 20 07:26:28 2006
@@ -75,7 +75,7 @@
     }
     
     $m->notes($CacheKey => $callbacks);
-    $cache{$Page,$_CallbackName} = $callbacks if !$RT::DevelMode;
+    $cache{$Page,$_CallbackName} = $callbacks if !RT->Config->Get('DevelMode');
 }
 
 my @rv;

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/CreateTicket
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/CreateTicket	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/CreateTicket	Fri Jan 20 07:26:28 2006
@@ -43,6 +43,6 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<form action="<% $RT::WebPath %>/Ticket/Create.html" name="CreateTicketInQueue">
+<form action="<% RT->Config->Get('WebPath') %>/Ticket/Create.html" name="CreateTicketInQueue">
 <&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&><input type="submit" class="button" value="New ticket in" />&nbsp;[_1]</&>
 </form>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomFieldSelect
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomFieldSelect	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomFieldSelect	Fri Jan 20 07:26:28 2006
@@ -52,7 +52,7 @@
 %       my $id = $NamePrefix . $CustomField->Id;
 %       my $out = $m->scomp('SELF:options', %ARGS, SelectedRef => \$selected, CategoryRef => \@category);
 %       if (@category) {
-<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/cascaded.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/cascaded.js"></script>
 %#      XXX - Hide this select from w3m?
       <select onchange="filter_cascade('<% $id %>-Values', this.value)" name="<% $id %>-Category">
         <option value="" <% !$selected && 'selected' %>><&|/l&>-</&></option>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/Header
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/Header	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/Header	Fri Jan 20 07:26:28 2006
@@ -53,14 +53,14 @@
 % if ($Refresh > 0) {
     <meta http-equiv="refresh" content="<%$Refresh%>" />
 % }
-    <link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png" />
-    <link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/<% $RT::WebDefaultStylesheet %>/main.css" type="text/css" media="all" />
-    <link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/print.css" type="text/css" media="print" />
+    <link rel="shortcut icon" href="<%RT->Config->Get('WebImagesURL')%>/favicon.png" type="image/png" />
+    <link rel="stylesheet" href="<%RT->Config->Get('WebPath')%>/NoAuth/css/<% RT->Config->Get('WebDefaultStylesheet') %>/main.css" type="text/css" media="all" />
+    <link rel="stylesheet" href="<%RT->Config->Get('WebPath')%>/NoAuth/css/print.css" type="text/css" media="print" />
 % if ($RSSAutoDiscovery) {
     <link rel="alternate" href="<%$RSSAutoDiscovery%>" type="application/rss+xml" title="RSS RT Search" />
 % }
-    <script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/util.js"></script>
-    <script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/titlebox-state.js"></script>
+    <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/util.js"></script>
+    <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/titlebox-state.js"></script>
     <script type="text/javascript"><!--
         onLoadHook("loadTitleBoxStates()");
 % if ($Focus) {
@@ -86,12 +86,12 @@
     <&|/l&>Not logged in.</&>
 % }
 %if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
-    | <a href="<%$RT::WebPath%><%$Prefs%>"><&|/l&>Preferences</&></a>
+    | <a href="<%RT->Config->Get('WebPath')%><%$Prefs%>"><&|/l&>Preferences</&></a>
 % }
   <& /Elements/Callback, %ARGS &>
 % unless (!$session{'CurrentUser'}->Name
-%         or ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth)) {
-    | <a  href="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
+%         or (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth'))) {
+    | <a  href="<%RT->Config->Get('WebPath')%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
 % }
   </div>
 % }

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/Login
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/Login	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/Login	Fri Jan 20 07:26:28 2006
@@ -60,7 +60,7 @@
 
 my $form_action = defined $goto             ? $goto
                 : defined $req_uri          ? $req_uri
-                :                             $RT::WebPath
+                :                             RT->Config->Get('WebPath')
                 ;
 </%INIT>
 
@@ -84,7 +84,7 @@
 <div id="login-box">
 <&| /Widgets/TitleBox, title => loc('Login'), titleright => $RT::VERSION, hideable => 0 &>
 
-% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
+% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) {
 <form id="login" name="login" method="post" action="<% $form_action %>">
 
 <div class="input-row">

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/Menu	Fri Jan 20 07:26:28 2006
@@ -84,7 +84,7 @@
 %
 %     $class->{li} = join ' ', @li;
 %     
-  <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">&#183; </span>]|n%><a href="<%$RT::WebPath%>/<%$toptabs->{$tab}->{'path'}%>"<% $class->{a} && qq[ class="$class->{a}"] |n%><% !$level && " accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></a>
+  <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">&#183; </span>]|n%><a href="<%RT->Config->Get('WebPath')%>/<%$toptabs->{$tab}->{'path'}%>"<% $class->{a} && qq[ class="$class->{a}"] |n%><% !$level && " accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></a>
 %# Second-level items
 %     if ($toptabs->{$tab}->{'subtabs'}
 %         and keys %{$toptabs->{$tab}->{'subtabs'}})

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/MessageBox
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/MessageBox	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/MessageBox	Fri Jan 20 07:26:28 2006
@@ -64,9 +64,9 @@
 $QuoteTransaction => undef
 $Name => 'Content'
 $Default => ''
-$Width => $RT::MessageBoxWidth || 72
+$Width => RT->Config->Get('MessageBoxWidth') || 72
 $Height => $RT::MessageBoxHeight || 15
-$Wrap => $RT::MessageBoxWrap || 'HARD'
+$Wrap => RT->Config->Get('MessageBoxWrap') || 'HARD'
 $IncludeSignature => 1
 </%ARGS>
 

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/MyRT
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/MyRT	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/MyRT	Fri Jan 20 07:26:28 2006
@@ -60,7 +60,7 @@
 <%INIT>
 
 # XXX: we don't use this, but should.
-my %allowed_components = map {$_ => 1} @{$RT::HomepageComponents};
+my %allowed_components = map {$_ => 1} @{RT->Config->Get('HomepageComponents')};
 
 $Portlets ||= $session{'my_rt_portlets'};
 unless ( $Portlets ) {

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/MyReminders
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/MyReminders	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/MyReminders	Fri Jan 20 07:26:28 2006
@@ -53,7 +53,7 @@
 % $i++;
 % if ($reminder->RefersTo->First) {
 % my $ticket= $reminder->RefersTo->First->TargetObj;
-<tr class="<%$i%2 ? 'evenline' : 'oddline'%>"><td><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$ticket->id%>"><%$reminder->Subject%></a><br />
+<tr class="<%$i%2 ? 'evenline' : 'oddline'%>"><td><a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$ticket->id%>"><%$reminder->Subject%></a><br />
 <blockquote>
 #<%$ticket->id%>: <%$ticket->Subject%><br />
 <%$reminder->OwnerObj->Name %>  <%$reminder->DueObj->Unix >0 ? '&bull; '.$reminder->DueObj->AgeAsString : '' |n %>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout	Fri Jan 20 07:26:28 2006
@@ -94,7 +94,7 @@
 %         $class->{li} = join ' ', @li;
 %     
 %
-    <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "&#183; "|n%><a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li>
+    <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "&#183; "|n%><a href="<%RT->Config->Get('WebPath')%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li>
 %
 %         if ($sep) {
     <li class="separator">&#183;&#183;&#183;</li>
@@ -139,7 +139,7 @@
 %         if ($type->{"$action"}->{'html'}) {
       <% $type->{"$action"}->{'html'} | n %>
 %         } else {
-      <a href="<%$RT::WebPath%>/<%$type->{$action}->{'path'}%>"<% $type->{$action}->{class} && ' class="'.$type->{$action}->{class}.'"' |n %><% $type->{$action}->{id} && ' id="'.$type->{$action}->{id}.'"' |n %>><%$type->{$action}->{'title'}%></a>
+      <a href="<%RT->Config->Get('WebPath')%>/<%$type->{$action}->{'path'}%>"<% $type->{$action}->{class} && ' class="'.$type->{$action}->{class}.'"' |n %><% $type->{$action}->{id} && ' id="'.$type->{$action}->{id}.'"' |n %>><%$type->{$action}->{'title'}%></a>
 %         }
     </li>
 %         if ($sep) {
@@ -169,12 +169,12 @@
 }
 
 if (! defined($AppName)) {
-  $AppName = loc("RT for [_1]", $RT::rtname);
+  $AppName = loc("RT for [_1]", RT->Config->Get('rtname'));
 }
 
 my ($menu_depth, $almost_last, $page_tabs);
 
-if ($RT::WebDefaultStylesheet ne '3.4-compat') {
+if (RT->Config->Get('WebDefaultStylesheet') ne '3.4-compat') {
     ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
 
     if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/Quicksearch
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/Quicksearch	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/Quicksearch	Fri Jan 20 07:26:28 2006
@@ -45,7 +45,7 @@
 %# END BPS TAGGED BLOCK }}}
 <div class="ticket-overview">
 <&|/Widgets/TitleBox, title => loc("Quick search"), bodyclass => "",
-   titleright => loc("Edit"), titleright_href => $RT::WebPath.'/Prefs/Quicksearch.html' &>
+   titleright => loc("Edit"), titleright_href => RT->Config->Get('WebPath').'/Prefs/Quicksearch.html' &>
 <& /Elements/QueueSummary,
    cache => 'quick_search_queues',
    queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') && !exists $unwanted->{$_->Name} },

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldBinary
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldBinary	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldBinary	Fri Jan 20 07:26:28 2006
@@ -43,7 +43,7 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content %>"><% $Object->Content %></a>
+<a href="<%RT->Config->Get('WebPath')%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content %>"><% $Object->Content %></a>
 <%ARGS>
 $Object => undef
 </%ARGS>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldImage
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldImage	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldImage	Fri Jan 20 07:26:28 2006
@@ -43,7 +43,7 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-%    my $url = $RT::WebPath . "/Download/CustomFieldValue/".$Object->Id.'/'.$Object->Content;
+%    my $url = RT->Config->Get('WebPath') . "/Download/CustomFieldValue/".$Object->Id.'/'.$Object->Content;
 <a href="<% $url %>"><% $Object->Content %></a>
 <img type="<% $Object->ContentType %>" height="64" src="<% $url %>" align="middle" />
 <%ARGS>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldWikitext
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldWikitext	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowCustomFieldWikitext	Fri Jan 20 07:26:28 2006
@@ -46,7 +46,7 @@
 % my $content = $Object->LargeContent || $Object->Content;
 % $content = $m->comp('/Elements/ScrubHTML', Content => $content);
 % my $base = $Object->Object->WikiBase;
-% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1,  absolute_links => 1, implicit_links => $RT::WikiImplicitLinks, prefix => $base} );
+% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1,  absolute_links => 1, implicit_links => RT->Config->Get('WikiImplicitLinks'), prefix => $base} );
 <%$wiki_content|n%>
 <%init>
 use Text::WikiFormat;

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowMemberships
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowMemberships	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowMemberships	Fri Jan 20 07:26:28 2006
@@ -48,7 +48,7 @@
 %    my $Group = RT::Group->new($session{'CurrentUser'});
 %    $Group->Load($GroupMember->GroupId) or next;
 %    if ($Group->Domain eq 'UserDefined') {
-<li><a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<% $Group->Id %>"><% $Group->Name %></a></li>
+<li><a href="<%RT->Config->Get('WebPath')%>/Admin/Groups/Modify.html?id=<% $Group->Id %>"><% $Group->Name %></a></li>
 %    } elsif ($Group->Domain eq 'SystemInternal') {
 <li><em><% loc($Group->Type) %></em></li>
 %    }

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowSearch
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowSearch	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/ShowSearch	Fri Jan 20 07:26:28 2006
@@ -66,7 +66,7 @@
 	$m->out ("Saved Search $SavedSearch not found");
 	return;
     }
-    $customize = $RT::WebPath.'/Search/Build.html?'.
+    $customize = RT->Config->Get('WebPath').'/Search/Build.html?'.
 	$m->comp('/Elements/QueryString',
 		 LoadSavedSearch => $SavedSearch);
 }
@@ -77,12 +77,12 @@
 	return;
     }
     $SearchArg = $user->Preferences($search, $search->Content);
-    $customize = $RT::WebPath.'/Prefs/Search.html?'.$m->comp('/Elements/QueryString', name => ref($search).'-'.$search->Id)
+    $customize = RT->Config->Get('WebPath').'/Prefs/Search.html?'.$m->comp('/Elements/QueryString', name => ref($search).'-'.$search->Id)
 }
 
-my $rows = $user->Preferences('SummaryRows', $RT::DefaultSummaryRows);
+my $rows = $user->Preferences('SummaryRows', RT->Config->Get('DefaultSummaryRows'));
 $SearchArg->{'Query'} =~ s/__CurrentUser__/$session{'CurrentUser'}->Id/ge;
-$SearchArg->{'Format'} =~ s/__WebPath__/$RT::WebPath/g;
+$SearchArg->{'Format'} =~ s/__WebPath__/RT->Config->Get('WebPath')/g;
 $SearchArg->{'Format'} =~ s/__loc\(["']?(\w+)["']?\)__/loc("$1")/ge;
 my $QueryString = '?' . $m->comp('/Elements/QueryString',
                                   %$SearchArg);

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/SimpleSearch
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/SimpleSearch	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/SimpleSearch	Fri Jan 20 07:26:28 2006
@@ -43,7 +43,7 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<form action="<% $RT::WebPath %>/Search/Simple.html">
+<form action="<% RT->Config->Get('WebPath') %>/Search/Simple.html">
   <input size="12" name="q" autocomplete="off" accesskey="0" class="field" />
   <input type="submit" class="button" value="<&|/l&>Search</&>" />
 </form>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/TicketList	Fri Jan 20 07:26:28 2006
@@ -125,7 +125,7 @@
 $Collection->RowsPerPage($Rows) if ($Rows);
 $Collection->GotoPage($Page-1); # SB uses page 0 as the first page
 
-$Format ||= $RT::DefaultSearchResultFormat;
+$Format ||= RT->Config->Get('DefaultSearchResultFormat');
 
 # DisplayFormat lets us use a "temporary" format for display, while 
 # still using our original format for next/prev page links.
@@ -162,7 +162,7 @@
 $Order => undef
 $OrderBy => undef
 $BaseURL => undef
-$Format => $RT::DefaultSearchResultFormat
+$Format => RT->Config->Get('DefaultSearchResultFormat')
 $DisplayFormat => undef
 $ShowNavigation => 1
 $ShowHeader => 1

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/Logout.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/Logout.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/Logout.html	Fri Jan 20 07:26:28 2006
@@ -68,5 +68,5 @@
 </%INIT>
 
 <%ARGS>
-$URL => $RT::WebPath."/"
+$URL => RT->Config->Get('WebPath')."/"
 </%ARGS>

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.4-compat/nav.css
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.4-compat/nav.css	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.4-compat/nav.css	Fri Jan 20 07:26:28 2006
@@ -5,13 +5,13 @@
     font-size: 1.4em;
     color: #eee;
     margin: 0;
-    background: #4282b5 url(<%$RT::WebImagesURL%>/css/cbr.gif) no-repeat bottom right;
+    background: #4282b5 url(<%RT->Config->Get('WebImagesURL')%>/css/cbr.gif) no-repeat bottom right;
 }
 
 #nav #system-menu {
     padding: 0 0.2em 0.2em 0.2em;
     margin-top: 0;
-/*    background: transparent url(<%$RT::WebImagesURL%>/css/ctr.gif) no-repeat top right; */
+/*    background: transparent url(<%RT->Config->Get('WebImagesURL')%>/css/ctr.gif) no-repeat top right; */
 }
 
 #nav ul {

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/footer.css
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/footer.css	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/footer.css	Fri Jan 20 07:26:28 2006
@@ -55,7 +55,7 @@
 
 #footer #time {
     color: white;
-    background: #069 url(<%$RT::WebImagesURL%>/css/ctr-b2g.gif) no-repeat top right;
+    background: #069 url(<%RT->Config->Get('WebImagesURL')%>/css/ctr-b2g.gif) no-repeat top right;
     padding: 0.2em 0 0.3em 0;
     margin: 0;
     position: relative;
@@ -64,11 +64,11 @@
 
 #footer #time span {
     padding: 0.2em 2em 0.3em 3em;
-    background: url(<%$RT::WebImagesURL%>/css/cbr-b2g.gif) no-repeat bottom right;
+    background: url(<%RT->Config->Get('WebImagesURL')%>/css/cbr-b2g.gif) no-repeat bottom right;
 }
 
 #footer #bpscredits {
-    background: #ccc url(<%$RT::WebImagesURL%>/css/ctr-gray.gif) no-repeat top right;
+    background: #ccc url(<%RT->Config->Get('WebImagesURL')%>/css/ctr-gray.gif) no-repeat top right;
     padding: 0.2em 0 0.3em 0;
     margin: 0;
     position: relative;
@@ -78,7 +78,7 @@
 
 #footer #bpscredits span {
     padding: 0.2em 2em 0.3em 3em;
-    background: url(<%$RT::WebImagesURL%>/css/cbr-gray.gif) no-repeat bottom right;
+    background: url(<%RT->Config->Get('WebImagesURL')%>/css/cbr-gray.gif) no-repeat bottom right;
 }
 
 #footer #legal {

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/header.css
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/header.css	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/header.css	Fri Jan 20 07:26:28 2006
@@ -27,7 +27,7 @@
 #header #page-menu {
     position: relative;
     z-index: 2;
-    background: #069 url(<%$RT::WebImagesURL%>/css/ct.gif) no-repeat top left;
+    background: #069 url(<%RT->Config->Get('WebImagesURL')%>/css/ct.gif) no-repeat top left;
     min-width: 65%;
 }
 
@@ -50,15 +50,15 @@
     z-index: 3;
 }
 
-#page-menu div { background: url(<%$RT::WebImagesURL%>/css/cb.gif) no-repeat bottom left; }
-#page-menu div div { background: url(<%$RT::WebImagesURL%>/css/cbr.gif) no-repeat bottom right; }
+#page-menu div { background: url(<%RT->Config->Get('WebImagesURL')%>/css/cb.gif) no-repeat bottom left; }
+#page-menu div div { background: url(<%RT->Config->Get('WebImagesURL')%>/css/cbr.gif) no-repeat bottom right; }
 #page-menu div div div {
-    background: url(<%$RT::WebImagesURL%>/css/ctr.gif) no-repeat top right;
+    background: url(<%RT->Config->Get('WebImagesURL')%>/css/ctr.gif) no-repeat top right;
     padding: 0.2em 1em 0.4em 1em;
 }
 
-#page-menu.actions-present div div { background: url(<%$RT::WebImagesURL%>/css/cbr-b2lb.gif) no-repeat bottom right; }
-#page-menu.actions-present div div div { background: url(<%$RT::WebImagesURL%>/css/ctr-b2lb.gif) no-repeat top right; }
+#page-menu.actions-present div div { background: url(<%RT->Config->Get('WebImagesURL')%>/css/cbr-b2lb.gif) no-repeat bottom right; }
+#page-menu.actions-present div div div { background: url(<%RT->Config->Get('WebImagesURL')%>/css/ctr-b2lb.gif) no-repeat top right; }
 
 #header ul li {
     display: inline;
@@ -74,10 +74,10 @@
     z-index: 2;
 }
 
-/*#actions-menu div { background: url(<%$RT::WebImagesURL%>/css/cb.gif) no-repeat bottom left; }*/
-#actions-menu div div { background: url(<%$RT::WebImagesURL%>/css/cbr.gif) no-repeat bottom right; }
+/*#actions-menu div { background: url(<%RT->Config->Get('WebImagesURL')%>/css/cb.gif) no-repeat bottom left; }*/
+#actions-menu div div { background: url(<%RT->Config->Get('WebImagesURL')%>/css/cbr.gif) no-repeat bottom right; }
 #actions-menu div div div {
-    background: url(<%$RT::WebImagesURL%>/css/ctr.gif) no-repeat top right;
+    background: url(<%RT->Config->Get('WebImagesURL')%>/css/ctr.gif) no-repeat top right;
     padding: 0.2em 1em 0.4em 1em;
 }
 

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav-left.css
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav-left.css	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav-left.css	Fri Jan 20 07:26:28 2006
@@ -71,10 +71,10 @@
     background-image: none;
 }
 
-#nav ul { background: #069 url(<%$RT::WebImagesURL%>/css/ctr.gif) no-repeat top right; }
-#nav ul div { background: transparent url(<%$RT::WebImagesURL%>/css/cbr.gif) no-repeat bottom right; }
-#nav ul.odd { background: #08c url(<%$RT::WebImagesURL%>/css/ctr.gif) no-repeat top right; }
-#nav ul.odd div { background: transparent url(<%$RT::WebImagesURL%>/css/cbr.gif) no-repeat bottom right; }
+#nav ul { background: #069 url(<%RT->Config->Get('WebImagesURL')%>/css/ctr.gif) no-repeat top right; }
+#nav ul div { background: transparent url(<%RT->Config->Get('WebImagesURL')%>/css/cbr.gif) no-repeat bottom right; }
+#nav ul.odd { background: #08c url(<%RT->Config->Get('WebImagesURL')%>/css/ctr.gif) no-repeat top right; }
+#nav ul.odd div { background: transparent url(<%RT->Config->Get('WebImagesURL')%>/css/cbr.gif) no-repeat bottom right; }
 
 #nav ul div {
     display: block;

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav.css
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav.css	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/nav.css	Fri Jan 20 07:26:28 2006
@@ -89,14 +89,14 @@
 html>body #nav :visited.selected
 {
     padding-bottom: 0.8em;
-    background: transparent url(<%$RT::WebImagesURL%>/css/dark-arrow.png) no-repeat bottom center;
+    background: transparent url(<%RT->Config->Get('WebImagesURL')%>/css/dark-arrow.png) no-repeat bottom center;
 }
 
 html>body #nav :link.selected.odd,
 html>body #nav :visited.selected.odd
 {
     padding-bottom: 0.8em;
-    background: transparent url(<%$RT::WebImagesURL%>/css/light-arrow.png) no-repeat bottom center;
+    background: transparent url(<%RT->Config->Get('WebImagesURL')%>/css/light-arrow.png) no-repeat bottom center;
 }
 
 /*

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/titlebox.css
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/titlebox.css	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/css/3.5-default/titlebox.css	Fri Jan 20 07:26:28 2006
@@ -72,7 +72,7 @@
   padding-top: 1em;
   width: 20px;
 
-  background: url(<%$RT::WebImagesURL%>/css/rollup-arrow.gif) no-repeat center center;
+  background: url(<%RT->Config->Get('WebImagesURL')%>/css/rollup-arrow.gif) no-repeat center center;
   
   margin: 0;
   text-indent: -9999px;
@@ -109,7 +109,7 @@
 }
 
 .titlebox.rolled-up .titlebox-title .widget a {
-    background-image: url(<%$RT::WebImagesURL%>/css/rolldown-arrow.gif);
+    background-image: url(<%RT->Config->Get('WebImagesURL')%>/css/rolldown-arrow.gif);
 }
 
 #body .titlebox .titlebox-title :link,

Modified: rt/branches/3.7-EXPERIMENTAL/html/NoAuth/js/titlebox-state.js
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/NoAuth/js/titlebox-state.js	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/NoAuth/js/titlebox-state.js	Fri Jan 20 07:26:28 2006
@@ -1,5 +1,5 @@
 function createCookie(name,value,days) {
-    var path = "<%$RT::WebPath%>" ? "<%$RT::WebPath%>" : "/";
+    var path = "<%RT->Config->Get('WebPath')%>" ? "<%RT->Config->Get('WebPath')%>" : "/";
 
     if (days) {
         var date = new Date();

Modified: rt/branches/3.7-EXPERIMENTAL/html/Prefs/MyRT.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Prefs/MyRT.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Prefs/MyRT.html	Fri Jan 20 07:26:28 2006
@@ -84,7 +84,7 @@
         push @results, loc ('Preferences saved for [_1].', loc('summary rows'));
     }
 }
-$ARGS{'SummaryRows'} ||= $user->Preferences('SummaryRows', $RT::DefaultSummaryRows);
+$ARGS{'SummaryRows'} ||= $user->Preferences('SummaryRows', RT->Config->Get('DefaultSummaryRows'));
 
 unless (exists $session{'my_rt_portlets'}) {
     my ($d_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
@@ -93,7 +93,7 @@
 my $portlets = $session{'my_rt_portlets'};
 
 my %seen;
-my @items = map ["component-$_", $_], grep !$seen{$_}++, @$RT::HomepageComponents;
+my @items = map ["component-$_", $_], grep !$seen{$_}++, @{RT->Config->Get('HomepageComponents')};
 
 my @sys_searches;
 my @searches = $m->comp( "/Search/Elements/UserSearches" );

Modified: rt/branches/3.7-EXPERIMENTAL/html/Prefs/Search.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Prefs/Search.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Prefs/Search.html	Fri Jan 20 07:26:28 2006
@@ -54,7 +54,7 @@
 % if ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
 <p>
   <&|/l&>You can also edit the predefined search itself</&>:
-  <a href="<% $RT::WebPath.'/Search/Build.html?'.
+  <a href="<% RT->Config->Get('WebPath').'/Search/Build.html?'.
 	  $m->comp('/Elements/QueryString',
 		   LoadSavedSearch => 'RT::System-1-SavedSearch-'.$id) %>"><% $search->Name %></a>
 </p>

Modified: rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/Forms/ticket/history
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/Forms/ticket/history	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/Forms/ticket/history	Fri Jan 20 07:26:28 2006
@@ -169,7 +169,7 @@
 	}
 	my ($content, $forms);
 
-	$m->subexec("$RT::WebPath/REST/1.0/show", 
+	$m->subexec("RT->Config->Get('WebPath')/REST/1.0/show", 
 		    id => \@tid, 
 		    format => $format,
                     fields => $fieldstring);

Modified: rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/search/ticket
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/search/ticket	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/REST/1.0/search/ticket	Fri Jan 20 07:26:28 2006
@@ -123,7 +123,7 @@
     }
     else {
 	my $id = $ticket->Id;
-        my $d = $m->comp("$RT::WebPath/REST/1.0/Forms/ticket/default", id => $id, format => $format, fields => \%fields);
+        my $d = $m->comp("RT->Config->Get('WebPath')/REST/1.0/Forms/ticket/default", id => $id, format => $format, fields => \%fields);
         my ($c, $o, $k, $e) = @$d;
 	push @output, [ $c, $o, $k ];
     }

Modified: rt/branches/3.7-EXPERIMENTAL/html/Search/Bulk.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Search/Bulk.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Search/Bulk.html	Fri Jan 20 07:26:28 2006
@@ -67,7 +67,7 @@
     Order => $Order,
     Rows => $Rows,
     Page => $Page,
-    BaseURL => $RT::WebPath."/Search/Bulk.html?"
+    BaseURL => RT->Config->Get('WebPath')."/Search/Bulk.html?"
    &>
 
 <hr>
@@ -206,7 +206,7 @@
 
 $Page ||= 1;
 
-$Format ||= $RT::DefaultSearchResultFormat;
+$Format ||= RT->Config->Get('DefaultSearchResultFormat');
 
 # inject _CHECKBOX to the first field.
 $Format =~ s/'?([^']+)'?,/'___CHECKBOX__$1',/;

Modified: rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/BuildFormatString
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/BuildFormatString	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/BuildFormatString	Fri Jan 20 07:26:28 2006
@@ -60,7 +60,7 @@
 <%init>
 
 unless ($Format) {         
-    $Format = $RT::DefaultSearchResultFormat;
+    $Format = RT->Config->Get('DefaultSearchResultFormat');
 }   
    
 
@@ -184,11 +184,11 @@
     }
     if ( $Link eq "Display" ) {
         $column{Prefix} .=
-          "<a HREF=\"" . $RT::WebPath . "/Ticket/Display.html?id=__id__\">";
+          "<a HREF=\"" . RT->Config->Get('WebPath') . "/Ticket/Display.html?id=__id__\">";
         $column{Suffix} .= "</a>";
     }
     elsif ( $Link eq "Take" ) {
-        $column{Prefix} .= "<a HREF=\"" . $RT::WebPath
+        $column{Prefix} .= "<a HREF=\"" . RT->Config->Get('WebPath')
           . "/Ticket/Display.html?Action=Take&id=__id__\">";
         $column{Suffix} .= "</a>";
     }

Modified: rt/branches/3.7-EXPERIMENTAL/html/Search/Results.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Search/Results.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Search/Results.html	Fri Jan 20 07:26:28 2006
@@ -61,12 +61,12 @@
     Rows => $Rows,
     Page => $Page,
     Format => $Format,
-    BaseURL => $RT::WebPath."/Search/Results.html?"
+    BaseURL => RT->Config->Get('WebPath')."/Search/Results.html?"
 
    &>
 % my @vars = (Query => $Query, Format => $Format,  Rows => $Rows, OrderBy => $OrderBy,  Order => $Order, HideResults => $HideResults, Page => $Page );
 <div align="right">
-<form method="get" action="<%$RT::WebPath%>/Search/Results.html">
+<form method="get" action="<%RT->Config->Get('WebPath')%>/Search/Results.html">
 %while (my $var = shift (@vars)) {
 <input type="hidden" class="hidden" name="<%$var%>" value="<%shift(@vars)%>" />
 %}
@@ -155,7 +155,7 @@
                                Order => $Order,
                                Page => $Page);
 my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query);
-my $RSSFeedURL = "$RT::WebPath/Search/Results.rdf$ShortQueryString";
+my $RSSFeedURL = "RT->Config->Get('WebPath')/Search/Results.rdf$ShortQueryString";
 
 if ($ARGS{'TicketsRefreshInterval'}) {
 	$session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'};

Modified: rt/branches/3.7-EXPERIMENTAL/html/Search/Results.rdf
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Search/Results.rdf	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Search/Results.rdf	Fri Jan 20 07:26:28 2006
@@ -55,8 +55,8 @@
         use XML::RSS;
         my $rss = new XML::RSS (version => '1.0');
         $rss->channel(
-          title        => "$RT::rtname: Syndicated Search",
-          link         => $RT::WebURL,
+          title        => "RT->Config->Get('rtname'): Syndicated Search",
+          link         => RT->Config->Get('WebURL'),
           description  => "",
           dc => {
           },
@@ -72,7 +72,7 @@
        my $row;
         $rss->add_item(
           title       =>  $Ticket->Subject,
-          link        => $RT::WebURL."/Ticket/Display.html?id=".$Ticket->id,
+          link        => RT->Config->Get('WebURL')."/Ticket/Display.html?id=".$Ticket->id,
           description => $Ticket->Transactions->First->Content,
           dc => {
             subject  => ($Ticket->Subject  || loc('No subject')),

Modified: rt/branches/3.7-EXPERIMENTAL/html/SelfService/CreateTicketInQueue.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/SelfService/CreateTicketInQueue.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/SelfService/CreateTicketInQueue.html	Fri Jan 20 07:26:28 2006
@@ -51,7 +51,7 @@
 % while (my $queue = $queues->Next) {    
 % next unless $queue->CurrentUserHasRight('CreateTicket');
 
-<dt><a href="<%$RT::WebPath%>/SelfService/Create.html?Queue=<%$queue->id%>"><%$queue->Name%></a></dt>
+<dt><a href="<%RT->Config->Get('WebPath')%>/SelfService/Create.html?Queue=<%$queue->id%>"><%$queue->Name%></a></dt>
 <dd><%$queue->Description%></dd>
 % }
 </dl>

Modified: rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests	Fri Jan 20 07:26:28 2006
@@ -54,7 +54,7 @@
 % while (my $Ticket = $MyTickets->Next) {
 <tr>
 <td>
-<a href="<%$RT::WebPath%>/SelfService/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: <%$Ticket->Subject%></a>
+<a href="<%RT->Config->Get('WebPath')%>/SelfService/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: <%$Ticket->Subject%></a>
 </td>
 <td>
 <%loc($Ticket->Status)%>

Modified: rt/branches/3.7-EXPERIMENTAL/html/SelfService/Prefs.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/SelfService/Prefs.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/SelfService/Prefs.html	Fri Jan 20 07:26:28 2006
@@ -48,7 +48,7 @@
 <& /Elements/ListActions, actions => \@results &>
 <form method="post">
 
-% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
+% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) {
 <&| /Widgets/TitleBox, title => loc('Change password')  &>
 <&|/l&>New password</&>: <input type="password" name="NewPass1" size="16" />
 <&|/l&>Confirm</&>: <input type="password" name="NewPass2" size="16" />

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Attachment/dhandler
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Attachment/dhandler	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Attachment/dhandler	Fri Jan 20 07:26:28 2006
@@ -67,7 +67,7 @@
 
      my $content_type = $AttachmentObj->ContentType || 'text/plain';
         
-     unless ($RT::TrustHTMLAttachments) {
+     unless (RT->Config->Get('TrustHTMLAttachments')) {
          $content_type = 'text/plain' if ($content_type =~ /^text\/html/i);
      }
 

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html	Fri Jan 20 07:26:28 2006
@@ -140,7 +140,7 @@
     # resubmission on refresh.
     # But we need to store Actions somewhere too, so we don't lose them.
     $session{"Actions"} = \@Actions;
-    $m->redirect($RT::WebURL."/Ticket/Display.html?id=".$TicketObj->id);
+    $m->redirect(RT->Config->Get('WebURL')."/Ticket/Display.html?id=".$TicketObj->id);
 } else {
     @Actions = @{$session{"Actions"} || [] };
     delete $session{"Actions"};

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/EditWatchers
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/EditWatchers	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/EditWatchers	Fri Jan 20 07:26:28 2006
@@ -54,10 +54,10 @@
 <li>
 <input type="checkbox" class="checkbox" name="Ticket-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1" unchecked />
 %if ($watcher->MemberObj->IsUser) { 
-<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->Object->id%>">
+<a href="<%RT->Config->Get('WebPath')%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->Object->id%>">
 <%$watcher->MemberObj->Object->Name%></a>
 %} else {
-<a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->Object->id%>">
+<a href="<%RT->Config->Get('WebPath')%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->Object->id%>">
 <%$watcher->MemberObj->Object->Name%></a>
 %}
 % }

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/Reminders
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/Reminders	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/Reminders	Fri Jan 20 07:26:28 2006
@@ -37,7 +37,7 @@
     my $due_obj = RT::Date->new( $session{'CurrentUser'} );
     my $date    = Time::ParseDate::parsedate(
         $request_args->{'NewReminder-Due'},
-        UK            => $RT::DateDayBeforeMonth,
+        UK            => RT->Config->Get('DateDayBeforeMonth'),
         PREFER_PAST   => 0,
         PREFER_FUTURE => 1
     );

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowDates
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowDates	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowDates	Fri Jan 20 07:26:28 2006
@@ -57,7 +57,7 @@
     <td class="value"><% $Ticket->StartedObj->AsString %></td>
   </tr>
   <tr>
-    <td class="label"><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</td>
+    <td class="label"><a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</td>
     <td class="value"><% $Ticket->ToldObj->AsString %></td>
   </tr>
   <tr>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowHistory
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowHistory	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowHistory	Fri Jan 20 07:26:28 2006
@@ -151,7 +151,7 @@
 
 </%INIT>
 <%ARGS>
-$URIFile => $RT::WebPath."/Ticket/Display.html"
+$URIFile => RT->Config->Get('WebPath')."/Ticket/Display.html"
 $Ticket => undef
 $Tickets => undef
 $Attachments => undef
@@ -161,6 +161,6 @@
 $ShowTitle => 1
 $ShowDisplayModes => 1
 $ShowTitleBarCommands => 1
-$AttachPath => $RT::WebPath."/Ticket/Attachment"
-$UpdatePath => $RT::WebPath."/Ticket/Update.html"
+$AttachPath => RT->Config->Get('WebPath')."/Ticket/Attachment"
+$UpdatePath => RT->Config->Get('WebPath')."/Ticket/Update.html"
 </%ARGS>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowRequestor
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowRequestor	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowRequestor	Fri Jan 20 07:26:28 2006
@@ -58,7 +58,7 @@
 </%PERL>
 
 % unless ($requestor->Privileged) {
-<&| /Widgets/TitleBox, title_href => "$RT::WebPath/Admin/Users/Modify.html?id=".$requestor->id, title=> loc("More about [_1]", $name) &>
+<&| /Widgets/TitleBox, title_href => "RT->Config->Get('WebPath')/Admin/Users/Modify.html?id=".$requestor->id, title=> loc("More about [_1]", $name) &>
 
 %# Additional information about this user.  Empty by default.
 <& /Elements/Callback, _CallbackName => 'AboutThisUser', requestor => $requestor, %ARGS &>
@@ -69,7 +69,7 @@
 <&|/l, $rows &>This user's [_1] highest priority tickets</&>:<br />
 <ul>
 %while (my $w=$tickets->Next) {
-<li><a href="<%$RT::WebPath%><%$DisplayPath%>?id=<%$w->id%>"><%$w->Id%>: <%$w->Subject%></a> (<%$w->Status%>)
+<li><a href="<%RT->Config->Get('WebPath')%><%$DisplayPath%>?id=<%$w->id%>"><%$w->Id%>: <%$w->Subject%></a> (<%$w->Status%>)
 %}
 </ul>
 

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowSummary
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowSummary	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowSummary	Fri Jan 20 07:26:28 2006
@@ -47,20 +47,20 @@
       <tr>
 	<td valign="top" width="50%" class="boxcontainer">
 	  <&| /Widgets/TitleBox, title => loc('The Basics'), 
-		title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, 
+		title_href =>"RT->Config->Get('WebPath')/Ticket/Modify.html?id=".$Ticket->Id, 
 		class => 'ticket-info-basics' &>
 	        <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
 	  </&>
 
 % if ($Ticket->QueueObj->TicketCustomFields->First) {
 	  <&| /Widgets/TitleBox, title => loc('Custom Fields'), 
-		title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, 
+		title_href =>"RT->Config->Get('WebPath')/Ticket/Modify.html?id=".$Ticket->Id, 
 		class => 'ticket-info-cfs'  &> 
 	        <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
 	  </&>
 % }
 	  <&| /Widgets/TitleBox, title => loc('People'), 
-		title_href =>"$RT::WebPath/Ticket/ModifyPeople.html?id=".$Ticket->Id, 
+		title_href =>"RT->Config->Get('WebPath')/Ticket/ModifyPeople.html?id=".$Ticket->Id, 
 		class => 'ticket-info-people' &>
             <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
 	  </&>
@@ -71,21 +71,21 @@
 	</td>
 	<td valign="top" width="50%" class="boxcontainer">
 	  <&|/Widgets/TitleBox, title => loc("Reminders"),
-		title_href =>"$RT::WebPath/Ticket/Reminders.html?id=".$Ticket->Id, 
+		title_href =>"RT->Config->Get('WebPath')/Ticket/Reminders.html?id=".$Ticket->Id, 
 		class => 'ticket-info-reminders' &>
-            <form action="<%$RT::WebPath%>/Ticket/Display.html" method="post">
+            <form action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" method="post">
 	      <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &>
               <div align="right"><input type="submit" class="button" value="Save" /></div>
             </form>
 	  </&>
 	  <&| /Widgets/TitleBox, title => loc("Dates"),
-		title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, 
+		title_href =>"RT->Config->Get('WebPath')/Ticket/ModifyDates.html?id=".$Ticket->Id, 
 		class => 'ticket-info-dates' &>
 	  <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
 	  </&>
 
 	  <&| /Widgets/TitleBox, title => loc('Links'), 
-		title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, 
+		title_href => "RT->Config->Get('WebPath')/Ticket/ModifyLinks.html?id=".$Ticket->Id, 
 		class => 'ticket-info-links' &>
 	        <& /Elements/ShowLinks, Ticket => $Ticket &>
           </&>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransaction
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransaction	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransaction	Fri Jan 20 07:26:28 2006
@@ -78,10 +78,10 @@
 $Collapsed => undef
 $ShowTitleBarCommands => 1
 $RowNum => 1
-$DisplayPath => $RT::WebPath."/Ticket/Display.html?id=".$Ticket->id
-$AttachPath => $RT::WebPath."/Ticket/Attachment"
-$UpdatePath => $RT::WebPath."/Ticket/Update.html"
-$EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html"
+$DisplayPath => RT->Config->Get('WebPath')."/Ticket/Display.html?id=".$Ticket->id
+$AttachPath => RT->Config->Get('WebPath')."/Ticket/Attachment"
+$UpdatePath => RT->Config->Get('WebPath')."/Ticket/Update.html"
+$EmailRecordPath => RT->Config->Get('WebPath')."/Ticket/ShowEmailRecord.html"
 $Attachments => undef
 $AttachmentContent => undef
 $ShowBody => 1

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransactionAttachments
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransactionAttachments	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowTransactionAttachments	Fri Jan 20 07:26:28 2006
@@ -88,10 +88,10 @@
             # or it's of our prefered alterative type
             || (
                 (
-                    $RT::PreferRichText
+                    RT->Config->Get('PreferRichText')
                     && ( $message->ContentType =~ m{^text/(?:html|enriched)$} )
                 )
-                || ( !$RT::PreferRichText
+                || ( !RT->Config->Get('PreferRichText')
                     && ( $message->ContentType !~ m{^text/(?:html|enriched)$} )
                 )
             )
@@ -154,9 +154,9 @@
 $Collapsed => undef
 $ShowTitleBarCommands => 1
 $RowNum => 1
-$AttachPath => $RT::WebPath."/Ticket/Attachment"
-$UpdatePath => $RT::WebPath."/Ticket/Update.html"
-$EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html"
+$AttachPath => RT->Config->Get('WebPath')."/Ticket/Attachment"
+$UpdatePath => RT->Config->Get('WebPath')."/Ticket/Update.html"
+$EmailRecordPath => RT->Config->Get('WebPath')."/Ticket/ShowEmailRecord.html"
 $Attachments => undef
 $AttachmentContent => {}
 $ShowBody => 1

Modified: rt/branches/3.7-EXPERIMENTAL/html/Tools/MyDay.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Tools/MyDay.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Tools/MyDay.html	Fri Jan 20 07:26:28 2006
@@ -54,7 +54,7 @@
 %  $class = 'class="oddline"';
 % }
 <tr <%$class|n%>><td colspan="2"><h2><a
-href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>:
+href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>:
 <%$Ticket->Subject%></a></h2></td></tr>
 <tr <%$class|n%>><td><span class="label">Worked:</span><input size="3" name="UpdateTimeWorked-<%$Ticket->Id%>" /> minutes
 </td>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Widgets/ComboBox
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Widgets/ComboBox	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Widgets/ComboBox	Fri Jan 20 07:26:28 2006
@@ -44,7 +44,7 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <nobr>
-<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/combobox.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/combobox.js"></script>
 
 <span id="<% $Name %>_Container" class="combobox">
 <input name="<% $Name %>" id="<% $Name %>" class="combo-text" value="<% $Default %>" type="text" <% $Size ? "size='$Size'" : '' |n %> autocomplete="off" />

Modified: rt/branches/3.7-EXPERIMENTAL/html/Widgets/SelectionBox
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Widgets/SelectionBox	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Widgets/SelectionBox	Fri Jan 20 07:26:28 2006
@@ -73,8 +73,8 @@
 %# on every button clicked in non-js mode.
 <%method header>
 % unless ($nojs) {
-<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/class.js"></script>
-<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/list.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/class.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/list.js"></script>
 % }
 <%ARGS>
 $nojs => 0

Modified: rt/branches/3.7-EXPERIMENTAL/html/autohandler
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/autohandler	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/autohandler	Fri Jan 20 07:26:28 2006
@@ -174,7 +174,7 @@
             }
         }
     }
-    elsif ($RT::WebFallbackToInternalAuth) {
+    elsif (RT->Config->Get('WebFallbackToInternalAuth')) {
           unless (defined($session{'CurrentUser'})) {
                 $m->comp('/Elements/Login', %ARGS,
                          Error=> loc('You are not an authorized user'));

Modified: rt/branches/3.7-EXPERIMENTAL/html/index.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/index.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/index.html	Fri Jan 20 07:26:28 2006
@@ -93,7 +93,7 @@
 
 
 if ( $ARGS{'q'} ) {
-    $m->redirect($RT::WebURL."Search/Simple.html?q=".$m->interp->apply_escapes($ARGS{q}));
+    $m->redirect(RT->Config->Get('WebURL')."Search/Simple.html?q=".$m->interp->apply_escapes($ARGS{q}));
     $m->abort;
 }
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT.pm.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT.pm.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT.pm.in	Fri Jan 20 07:26:28 2006
@@ -49,9 +49,7 @@
 use RT::CurrentUser;
 use RT::System;
 
-use vars qw($VERSION $System $SystemUser $Nobody $Handle $Logger
-        $CORE_CONFIG_FILE
-        $SITE_CONFIG_FILE
+use vars qw($VERSION $Config $System $SystemUser $Nobody $Handle $Logger
         $BasePath
         $EtcPath
         $VarPath
@@ -67,8 +65,6 @@
 );
 
 $VERSION = '@RT_VERSION_MAJOR at .@RT_VERSION_MINOR at .@RT_VERSION_PATCH@';
-$CORE_CONFIG_FILE = "@CONFIG_FILE_PATH@/RT_Config.pm";
-$SITE_CONFIG_FILE = "@CONFIG_FILE_PATH@/RT_SiteConfig.pm";
 
 @DATABASE_ENV_PREF@
 
@@ -283,7 +279,7 @@
         require Log::Dispatch::File;
         $RT::Logger->add(Log::Dispatch::File->new
                        ( name=>'rtlog',
-                         min_level=> $RT::LogToFile,
+			 min_level=> RT->Config->Get('LogToFile'),
                          filename=> $filename,
                          mode=>'append',
                          callbacks => $simple_cb,
@@ -308,7 +304,7 @@
                        min_level => $RT::LogToSyslog,
                        callbacks => $syslog_cb,
                        stderr => 1,
-                       @RT::LogToSyslogConf
+               RT->Config->Get('LogToSyslogConf')
                      ));
     }
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Autoreply.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Autoreply.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Autoreply.pm	Fri Jan 20 07:26:28 2006
@@ -100,21 +100,21 @@
     my $replyto;
     if ($args{'is_comment'}) { 
 	$replyto = $self->TicketObj->QueueObj->CommentAddress || 
-		     $RT::CommentAddress;
+		     RT->Config->Get('CommentAddress');
     }
     else {
 	$replyto = $self->TicketObj->QueueObj->CorrespondAddress ||
-		     $RT::CorrespondAddress;
+		     RT->Config->Get('CorrespondAddress');
     }
     
     unless ($self->TemplateObj->MIMEObj->head->get('From')) {
-	if ($RT::UseFriendlyFromLine) {
+	if (RT->Config->Get('UseFriendlyFromLine')) {
 	    my $friendly_name = $self->TicketObj->QueueObj->Description ||
 		    $self->TicketObj->QueueObj->Name;
 	    $friendly_name =~ s/"/\\"/g;
 	    $self->SetHeader( 'From',
-		        sprintf($RT::FriendlyFromLineFormat, 
-                $self->MIMEEncodeString( $friendly_name, $RT::EmailOutputEncoding ), $replyto),
+		        sprintf(RT->Config->Get('FriendlyFromLineFormat'), 
+                $self->MIMEEncodeString( $friendly_name, RT->Config->Get('EmailOutputEncoding') ), $replyto),
 	    );
 	}
 	else {

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Notify.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Notify.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Action/Notify.pm	Fri Jan 20 07:26:28 2006
@@ -138,11 +138,11 @@
         push ( @Bcc, $self->TicketObj->QueueObj->AdminCc->MemberEmailAddresses  );
     }
 
-    if ($RT::UseFriendlyToLine) {
+    if (RT->Config->Get('UseFriendlyToLine')) {
         unless (@To) {
             push (
 		@PseudoTo,
-		sprintf($RT::FriendlyToLineFormat, $arg, $self->TicketObj->id),
+		sprintf(RT->Config->Get('FriendlyToLineFormat'), $arg, $self->TicketObj->id),
 	    );
         }
     }
@@ -152,7 +152,7 @@
     #Strip the sender out of the To, Cc and AdminCc and set the 
     # recipients fields used to build the message by the superclass.
     # unless a flag is set 
-    if ($RT::NotifyActor) {
+    if (RT->Config->Get('NotifyActor')) {
         @{ $self->{'To'} }  = @To;
         @{ $self->{'Cc'} }  = @Cc;
         @{ $self->{'Bcc'} } = @Bcc;

Added: rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm
==============================================================================
--- (empty file)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm	Fri Jan 20 07:26:28 2006
@@ -0,0 +1,301 @@
+package RT::Config;
+
+use strict;
+use warnings;
+
+=head1 NAME
+
+    RT::Config - RT's config
+
+=head1 SYNOPSYS
+
+    # get config object
+    use RT::Config;
+    my $config = new RT::Config;
+    $config->LoadConfigs;
+
+    # get or set option
+    my $rt_web_path = $config->Get('WebPath');
+    $config->Set(EmailOutputEncoding => 'latin1');
+
+    # get config object from RT package
+    use RT;
+    RT->LoadConfig;
+    my $config = RT->Config;
+
+=head1 DESCRIPTION
+
+C<RT::Config> class provide access to RT's and RT extensions' config files.
+
+RT uses two files for site configuring:
+
+First file is F<RT_Config.pm> - core config file. This file is shipped
+with RT distribution and contains default values for all available options.
+B<You should never edit this file.>
+
+Second file is F<RT_SiteConfig.pm> - site config file. You can use it
+to customize your RT instance. In this file you can override any option
+listed in core config file.
+
+RT extensions could also provide thier config files. Extensions should
+use F<< <NAME>_Config.pm >> and F<< <NAME>_SiteConfig.pm >> names for
+config files, where <NAME> is extension name.
+
+B<NOTE>: All options from RT's config and extensions' configs are saved
+in one place and thus extension could override RT's options, but it is not
+recommended.
+
+=cut
+
+my %META = ();
+my %OPTIONS = ();
+
+=head1 METHODS
+
+=head2 new
+
+Object constructor returns new object. Takes no arguments.
+
+=cut
+
+sub new
+{
+    my $proto = shift;
+    my $class = ref($proto)? ref($proto): $proto;
+    my $self = bless {}, $class;
+    $self->_Init(@_);
+    return $self;
+}
+
+sub _Init
+{
+    return;
+}
+
+=head2 LoadConfigs
+
+Load all configs. First of all load RT's config then load config files
+of the extensions in alphabetic order.
+Takes nothing.
+
+=cut
+
+sub LoadConfigs
+{
+    my $self = shift;
+    my @configs = $self->Configs;
+    $self->LoadConfig( File => $_ ) foreach @configs;
+    return;
+}
+
+=head1 LoadConfig
+
+Takes param hash with C<File> field.
+First, the site configuration file is loaded, in order to establish
+overall site settings like hostname and name of RT instance.
+Then, the core configuration file is loaded to set fallback values
+for all settings; it bases some values on settings from the site
+configuration file.
+
+B<Note> that core config file skips options if site config
+has set them so to add value to some option instead of
+overriding you have to copy original value from core config file.
+
+=cut
+
+sub LoadConfig
+{
+    my $self = shift;
+    my %args = (File => '', @_);
+    my $config = $args{'File'};
+    $args{'File'} =~ s/(?<!Site)(?=Config\.pm$)/Site/;
+    $self->_LoadConfig( %args );
+    $args{'File'} =~ s/Site(?=Config\.pm$)//;
+    $self->_LoadConfig( %args );
+    return 1;
+}
+
+sub _LoadConfig
+{
+    my $self = shift;
+    my %args = (File => '', @_);
+
+    my ($is_site,$is_ext) = (0, 1);
+    $is_ext = 0 if $args{'File'} =~ /^RT_(?:Site)?Config$/;
+    $is_site = 1 if $args{'File'} =~ /SiteConfig/;
+
+    eval {
+        package RT;
+        local *Set = sub(\[$@%]@) {
+            my ($opt_ref, @args) = @_;
+            my ($pack, $file, $line) = caller;
+            return $self->SetFromConfig( Option => $opt_ref,
+                                         Value => [@args],
+                                         Package => $pack,
+                                         File => $file,
+                                         Line => $line,
+                                         SiteConfig => $is_site,
+                                         Extension => $is_ext,
+                                       );
+        };
+        local @INC = ($LocalEtcPath, $EtcPath);
+        require $args{'File'};
+    };
+    if( $@ ) {
+        return 1 if $is_site && $@ =~ qr{^Can't locate \Q$args{File}};
+        die ("Couldn't load config file '$args{File}': $@");
+    }
+    return 1;
+}
+
+=head2 Configs
+
+Returns list of the configs file names.
+F<RT_Config.pm> is always first, other configs are ordered by name.
+
+=cut
+
+sub Configs
+{
+    my $self = shift;
+    my @configs = ();
+    foreach my $path( $RT::LocalEtcPath, $RT::EtcPath ) {
+        my $mask = File::Spec->catfile($path, "*_Config.pm");
+        my @files = glob $mask;
+        @files = grep { $_ !~ /^RT_Config\.pm$/ }
+                 grep { $_ && /^\w+_Config\.pm$/ }
+             map { s/^.*[\\\/]//; $_ } @files;
+        push @configs, @files;
+    }
+
+    @configs = sort @configs;
+    unshift(@configs, 'RT_Config.pm');
+
+    return @configs;
+}
+
+=head2 Get
+
+Takes name of the option as argument and returns its current value.
+
+=cut
+
+sub Get
+{
+    my $self = shift;
+    my $name = shift;
+    my $type = $META{$name}->{'Type'} || 'SCALAR';
+    if( $type eq 'ARRAY' ) {
+        return @{ $OPTIONS{$name} };
+    } elsif( $type eq 'HASH' ) {
+        return %{ $OPTIONS{$name} };
+    }
+    return $OPTIONS{$name};
+}
+
+=head2 Set
+
+Takes two arguments: name of the option and new value.
+Set option's value to new value.
+
+=cut
+
+sub Set
+{
+    my $self = shift;
+    my $name = shift;
+
+    my $type = $META{$name}->{'Type'} || 'SCALAR';
+    if( $type eq 'ARRAY' ) {
+        $OPTIONS{$name} = [ @_ ];
+    } elsif( $type eq 'HASH' ) {
+        $OPTIONS{$name} = { @_ };
+    } else {
+        $OPTIONS{$name} = shift;
+    }
+    $META{$name}->{'Type'} = $type;
+
+    return 1;
+}
+
+sub SetFromConfig
+{
+    my $self = shift;
+    my %args = (
+        Option => undef,
+        Value => [],
+        Package => 'RT',
+        File => '',
+        Line => 0,
+        SiteConfig => 1,
+        Extension => 0,
+        @_
+    );
+
+    unless( $args{'File'} ) {
+        ($args{'Package'},$args{'File'},$args{'Line'}) = caller(1);
+    }
+
+    my $opt = $args{'Option'};
+    my $type;
+    my $name = $self->__GetNameByRef( $opt );
+    if( $name ) {
+        $type = ref $opt;
+        $name =~ s/.*:://;
+    } else {
+        $type = $META{$name}->{'Type'} || 'SCALAR';
+        $name = $$opt;
+    }
+
+    return 1 if exists $OPTIONS{$name} && !$args{'SiteConfig'};
+
+    $META{$name}->{'Type'} = $type;
+    $self->Set( $name, @{ $args{'Value'} } );
+    
+    return 1;
+}
+
+sub __GetNameByRef
+{
+    my $self = shift;
+    my $ref = shift;
+    my $pack = shift || 'main::';
+    $pack .= '::' unless $pack =~ /::$/;
+    my %ref_sym = (
+        SCALAR => '$',
+        ARRAY => '@',
+        HASH => '%',
+        CODE => '&',
+    );
+    no strict 'refs';
+    my $name = undef;
+    # scan $pack name table(hash)
+    foreach my $k( keys %{$pack} ) {
+        # hash for main:: has reference on itself
+        next if $k eq 'main::';
+
+        # if entry has trailing '::' then
+        # it is link to other name space
+        if( $k =~ /::$/ ) {
+            $name = $self->__GetNameByRef($ref, $k);
+            return $name if $name;
+        }
+
+        # entry of the table with references to
+        # SCALAR, ARRAY... and other types with
+        # the same name
+        my $entry = ${$pack}{$k};
+
+        # get entry for type we are looking for
+        my $entry_ref = *{$entry}{ref($ref)};
+        next unless $entry_ref;
+
+        # if references are equal then we've found
+        if( $entry_ref == $ref ) {
+            return ($ref_sym{ref($ref)} || '*') . $pack . $k;
+        }
+    }
+    return '';
+}
+
+1;

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/EmailParser.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/EmailParser.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/EmailParser.pm	Fri Jan 20 07:26:28 2006
@@ -294,7 +294,7 @@
 Takes a hashref object containing QueueObj, Head and CurrentUser objects.
 Returns a list of all email addresses in the To and Cc 
 headers b<except> the current Queue\'s email addresses, the CurrentUser\'s 
-email address  and anything that the $RTAddressRegexp matches.
+email address and anything that the RT->Config->Get('RTAddressRegexp') matches.
 
 =cut
 
@@ -416,7 +416,7 @@
 =head2 IsRTaddress ADDRESS
 
 Takes a single parameter, an email address. 
-Returns true if that address matches the $RTAddressRegexp.  
+Returns true if that address matches the RT->Config->Get('RTAddressRegexp').  
 Returns false, otherwise.
 
 =begin testing
@@ -434,8 +434,8 @@
 
     # Example: the following rule would tell RT not to Cc 
     #   "tickets at noc.example.com"
-    if ( defined($RT::RTAddressRegexp) &&
-                       $address =~ /$RT::RTAddressRegexp/ ) {
+    my $address_re = RT->Config->Get('RTAddressRegexp');
+    if ( defined $address_re && $address =~ /$address_re/ ) {
         return(1);
     } else {
         return (undef);

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Handle.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Handle.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Handle.pm	Fri Jan 20 07:26:28 2006
@@ -69,11 +69,11 @@
 use strict;
 use vars qw/@ISA/;
 
-eval "use DBIx::SearchBuilder::Handle::$RT::DatabaseType;
-\@ISA= qw(DBIx::SearchBuilder::Handle::$RT::DatabaseType);";
+eval "use DBIx::SearchBuilder::Handle::". RT->Config->Get('DatabaseType') .";
+\@ISA= qw(DBIx::SearchBuilder::Handle::". RT->Config->Get('DatabaseType') .");";
 
 if ($@) {
-    die "Unable to load DBIx::SearchBuilder database handle for '$RT::DatabaseType'.".
+    die "Unable to load DBIx::SearchBuilder database handle for '". RT->Config->Get('DatabaseType') ."'.".
         "\n".
         "Perhaps you've picked an invalid database type or spelled it incorrectly.".
         "\n". $@;
@@ -89,18 +89,18 @@
 sub Connect {
     my $self = shift;
 
-    if ($RT::DatabaseType eq 'Oracle') {
+    if (RT->Config->Get('DatabaseType') eq 'Oracle') {
         $ENV{'NLS_LANG'} = "AMERICAN_AMERICA.AL32UTF8";
         $ENV{'NLS_NCHAR'} = "AL32UTF8";
         
     }
 
     $self->SUPER::Connect(
-			 User => $RT::DatabaseUser,
-			 Password => $RT::DatabasePassword,
+			 User => RT->Config->Get('DatabaseUser'),
+			 Password => RT->Config->Get('DatabasePassword'),
 			);
 
-    $self->dbh->{LongReadLen} = $RT::MaxAttachmentSize;
+    $self->dbh->{LongReadLen} = RT->Config->Get('MaxAttachmentSize');
    
 }
 
@@ -116,20 +116,23 @@
 sub BuildDSN {
     my $self = shift;
 # Unless the database port is a positive integer, we really don't want to pass it.
-$RT::DatabasePort = undef unless (defined $RT::DatabasePort && $RT::DatabasePort =~ /^(\d+)$/);
-$RT::DatabaseHost = undef unless (defined $RT::DatabaseHost && $RT::DatabaseHost ne '');
-$RT::DatabaseName = File::Spec->catfile($RT::VarPath, $RT::DatabaseName)
-    if ($RT::DatabaseType eq 'SQLite') and
-	not File::Spec->file_name_is_absolute($RT::DatabaseName);
-
-
-    $self->SUPER::BuildDSN(Host => $RT::DatabaseHost, 
-			 Database => $RT::DatabaseName, 
-			 Port => $RT::DatabasePort,
-			 Driver => $RT::DatabaseType,
-			 RequireSSL => $RT::DatabaseRequireSSL,
-             DisconnectHandleOnDestroy => 1
-			);
+    my $db_port = RT->Config->Get('DatabasePort');
+    $db_port = undef unless (defined $db_port && $db_port =~ /^(\d+)$/);
+    my $db_host = RT->Config->Get('DatabaseHost');
+    $db_host = undef unless $db_host;
+    my $db_name = RT->Config->Get('DatabaseName');
+    my $db_type = RT->Config->Get('DatabaseType');
+    $db_name = File::Spec->catfile($RT::VarPath, $db_name)
+        if $db_type eq 'SQLite' && !File::Spec->file_name_is_absolute($db_name);
+
+
+    $self->SUPER::BuildDSN( Host       => $db_host,
+			                Database   => $db_name,
+                            Port       => $db_port,
+                            Driver     => $db_type,
+                            RequireSSL => RT->Config->Get('DatabaseRequireSSL'),
+                            DisconnectHandleOnDestroy => 1,
+                          );
    
 
 }

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/I18N.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/I18N.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/I18N.pm	Fri Jan 20 07:26:28 2006
@@ -111,7 +111,7 @@
         } 
     }
 
-    my @lang = @RT::LexiconLanguages;
+    my @lang = RT->Config->Get('LexiconLanguages');
     @lang = ('*') unless @lang;
 
     # Acquire all .po files and iterate them into lexicons
@@ -387,8 +387,8 @@
     my $fallback = 'iso-8859-1';
     my $charset;
 
-    if ( @RT::EmailInputEncodings and eval { require Encode::Guess; 1 } ) {
-	Encode::Guess->set_suspects(@RT::EmailInputEncodings);
+    if ( RT->Config->Get('EmailInputEncodings') and eval { require Encode::Guess; 1 } ) {
+	Encode::Guess->set_suspects(RT->Config->Get('EmailInputEncodings'));
 	my $decoder = Encode::Guess->guess( $_[0] );
 
 	if ( ref $decoder ) {
@@ -400,7 +400,7 @@
 	    my %matched = map { $_ => 1 } split(/ or /, $1);
 	    return 'utf-8' if $matched{'utf8'}; # one and only normalization
 
-	    foreach my $suspect (@RT::EmailInputEncodings) {
+	    foreach my $suspect (RT->Config->Get('EmailInputEncodings')) {
 		next unless $matched{$suspect};
 		$RT::Logger->debug("Encode::Guess ambiguous ($decoder); using $suspect");
 		$charset = $suspect;

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm	Fri Jan 20 07:26:28 2006
@@ -111,7 +111,7 @@
     #If this instance of RT sent it our, we don't want to take it in
     my $RTLoop = $head->get("X-RT-Loop-Prevention") || "";
     chomp ($RTLoop); #remove that newline
-    if ($RTLoop eq "$RT::rtname") {
+    if ($RTLoop eq "RT->Config->Get('rtname')") {
 	return (1);
     }
     
@@ -176,7 +176,7 @@
 =head2 IsRTAddress ADDRESS
 
 Takes a single parameter, an email address. 
-Returns true if that address matches the $RTAddressRegexp.  
+Returns true if that address matches the RT->Config->Get('RTAddressRegexp').  
 Returns false, otherwise.
 
 =cut
@@ -186,8 +186,8 @@
 
     # Example: the following rule would tell RT not to Cc 
     #   "tickets at noc.example.com"
-    if ( defined($RT::RTAddressRegexp) &&
-                       $address =~ /$RT::RTAddressRegexp/ ) {
+    if ( defined(RT->Config->Get('RTAddressRegexp')) &&
+                       $address =~ /RT->Config->Get('RTAddressRegexp')/ ) {
         return(1);
     } else {
         return (undef);
@@ -213,9 +213,9 @@
 
 # {{{ sub MailError 
 sub MailError {
-    my %args = (To => $RT::OwnerEmail,
+    my %args = (To => RT->Config->Get('OwnerEmail'),
 		Bcc => undef,
-		From => $RT::CorrespondAddress,
+		From => RT->Config->Get('CorrespondAddress'),
 		Subject => 'There has been an error',
 		Explanation => 'Unexplained error',
 		MIMEObj => undef,
@@ -233,7 +233,7 @@
 				      To => $args{'To'},
 				      Subject => $args{'Subject'},
 				      Precedence => 'bulk',
-				      'X-RT-Loop-Prevention' => $RT::rtname,
+				      'X-RT-Loop-Prevention' => RT->Config->Get('rtname'),
 				    );
 
     $entity->attach(  Data => $args{'Explanation'}."\n");
@@ -249,13 +249,13 @@
 
     }
 
-    if ($RT::MailCommand eq 'sendmailpipe') {
-        open (MAIL, "|$RT::SendmailPath $RT::SendmailArguments") || return(0);
+    if (RT->Config->Get('MailCommand') eq 'sendmailpipe') {
+        open (MAIL, "|RT->Config->Get('SendmailPath') RT->Config->Get('SendmailArguments')") || return(0);
         print MAIL $entity->as_string;
         close(MAIL);
     }
     else {
-    	$entity->send($RT::MailCommand, $RT::MailParams);
+    	$entity->send(RT->Config->Get('MailCommand'), $RT::MailParams);
     }
 }
 
@@ -436,7 +436,7 @@
     my $Subject = shift;
     my $id;
 
-    my $test_name = $RT::EmailSubjectTagRegex || qr/\Q$RT::rtname\E/;
+    my $test_name = $RT::EmailSubjectTagRegex || qr/\QRT->Config->Get('rtname')\E/;
 
     if ( $Subject =~ s/\[$test_name\s+\#(\d+)\s*\]//i ) {
         my $id = $1;
@@ -512,7 +512,7 @@
 
     if (!$parser->Entity()) {
         MailError(
-            To          => $RT::OwnerEmail,
+            To          => RT->Config->Get('OwnerEmail'),
             Subject     => "RT Bounce: Unparseable message",
             Explanation => "RT couldn't process the message below",
             Attach     => $args{'message'}
@@ -532,7 +532,7 @@
     my $ErrorsTo = ParseErrorsToAddressFromHead($head);
 
     my $MessageId = $head->get('Message-ID')
-      || "<no-message-id-" . time . rand(2000) . "\@.$RT::Organization>";
+      || "<no-message-id-" . time . rand(2000) . "\@.RT->Config->Get('Organization')>";
 
     #Pull apart the subject line
     my $Subject = $head->get('Subject') || '';
@@ -622,7 +622,7 @@
             # Notify the RT Admin of the failure.
             # XXX Should this be configurable?
             MailError(
-                To          => $RT::OwnerEmail,
+                To          => RT->Config->Get('OwnerEmail'),
                 Subject     => "Could not load a valid user",
                 Explanation => <<EOT,
 RT could not load a valid user, and RT's configuration does not allow
@@ -667,7 +667,7 @@
     # send mail to the sender
     if ( $IsSuspiciousSender || $IsAutoGenerated || $IsALoop ) {
         $SquelchReplies = 1;
-        $ErrorsTo       = $RT::OwnerEmail;
+        $ErrorsTo       = RT->Config->Get('OwnerEmail');
     }
 
     # }}}
@@ -690,9 +690,9 @@
         $RT::Logger->crit("RT Recieved mail ($MessageId) from itself.");
 
         #Should we mail it to RTOwner?
-        if ($RT::LoopsToRTOwner) {
+        if (RT->Config->Get('LoopsToRTOwner')) {
             MailError(
-                To          => $RT::OwnerEmail,
+                To          => RT->Config->Get('OwnerEmail'),
                 Subject     => "RT Bounce: $Subject",
                 Explanation => "RT thinks this message may be a bounce",
                 MIMEObj     => $Message
@@ -700,7 +700,7 @@
         }
 
         #Do we actually want to store it?
-        return ( 0, "Message Bounced", undef ) unless ($RT::StoreLoops);
+        return ( 0, "Message Bounced", undef ) unless (RT->Config->Get('StoreLoops'));
     }
 
     # }}}
@@ -740,7 +740,7 @@
         my @Cc;
         my @Requestors = ( $CurrentUser->id );
 
-        if ($RT::ParseNewMessageForTicketCcs) {
+        if (RT->Config->Get('ParseNewMessageForTicketCcs')) {
             @Cc = ParseCcAddressesFromHead(
                 Head        => $head,
                 CurrentUser => $CurrentUser,

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web.pm	Fri Jan 20 07:26:28 2006
@@ -490,7 +490,7 @@
           . $args{'TicketObj'}->id . "-"
           . "0" . "-"  # Scrip
           . "0" . "@"  # Email sent
-          . $RT::Organization
+              . RT->Config->Get('Organization')
           . ">" );
     my $old_txn = RT::Transaction->new( $session{'CurrentUser'} );
     if ( $args{ARGSRef}->{'QuoteTransaction'} ) {

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm	Fri Jan 20 07:26:28 2006
@@ -69,8 +69,8 @@
     data_dir             => "$RT::MasonDataDir",
     allow_globals        => [qw(%session)],
     # Turn off static source if we're in developer mode.
-    static_source        => ($RT::DevelMode ? '0' : '1'), 
-    use_object_files     => ($RT::DevelMode ? '0' : '1'), 
+    static_source        => (RT->Config->Get('DevelMode') ? '0' : '1'), 
+    use_object_files     => (RT->Config->Get('DevelMode') ? '0' : '1'), 
     autoflush            => 0
 ) };
 
@@ -102,7 +102,7 @@
     # Activate the following if running httpd as root (the normal case).
     # Resets ownership of all files created by Mason at startup.
     # Note that mysql uses DB for sessions, so there's no need to do this.
-    unless ( $RT::DatabaseType =~ /(?:mysql|Pg)/ ) {
+    unless ( RT->Config->Get('DatabaseType') =~ /(?:mysql|Pg)/ ) {
 
         # Clean up our umask to protect session files
         umask(0077);
@@ -200,7 +200,7 @@
     # Consistency is imprived, too.
     RT::Principal->InvalidateACLCache();
     DBIx::SearchBuilder::Record::Cachable->FlushCache
-      if ( $RT::WebFlushDbCacheEveryRequest
+      if ( RT->Config->Get('WebFlushDbCacheEveryRequest')
         and UNIVERSAL::can(
             'DBIx::SearchBuilder::Record::Cachable' => 'FlushCache' ) );
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Queue_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Queue_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Queue_Overlay.pm	Fri Jan 20 07:26:28 2006
@@ -183,8 +183,8 @@
 
 sub ActiveStatusArray {
     my $self = shift;
-    if (@RT::ActiveStatus) {
-    	return (@RT::ActiveStatus)
+    if (RT->Config->Get('ActiveStatus')) {
+    	return (RT->Config->Get('ActiveStatus'))
     } else {
         $RT::Logger->warning("RT::ActiveStatus undefined, falling back to deprecated defaults");
         return (@DEFAULT_ACTIVE_STATUS);
@@ -203,8 +203,8 @@
 
 sub InactiveStatusArray {
     my $self = shift;
-    if (@RT::InactiveStatus) {
-    	return (@RT::InactiveStatus)
+    if (RT->Config->Get('InactiveStatus')) {
+    	return (RT->Config->Get('InactiveStatus'))
     } else {
         $RT::Logger->warning("RT::InactiveStatus undefined, falling back to deprecated defaults");
         return (@DEFAULT_INACTIVE_STATUS);

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm	Fri Jan 20 07:26:28 2006
@@ -785,7 +785,7 @@
         my $ContentEncoding = 'none';
 
         #get the max attachment length from RT
-        my $MaxSize = $RT::MaxAttachmentSize;
+        my $MaxSize = RT->Config->Get('MaxAttachmentSize');
 
         #if the current attachment contains nulls and the
         #database doesn't support embedded nulls
@@ -810,7 +810,7 @@
         if ( ($MaxSize) and ( $MaxSize < length($Body) ) ) {
 
             # if we're supposed to truncate large attachments
-            if ($RT::TruncateLongAttachments) {
+            if (RT->Config->Get('TruncateLongAttachments')) {
 
                 # truncate the attachment to that length.
                 $Body = substr( $Body, 0, $MaxSize );
@@ -818,7 +818,7 @@
             }
 
             # elsif we're supposed to drop large attachments on the floor,
-            elsif ($RT::DropLongAttachments) {
+            elsif (RT->Config->Get('DropLongAttachments')) {
 
                 # drop the attachment on the floor
                 $RT::Logger->info( "$self: Dropped an attachment of size " . length($Body) . "\n" . "It started: " . substr( $Body, 0, 60 ) . "\n" );
@@ -1874,7 +1874,7 @@
 }
 
 sub WikiBase {
-  return $RT::WebPath. "/index.html?q=";
+  return RT->Config->Get('WebPath'). "/index.html?q=";
 }
 
 eval "require RT::Record_Vendor";

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/StyleGuide.pod
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/StyleGuide.pod	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/StyleGuide.pod	Fri Jan 20 07:26:28 2006
@@ -789,11 +789,11 @@
 
 
 
-The string	<& /Elements/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for   $RT::rtname", title => 'Login' &>
+The string	<& /Elements/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for   RT->Config->Get('rtname')", title => 'Login' &>
 
 should become 	<& /Elements/TitleBoxStart, 
 			width=> "40%",
-			titleright => loc("RT [_1] for [_2]",$RT::VERSION, $RT::rtname),
+			titleright => loc("RT [_1] for [_2]",$RT::VERSION, RT->Config->Get('rtname')),
 			title => loc('Login'),
 	      	&>
 	

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm	Fri Jan 20 07:26:28 2006
@@ -397,7 +397,7 @@
     $T::Transaction = $args{'TransactionObj'};
     $T::Argument    = $args{'Argument'};
     $T::Requestor   = eval { $T::Ticket->Requestors->UserMembersObj->First->Name };
-    $T::rtname      = $RT::rtname;
+    $T::rtname      = RT->Config->Get('rtname');
     *T::loc         = sub { $T::Ticket->loc(@_) };
 
     # We need to untaint the content of the template, since we'll be working

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm	Fri Jan 20 07:26:28 2006
@@ -2383,11 +2383,13 @@
                                  ) )
       if defined $args{'BccMessageTo'};
 
+    # XXX: This code is duplicated several times
     # If this is from an external source, we need to come up with its
     # internal Message-ID now, so all emails sent because of this
     # message have a common Message-ID
+    my $org = RT->Config->Get('Organization');
     unless ($args{'MIMEObj'}->head->get('Message-ID')
-            =~ /<(rt-.*?-\d+-\d+)\.(\d+-0-0)\@$RT::Organization>/) {
+            =~ /<(rt-.*?-\d+-\d+)\.(\d+-0-0)\@\Q$org\E>/) {
         $args{'MIMEObj'}->head->set( 'RT-Message-ID',
             "<rt-"
             . $RT::VERSION . "-"
@@ -2397,7 +2399,7 @@
             . $self->id . "-"
             . "0" . "-"  # Scrip
             . "0" . "@"  # Email sent
-            . $RT::Organization
+            . $org
             . ">" );
     }
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/fsck_com_rt.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/fsck_com_rt.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/fsck_com_rt.pm	Fri Jan 20 07:26:28 2006
@@ -75,7 +75,7 @@
 ok ($uri->isa('RT::URI::base'), "It's an RT::URI::base");
 ok ($uri->isa('RT::Base'), "It's an RT::Base");
 
-is ($uri->LocalURIPrefix , 'fsck.com-rt://'.$RT::Organization);
+is ($uri->LocalURIPrefix , 'fsck.com-rt://'.RT->Config->Get('Organization'));
 
 =end testing
 
@@ -86,7 +86,7 @@
 sub LocalURIPrefix {
     my $self = shift;
     
-    my $prefix = $self->Scheme. "://$RT::Organization";
+    my $prefix = $self->Scheme. "://". RT->Config->Get('Organization');
 
     return ($prefix);
 }
@@ -238,7 +238,7 @@
 sub HREF {
     my $self = shift;
     if ($self->IsLocal && $self->Object && ($self->ObjectType eq 'ticket')) {
-        return ( $RT::WebURL . "Ticket/Display.html?id=".$self->Object->Id);
+        return ( RT->Config->Get('WebURL') . "Ticket/Display.html?id=".$self->Object->Id);
     }   
     else {
         return ($self->URI);

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/t.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/t.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/URI/t.pm	Fri Jan 20 07:26:28 2006
@@ -47,7 +47,7 @@
 $uri->ParseURI($uristr);
 is(ref($uri->Object), "RT::Ticket", "Object loaded is a ticket");
 is($uri->Object->Id, 1, "Object loaded has correct ID");
-is($uri->URI, 'fsck.com-rt://'.$RT::Organization.'/ticket/1',
+is($uri->URI, 'fsck.com-rt://'.RT->Config->Get('Organization').'/ticket/1',
    "URI object has correct URI string");
 
 =end testing

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/User_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/User_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/User_Overlay.pm	Fri Jan 20 07:26:28 2006
@@ -211,8 +211,8 @@
     elsif ( !$args{'Password'} ) {
         $args{'Password'} = '*NO-PASSWORD*';
     }
-    elsif ( length( $args{'Password'} ) < $RT::MinimumPasswordLength ) {
-        return ( 0, $self->loc("Password needs to be at least [_1] characters long",$RT::MinimumPasswordLength) );
+    elsif ( length( $args{'Password'} ) < RT->Config->Get('MinimumPasswordLength') ) {
+        return ( 0, $self->loc("Password needs to be at least [_1] characters long",RT->Config->Get('MinimumPasswordLength')) );
     }
 
     else {
@@ -735,8 +735,8 @@
     }
 
 
-    my $min = ( $RT::MinimumPasswordLength > 6 ?  $RT::MinimumPasswordLength : 6);
-    my $max = ( $RT::MinimumPasswordLength > 8 ?  $RT::MinimumPasswordLength : 8);
+    my $min = ( RT->Config->Get('MinimumPasswordLength') > 6 ?  RT->Config->Get('MinimumPasswordLength') : 6);
+    my $max = ( RT->Config->Get('MinimumPasswordLength') > 8 ?  RT->Config->Get('MinimumPasswordLength') : 8);
 
     my $pass = $self->GenerateRandomPassword( $min, $max) ;
 
@@ -1032,8 +1032,8 @@
     if ( !$password ) {
         return ( 0, $self->loc("No password set") );
     }
-    elsif ( length($password) < $RT::MinimumPasswordLength ) {
-        return ( 0, $self->loc("Password needs to be at least [_1] characters long", $RT::MinimumPasswordLength) );
+    elsif ( length($password) < RT->Config->Get('MinimumPasswordLength') ) {
+        return ( 0, $self->loc("Password needs to be at least [_1] characters long", RT->Config->Get('MinimumPasswordLength')) );
     }
     else {
         my $new = !$self->HasPassword;

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/02basic_web.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/02basic_web.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/02basic_web.t	Fri Jan 20 07:26:28 2006
@@ -18,7 +18,7 @@
 use RT;
 RT::LoadConfig();
 # get the top page
-my $url = "http://localhost:".$RT::WebPort.$RT::WebPath."/";
+my $url = "http://localhost:".RT->Config->Get('WebPort').RT->Config->Get('WebPath')."/";
 diag $url;
 $agent->get($url);
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/04send_email.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/04send_email.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/04send_email.t	Fri Jan 20 07:26:28 2006
@@ -154,7 +154,7 @@
 
 # we need to swap out SendMessage to test the new things we care about;
 &iso8859_redef_sendmessage;
-$RT::EmailOutputEncoding = 'iso-8859-1';
+RT->Config->Set(EmailOutputEncoding => 'iso-8859-1');
 # create an iso 8859-1 ticket
 @scrips_fired = ();
 
@@ -393,8 +393,10 @@
                  ';
 }
 
-shift @RT::EmailInputEncodings;
-$RT::EmailOutputEncoding = 'utf-8';
+my @input_encodings = RT->Config->Get(' EmailInputEncodings' );
+shift @input_encodings;
+RT->Config->Set(EmailInputEncodings => @input_encodings );
+RT->Config->Set(EmailOutputEncoding => 'utf-8');
 # }}}
 
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/06mailgateway.t	Fri Jan 20 07:26:28 2006
@@ -58,7 +58,7 @@
 RT::Init();
 use RT::I18N;
 no warnings 'once';
-my $url = "http://localhost:".$RT::WebPort.$RT::WebPath."/";
+my $url = "http://localhost:".RT->Config->Get('WebPort').RT->Config->Get('WebPath')."/";
 
 # Make sure that when we call the mailgate wrong, it tempfails
 
@@ -458,9 +458,8 @@
 is( $tick->Owner, $RT::Nobody->Id, 'set owner back to nobody');
 
 
-
-    local $TODO = "Advanced mailgate actions require an unsafe configuration";
-ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action take-correspond"), "Opened the mailgate - $@");
+local $TODO = "Advanced mailgate actions require an unsafe configuration";
+ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue general --action take-correspond"), "Opened the mailgate - $@");
 print MAIL <<EOF;
 From: root\@localhost
 Subject: [example.com \#$id] correspondence

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/07acl.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/07acl.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/07acl.t	Fri Jan 20 07:26:28 2006
@@ -117,10 +117,10 @@
 sub login {
     my $agent = shift;
 
-    my $url = "http://localhost:" . $RT::WebPort . $RT::WebPath . "/";
+    my $url = "http://localhost:" . RT->Config->Get('WebPort') . RT->Config->Get('WebPath') . "/";
     $agent->get($url);
     is( $agent->{'status'}, 200,
-        "Loaded a page - http://localhost" . $RT::WebPath );
+        "Loaded a page - http://localhost" . RT->Config->Get('WebPath') );
 
     # {{{ test a login
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/08web_cf_access.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/08web_cf_access.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/08web_cf_access.t	Fri Jan 20 07:26:28 2006
@@ -9,8 +9,8 @@
 }
 use Test::WWW::Mechanize;
 
-$RT::WebPath ||= ''; # Shut up a warning
-use constant BaseURL => "http://localhost:".$RT::WebPort.$RT::WebPath."/";
+RT->Config->Get('WebPath') ||= ''; # Shut up a warning
+use constant BaseURL => "http://localhost:".RT->Config->Get('WebPort').RT->Config->Get('WebPath')."/";
 use constant ImageFile => $RT::MasonComponentRoot .'/NoAuth/images/bplogo.gif';
 use constant ImageFileContent => do {
     local $/;

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/17custom_search.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/17custom_search.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/17custom_search.t	Fri Jan 20 07:26:28 2006
@@ -9,8 +9,8 @@
 }
 use Test::WWW::Mechanize;
 
-$RT::WebPath ||= ''; # Shut up a warning
-use constant BaseURL => "http://localhost:".$RT::WebPort.$RT::WebPath."/";
+RT->Config->Get('WebPath') ||= ''; # Shut up a warning
+use constant BaseURL => "http://localhost:".RT->Config->Get('WebPort').RT->Config->Get('WebPath')."/";
 
 # reset preferences for easier test?
 

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t	Fri Jan 20 07:26:28 2006
@@ -9,8 +9,8 @@
 }
 use Test::WWW::Mechanize;
 
-$RT::WebPath ||= ''; # Shut up a warning
-use constant BaseURL => "http://localhost:".$RT::WebPort.$RT::WebPath."/";
+RT->Config->Get('WebPath') ||= ''; # Shut up a warning
+use constant BaseURL => "http://localhost:".RT->Config->Get('WebPort').RT->Config->Get('WebPath')."/";
 
 
 my $user_obj = RT::User->new($RT::SystemUser);

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/19-rtname.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/19-rtname.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/19-rtname.t	Fri Jan 20 07:26:28 2006
@@ -11,26 +11,26 @@
 use RT::Interface::Email;
 
 # normal use case, regexp set to rtname
-$RT::rtname = "site";
-$RT::EmailSubjectTagRegex = qr/$RT::rtname/ ;
-$RT::rtname = undef;
+RT->Config->Get(rtname => "site");
+$RT::EmailSubjectTagRegex = qr/RT->Config->Get('rtname')/ ;
+RT->Config->Get(rtname => undef);
 is(RT::Interface::Email::ParseTicketId("[site #123] test"), 123);
 is(RT::Interface::Email::ParseTicketId("[othersite #123] test"), undef);
 
 # oops usecase, where the regexp is scragged
-$RT::rtname = "site";
+RT->Config->Get(rtname => "site");
 $RT::EmailSubjectTagRegex = undef;
 is(RT::Interface::Email::ParseTicketId("[site #123] test"), 123);
 is(RT::Interface::Email::ParseTicketId("[othersite #123] test"), undef);
 
 # set to a simple regexp. NOTE: we no longer match "site"
-$RT::rtname = "site";
+RT->Config->Get(rtname => "site");
 $RT::EmailSubjectTagRegex = qr/newsite/;
 is(RT::Interface::Email::ParseTicketId("[site #123] test"), undef);
 is(RT::Interface::Email::ParseTicketId("[newsite #123] test"), 123);
 
 # set to a more complex regexp
-$RT::rtname = "site";
+RT->Config->Get(rtname => "site");
 $RT::EmailSubjectTagRegex = qr/newsite||site/;
 is(RT::Interface::Email::ParseTicketId("[site #123] test"), 123);
 is(RT::Interface::Email::ParseTicketId("[newsite #123] test"), 123);

Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/21query-builder.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/21query-builder.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/21query-builder.t	Fri Jan 20 07:26:28 2006
@@ -19,7 +19,7 @@
 RT::LoadConfig;
 
 # get the top page
-my $url = $RT::WebURL;
+my $url = RT->Config->Get('WebURL');
 $agent->get($url);
 
 is ($agent->{'status'}, 200, "Loaded a page");

Modified: rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in	Fri Jan 20 07:26:28 2006
@@ -84,7 +84,7 @@
 $| = 1;    #unbuffer that output.
 
 require RT::Handle;
-my $Handle = RT::Handle->new($RT::DatabaseType);
+my $Handle = RT::Handle->new(RT->Config->Get('DatabaseType'));
 $Handle->BuildDSN;
 my $dbh;
 
@@ -101,14 +101,14 @@
     $dbh = DBI->connect( get_system_dsn(), $args{'dba'}, $args{'dba-password'} )
       || die "Failed to connect to " . get_system_dsn() . " as $args{'dba'}: $DBI::errstr";
     print "Now creating a database for RT.\n";
-    if ($RT::DatabaseType ne 'Oracle' ||
-        $args{'dba'} ne $RT::DatabaseUser) {
-    create_db();
+    if (RT->Config->Get('DatabaseType') ne 'Oracle' ||
+        $args{'dba'} ne RT->Config->Get('DatabaseUser')) {
+        create_db();
     } else {
-        print "...skipped as ".$args{'dba'} ." is not " . $RT::DatabaseUser . " or we're working with Oracle.\n";
+        print "...skipped as ".$args{'dba'} ." is not " . RT->Config->Get('DatabaseUser') . " or we're working with Oracle.\n";
     }
 
-    if ($RT::DatabaseType eq "mysql") {
+    if (RT->Config->Get('DatabaseType') eq "mysql") {
         # Check which version we're running
         my ($version) = $dbh->selectrow_hashref("show variables like 'version'")->{Value} =~ /^(\d\.\d+)/;
         print "*** Warning: RT is unsupported on MySQL versions before 4.0.x\n" if $version < 4;
@@ -127,7 +127,7 @@
     }
     
     # SQLite can't deal with the disconnect/reconnect
-    unless ($RT::DatabaseType eq 'SQLite') {
+    unless (RT->Config->Get('DatabaseType') eq 'SQLite') {
 
         $dbh->disconnect;
         $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} ) || die $DBI::errstr;
@@ -135,7 +135,7 @@
     print "Now populating database schema.\n";
     insert_schema();
     print "Now inserting database ACLs\n";
-    insert_acl() unless ($RT::DatabaseType eq 'Oracle');
+    insert_acl() unless (RT->Config->Get('DatabaseType') eq 'Oracle');
     print "Now inserting RT core system objects\n";
     insert_initial_data();
     print "Now inserting RT data\n";
@@ -176,11 +176,11 @@
     my (@schema);
     print "Creating database schema.\n";
 
-    if ( -f $base_path . "/schema." . $RT::DatabaseType ) {
+    if ( -f $base_path . "/schema." . RT->Config->Get('DatabaseType') ) {
 	no warnings 'unopened';
 
-        open( SCHEMA, "<" . $base_path . "/schema." . $RT::DatabaseType );
-        open( SCHEMA_LOCAL, "<" . $RT::LocalEtcPath . "/schema." . $RT::DatabaseType );
+        open( SCHEMA, "<" . $base_path . "/schema." . RT->Config->Get('DatabaseType') );
+        open( SCHEMA_LOCAL, "<" . $RT::LocalEtcPath . "/schema." . RT->Config->Get('DatabaseType') );
 
         my $statement = "";
         foreach my $line (<SCHEMA>, ($_ = ';;'), <SCHEMA_LOCAL>) {
@@ -209,7 +209,7 @@
 
     }
     else {
-        die "Couldn't find schema file for " . $RT::DatabaseType . "\n";
+        die "Couldn't find schema file for " . RT->Config->Get('DatabaseType') . "\n";
     }
     print "Done setting up database schema.\n";
 
@@ -219,7 +219,7 @@
 
 # {{{ sub drop_db
 sub drop_db {
-    if ( $RT::DatabaseType eq 'Oracle' ) {
+    if ( RT->Config->Get('DatabaseType') eq 'Oracle' ) {
         print <<END;
 
 To delete the tables and sequences of the RT Oracle database by running 
@@ -232,46 +232,46 @@
     unless ( $args{'force'} ) {
         print <<END;
 
-About to drop $RT::DatabaseType database $RT::DatabaseName on $RT::DatabaseHost.
-WARNING: This will erase all data in $RT::DatabaseName.
+About to drop ${\RT->Config->Get('DatabaseType')} database RT->Config->Get('DatabaseName') on RT->Config->Get('DatabaseHost').
+WARNING: This will erase all data in RT->Config->Get('DatabaseName').
 
 END
         exit unless _yesno();
 
     }
 
-    print "Dropping $RT::DatabaseType database $RT::DatabaseName.\n";
+    print "Dropping ". RT->Config->Get('DatabaseType') ." database ". RT->Config->Get('DatabaseName') .".\n";
 
-    if ( $RT::DatabaseType eq 'SQLite' ) {
-	unlink $RT::DatabaseName or warn $!;
+    if ( RT->Config->Get('DatabaseType') eq 'SQLite' ) {
+	unlink RT->Config->Get('DatabaseName') or warn $!;
 	return;
     }
-    $dbh->do("Drop DATABASE $RT::DatabaseName") or warn $DBI::errstr;
+    $dbh->do("Drop DATABASE ". RT->Config->Get('DatabaseName')) or warn $DBI::errstr;
 }
 
 # }}}
 
 # {{{ sub create_db
 sub create_db {
-    print "Creating $RT::DatabaseType database $RT::DatabaseName.\n";
-    if ( $RT::DatabaseType eq 'SQLite' ) {
+    print "Creating ". RT->Config->Get('DatabaseType') ." database ". RT->Config->Get('DatabaseName') .".\n";
+    if ( RT->Config->Get('DatabaseType') eq 'SQLite' ) {
         return;
     }
-    elsif ( $RT::DatabaseType eq 'Pg' ) {
-        $dbh->do("CREATE DATABASE $RT::DatabaseName WITH ENCODING='UNICODE'");
+    elsif ( RT->Config->Get('DatabaseType') eq 'Pg' ) {
+        $dbh->do("CREATE DATABASE ". RT->Config->Get('DatabaseName') ." WITH ENCODING='UNICODE'");
         if ($DBI::errstr) {
-            $dbh->do("CREATE DATABASE $RT::DatabaseName") || die $DBI::errstr;
+            $dbh->do("CREATE DATABASE ". RT->Config->Get('DatabaseName')) || die $DBI::errstr;
         }
     }
-    elsif ($RT::DatabaseType eq 'Oracle') {
+    elsif (RT->Config->Get('DatabaseType') eq 'Oracle') {
         insert_acl();
     }
-    elsif ( $RT::DatabaseType eq 'Informix' ) {
-	$ENV{DB_LOCALE} = 'en_us.utf8';
-        $dbh->do("CREATE DATABASE $RT::DatabaseName WITH BUFFERED LOG");
+    elsif ( RT->Config->Get('DatabaseType') eq 'Informix' ) {
+        $ENV{DB_LOCALE} = 'en_us.utf8';
+        $dbh->do("CREATE DATABASE ". RT->Config->Get('DatabaseName') ." WITH BUFFERED LOG");
     }
     else {
-        $dbh->do("CREATE DATABASE $RT::DatabaseName") or die $DBI::errstr;
+        $dbh->do("CREATE DATABASE ". RT->Config->Get('DatabaseName')) or die $DBI::errstr;
     }
 }
 
@@ -280,9 +280,9 @@
 sub get_dba_password {
     print "In order to create or update your RT database,";
     print "this script needs to connect to your "
-      . $RT::DatabaseType
+      . RT->Config->Get('DatabaseType')
       . " instance on "
-      . $RT::DatabaseHost . " as "
+      . RT->Config->Get('DatabaseHost') . " as "
       . $args{'dba'} . ".\n";
     print "Please specify that user's database password below. If the user has no database\n";
     print "password, just press return.\n\n";
@@ -306,28 +306,29 @@
 # {{{ insert_acls
 sub insert_acl {
 
-        my $base_path = (shift || $RT::EtcPath);
+    my $base_path = (shift || $RT::EtcPath);
+    my $db_type = RT->Config->Get('DatabaseType');
 
-    if ( $RT::DatabaseType =~ /^oracle$/i ) {
+    if ( $db_type =~ /^oracle$/i ) {
         do $base_path . "/acl.Oracle"
           || die "Couldn't find ACLS for Oracle\n" . $@;
     }
-    elsif ( $RT::DatabaseType =~ /^pg$/i ) {
+    elsif ( $db_type =~ /^pg$/i ) {
         do $base_path . "/acl.Pg" || die "Couldn't find ACLS for Pg\n" . $@;
     }
-    elsif ( $RT::DatabaseType =~ /^mysql$/i ) {
+    elsif ( $db_type =~ /^mysql$/i ) {
         do $base_path . "/acl.mysql"
           || die "Couldn't find ACLS for mysql in $base_path\n" . $@;
     }
-    elsif ( $RT::DatabaseType =~ /^Sybase$/i ) {
+    elsif ( $db_type =~ /^Sybase$/i ) {
         do $base_path . "/acl.Sybase"
           || die "Couldn't find ACLS for Sybase in $base_path\n" . $@;
     }
-    elsif ( $RT::DatabaseType =~ /^informix$/i ) {
+    elsif ( $db_type =~ /^informix$/i ) {
         do $base_path . "/acl.Informix"
           || die "Couldn't find ACLS for Informix in $base_path\n" . $@;
     }
-    elsif ( $RT::DatabaseType =~ /^SQLite$/i ) {
+    elsif ( $db_type =~ /^SQLite$/i ) {
         return;
     }
     else {
@@ -357,19 +358,19 @@
 sub get_system_dsn {
 
     my $dsn = $Handle->DSN;
+    my $db_name = RT->Config->Get('DatabaseName');
 
     #with mysql, you want to connect sans database to funge things
-    if ( $RT::DatabaseType eq 'mysql' ) {
-        $dsn =~ s/dbname=$RT::DatabaseName//;
-
-        # with postgres, you want to connect to database1
+    if ( RT->Config->Get('DatabaseType') eq 'mysql' ) {
+        $dsn =~ s/dbname=\Q$db_name//;
     }
-    elsif ( $RT::DatabaseType eq 'Pg' ) {
-        $dsn =~ s/dbname=$RT::DatabaseName/dbname=template1/;
+    elsif ( RT->Config->Get('DatabaseType') eq 'Pg' ) {
+        # with postgres, you want to connect to database1
+        $dsn =~ s/dbname=\Q$db_name/dbname=template1/;
     }
-    elsif ( $RT::DatabaseType eq 'Informix' ) {
-	# with Informix, you want to connect sans database:
-	$dsn =~ s/Informix:$RT::DatabaseName/Informix:/;
+    elsif ( RT->Config->Get('DatabaseType') eq 'Informix' ) {
+        # with Informix, you want to connect sans database:
+        $dsn =~ s/Informix:\Q$db_name/Informix:/;
     }
     return $dsn;
 }
@@ -415,7 +416,7 @@
         exit(1);
     }
     print "done.\n";
-    $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite');
+    $RT::Handle->Disconnect() unless (RT->Config->Get('DatabaseType') eq 'SQLite');
 
 }
 
@@ -632,7 +633,7 @@
         }
         print "done.\n";
     }
-    $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite');
+    $RT::Handle->Disconnect() unless (RT->Config->Get('DatabaseType') eq 'SQLite');
     print "Done setting up database content.\n";
 }
 


More information about the Rt-commit mailing list