ENDCHANGEUSER
# Get the users information
my %userenv = &Apache::lonnet::get('environment',
@@ -336,8 +314,8 @@ END
}
# Compute the background color based on $area
$bgcol=$1.'_'.$2;
- $bgcol=~s/[^8-9b-e]//g;
- $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6);
+ $bgcol=~s/[^7-9a-e]//g;
+ $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);
if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) {
$carea.=' Section/Group: '.$3;
}
@@ -369,7 +347,7 @@ END
}
}
my $row = '';
- $row.='
';
+ $row.='
';
my $active=1;
$active=0 if (($role_end_time) && ($now>$role_end_time));
if (($active) && ($allowed)) {
@@ -873,16 +851,136 @@ sub custom_role_editor {
$r->print(&Apache::loncommon::bodytag(
'Create Users, Change User Privileges').'
');
+ my $syspriv='';
+ my $dompriv='';
+ my $coursepriv='';
my ($rdummy,$roledef)=
&Apache::lonnet::get('roles',["rolesdef_$rolename"]);
+# ------------------------------------------------------- Does this role exist?
if (($rdummy ne 'con_lost') && ($roledef ne '')) {
$r->print('Existing Role "');
+# ------------------------------------------------- Get current role privileges
+ ($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef);
} else {
$r->print('New Role "');
$roledef='';
}
$r->print($rolename.'"
');
- $r->print('Not yet implemented.');
+# ------------------------------------------------------- What can be assigned?
+ my %full=();
+ my %courselevel=();
+ my %courselevelcurrent=();
+ foreach (split(/\:/,$Apache::lonnet::pr{'cr:c'})) {
+ my ($priv,$restrict)=split(/\&/,$_);
+ unless ($restrict) { $restrict='F'; }
+ $courselevel{$priv}=$restrict;
+ if ($coursepriv=~/\:$priv/) {
+ $courselevelcurrent{$priv}=1;
+ }
+ $full{$priv}=1;
+ }
+ my %domainlevel=();
+ my %domainlevelcurrent=();
+ foreach (split(/\:/,$Apache::lonnet::pr{'cr:d'})) {
+ my ($priv,$restrict)=split(/\&/,$_);
+ unless ($restrict) { $restrict='F'; }
+ $domainlevel{$priv}=$restrict;
+ if ($dompriv=~/\:$priv/) {
+ $domainlevelcurrent{$priv}=1;
+ }
+ $full{$priv}=1;
+ }
+ my %systemlevel=();
+ my %systemlevelcurrent=();
+ foreach (split(/\:/,$Apache::lonnet::pr{'cr:s'})) {
+ my ($priv,$restrict)=split(/\&/,$_);
+ unless ($restrict) { $restrict='F'; }
+ $systemlevel{$priv}=$restrict;
+ if ($syspriv=~/\:$priv/) {
+ $systemlevelcurrent{$priv}=1;
+ }
+ $full{$priv}=1;
+ }
+ $r->print(<
+
+
+