[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Tue, 08 Jul 2008 20:16:18 -0000


raeburn		Tue Jul  8 16:16:18 2008 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  - Use &Apache::lonnet::auto_run() to check if auto-enrollment is active for the user's domain to replace &check_autoenroll() which is no longer needed.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.199 loncom/auth/lonroles.pm:1.200
--- loncom/auth/lonroles.pm:1.199	Sat Jul  5 19:27:34 2008
+++ loncom/auth/lonroles.pm	Tue Jul  8 16:16:16 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.199 2008/07/05 23:27:34 raeburn Exp $
+# $Id: lonroles.pm,v 1.200 2008/07/08 20:16:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -866,7 +866,7 @@
 sub findcourse_advice {
     my ($r) = @_;
     my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
-    if (&check_autoenroll($env{'user.domain'})) {
+    if (&Apache::lonnet::auto_run(undef,$env{'user.domain'})) {
         $r->print(&mt('If you were expecting to see an active role listed for a particular course in the [_1] domain, it may be missing for one of the following reasons:',$domdesc).'
 <ul>
  <li>'.&mt('The course has yet to be created.').'</li>
@@ -1288,24 +1288,6 @@
     return $startpage;
 }
 
-sub check_autoenroll {
-    my ($dom) = @_;
-    my $run_enroll = 0;
-    my $settings;
-    my %domconfig =
-        &Apache::lonnet::get_dom('configuration',['autoenroll'],$dom);
-    if (ref($domconfig{'autoenroll'}) eq 'HASH') {
-        $settings = $domconfig{'autoenroll'};
-        if ($settings->{'run'} eq '1') {
-            $run_enroll = 1;
-        }
-    } else {
-        $run_enroll = &localenroll::run($dom);
-    }
-    return $run_enroll;
-}
-
-
 1;
 __END__