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

raeburn raeburn at source.lon-capa.org
Thu Dec 20 08:53:23 EST 2012


raeburn		Thu Dec 20 13:53:23 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - For 2.11
    - Backport 1.180, 1.181.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.160.6.10 loncom/interface/domainprefs.pm:1.160.6.11
--- loncom/interface/domainprefs.pm:1.160.6.10	Thu Dec 20 02:58:05 2012
+++ loncom/interface/domainprefs.pm	Thu Dec 20 13:53:22 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.160.6.10 2012/12/20 02:58:05 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.11 2012/12/20 13:53:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -405,6 +405,34 @@
         }
         &Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js);
     } else {
+# check if domconfig user exists for the domain.
+        my $servadm = $r->dir_config('lonAdmEMail');
+        my ($configuserok,$author_ok,$switchserver) = 
+            &config_check($dom,$confname,$servadm);
+        unless ($configuserok eq 'ok') {
+            &Apache::lonconfigsettings::print_header($r,$phase,$context);
+            $r->print(&mt('The domain configuration user "[_1]" has yet to be created.',
+                          $confname).
+                      '<br />'
+            );
+            if ($switchserver) {
+                $r->print(&mt('Ordinarily, that domain configuration user is created when the ./UPDATE script is run to install LON-CAPA for the first time.').
+                          '<br />'.
+                          &mt('However, that does not apply when new domains are added to a multi-domain server, and ./UPDATE has not been run recently.').
+                          '<br />'.
+                          &mt('The "[_1]" user can be created automatically when a Domain Coordinator visits the web-based "Set domain configuration" screen, in a session hosted on the primary library server.',$confname).
+                          '<br />'.
+                          &mt('To do that now, use the following link: [_1]',$switchserver)
+                );
+            } else {
+                $r->print(&mt('To create that user from the command line run the ./UPDATE script found in the top level directory of the extracted LON-CAPA tarball.').
+                          '<br />'.
+                          &mt('Once that is done, you will be able to use the web-based "Set domain configuration" to configure the domain')
+                );
+            }
+            $r->print(&Apache::loncommon::end_page());
+            return OK;
+        }
         if (keys(%domconfig) == 0) {
             my $primarylibserv = &Apache::lonnet::domain($dom,'primary');
             my @ids=&Apache::lonnet::current_machine_ids();
@@ -5634,7 +5662,7 @@
     my @ids=&Apache::lonnet::current_machine_ids();
     foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
     if (!$allowed) {
-	$switchserver='<a href="/adm/switchserver?otherserver='.$home.'&role=dc./'.$dom.'/">'.&mt('Switch Server').'</a>';
+	$switchserver='<a href="/adm/switchserver?otherserver='.$home.'&role=dc./'.$dom.'/&destinationurl=/adm/domainprefs">'.&mt('Switch Server').'</a>';
     }
     return $switchserver;
 }




More information about the LON-CAPA-cvs mailing list