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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 10 Apr 2006 18:59:31 -0000


albertel		Mon Apr 10 14:59:31 2006 EDT

  Modified files:              
    /loncom/interface	lonpreferences.pm 
  Log:
  - using the function determinator code
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.79 loncom/interface/lonpreferences.pm:1.80
--- loncom/interface/lonpreferences.pm:1.79	Fri Mar 24 13:09:27 2006
+++ loncom/interface/lonpreferences.pm	Mon Apr 10 14:59:30 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.79 2006/03/24 18:09:27 albertel Exp $
+# $Id: lonpreferences.pm,v 1.80 2006/04/10 18:59:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -505,17 +505,7 @@
 sub colorschanger {
     my $r = shift;
 # figure out colors
-    my $function='student';
-    if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
-	$function='coordinator';
-    }
-    if ($env{'request.role'}=~/^(su|dc|ad|li)/) {
-	$function='admin';
-    }
-    if (($env{'request.role'}=~/^(au|ca)/) ||
-	($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {
-	$function='author';
-    }
+    my $function=&Apache::loncommon::get_users_function();
     my $domain=&Apache::loncommon::determinedomain();
     my %colortypes=('pgbg'  => 'Page Background',
                     'tabbg' => 'Header Background',
@@ -581,17 +571,7 @@
 sub verify_and_change_colors {
     my $r = shift;
 # figure out colors
-    my $function='student';
-    if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
-	$function='coordinator';
-    }
-    if ($env{'request.role'}=~/^(su|dc|ad|li)/) {
-	$function='admin';
-    }
-    if (($env{'request.role'}=~/^(au|ca)/) ||
-	($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {
-	$function='author';
-    }
+    my $function=&Apache::loncommon::get_users_function();
     my $domain=&Apache::loncommon::determinedomain();
     my %colortypes=('pgbg'  => 'Page Background',
                     'tabbg' => 'Header Background',