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

raeburn raeburn at source.lon-capa.org
Tue Oct 25 08:45:34 EDT 2016


raeburn		Tue Oct 25 12:45:34 2016 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - lonnet::definerole() used to store custom roles. 
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.282 loncom/interface/domainprefs.pm:1.283
--- loncom/interface/domainprefs.pm:1.282	Wed Oct  5 13:59:46 2016
+++ loncom/interface/domainprefs.pm	Tue Oct 25 12:45:33 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.282 2016/10/05 13:59:46 raeburn Exp $
+# $Id: domainprefs.pm,v 1.283 2016/10/25 12:45:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11853,13 +11853,15 @@
         $rolename=~s/[^A-Za-z0-9]//gs;
         if ($rolename ne '') {
             unless(exists($existing{'rolesdef_'.$rolename})) {
-                my $errmsg;
-                my $result = &Apache::lonuserutils::store_custom_role($rolename,$prefix,
-                                                                      $confname,$dom);
+                my %newprivs = &Apache::lonuserutils::custom_role_update($rolename,$prefix);
+                my $result = &Apache::lonnet::definerole($rolename,$newprivs{'s'},$newprivs{'d'},
+                                                         $newprivs{'c'},$confname,$dom);
                 if ($result eq 'ok') {
                     $changes{'newcustomrole'} = $rolename;
                 } else {
-                    $errmsg = ': '.$result;
+                    $errors .= '<li><span class="LC_error">'.
+                               &mt('An error occurred storing the new custom role: [_1]',
+                                   $result).'</span></li>';
                 }
             }
         }




More information about the LON-CAPA-cvs mailing list