[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Wed, 19 Sep 2007 17:36:48 -0000


raeburn		Wed Sep 19 13:36:48 2007 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  bug 5402.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.28 loncom/interface/domainprefs.pm:1.29
--- loncom/interface/domainprefs.pm:1.28	Sun Sep 16 13:26:56 2007
+++ loncom/interface/domainprefs.pm	Wed Sep 19 13:36:47 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.28 2007/09/16 17:26:56 raeburn Exp $
+# $Id: domainprefs.pm,v 1.29 2007/09/19 17:36:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -157,9 +157,8 @@
         &print_header($r,$phase);
         if (keys(%domconfig) == 0) {
             my $primarylibserv = &Apache::lonnet::domain($dom,'primary');
-            my $perlvarref = &LONCAPA::Configuration::read_conf('loncapa.conf');
-            my $hostid = $perlvarref->{'lonHostID'};
-            if ($hostid ne $primarylibserv) {
+            my @ids=&Apache::lonnet::current_machine_ids();
+            if (!grep(/^\Q$primarylibserv\E$/,@ids)) {
                 my %designhash = &Apache::loncommon::get_domainconf($dom);
                 my @loginimages = ('img','logo','domlogo');
                 my $custom_img_count = 0;
@@ -175,7 +174,14 @@
                 }
                 if ($custom_img_count > 0) {
                     my $switch_server = &check_switchserver($dom,$confname);
-                    $r->print(&mt('Domain configuration settings have yet to be saved for this domain via the web-based domain preferences interface.').'<br />'.&mt("While this remains so, you must switch to the domain's primary library server in order to update settings.").'<br /><br />'.&mt("Thereafter, you will be able to update settings from this screen when logged in to any server in the LON-CAPA network (with a Domain Coordinator role selected in the domain), although you will still need to switch to the domain's primary library server to upload new images or logos.").'<br /><br />'.$switch_server.' '.&mt('to primary library server for domain: [_1]',$dom));
+                    $r->print(
+    &mt('Domain configuration settings have yet to be saved for this domain via the web-based domain preferences interface.').'<br />'.
+    &mt("While this remains so, you must switch to the domain's primary library server in order to update settings.").'<br /><br />'.
+    &mt("Thereafter, (with a Domain Coordinator role selected in the domain) you will be able to update settings when logged in to any server in the LON-CAPA network.").'<br />'.
+    &mt("However, you will still need to switch to the domain's primary library server to upload new images or logos.").'<br /><br />');
+                    if ($switch_server) {
+                       $r->print($switch_server.' '.&mt('to primary library server for domain: [_1]',$dom));
+                    }
                     return OK;
                 }
             }