'.$user_quota_text);
+ if ($user_tools_text ne '') {
+ $r->print($user_tools_text);
+ }
+ if ($env{'form.action'} eq 'singlestudent') {
+ $r->print(&date_sections_select($context,$newuser,$formname));
+ }
+ } elsif ($user_tools_text ne '') {
+ $r->print('
'.$user_tools_text);
if ($env{'form.action'} eq 'singlestudent') {
$r->print(&date_sections_select($context,$newuser,$formname));
}
@@ -833,10 +934,10 @@ ENDNOPORTPRIV
$addrolesdisplay = $add_domainroles;
}
$r->print(&course_level_dc($env{'request.role.domain'},'Course'));
- $r->print('
'."\n");
+ $r->print('
'."\n");
} elsif ($context eq 'author') {
if ($addrolesdisplay) {
- $r->print('
print('
print(' onClick="auth_check()" \>'."\n");
} else {
@@ -848,7 +949,7 @@ ENDNOPORTPRIV
}
} else {
$r->print(&course_level_table(%inccourses));
- $r->print('
'."\n");
+ $r->print('
'."\n");
}
}
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain']));
@@ -967,7 +1068,7 @@ sub display_existing_roles {
if (defined($coursedata{'description'})) {
$carea=$coursedata{'description'}.
'
'.&mt('Domain').': '.$coursedom.(' 'x8).
- &Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom);
+ &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$coursedir,$coursedom);
$sortkey.="\0".$coursedata{'description'};
$class=$coursedata{'type'};
} else {
@@ -1397,30 +1498,22 @@ sub modify_login_block {
sub personal_data_display {
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray) = @_;
- my ($output,$showforceid,%userenv,%canmodify,@inststatuses);
+ my ($output,$showforceid,%userenv,%canmodify);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
my $rowcount = 0;
my $editable = 0;
- if ($context eq 'selfcreate') {
- if (ref($inst_results) eq 'HASH') {
- @inststatuses = &get_inststatuses($inst_results);
- if (@inststatuses == 0) {
- @inststatuses = ('default');
- }
- $rolesarray = \@inststatuses;
- }
- }
if (!$newuser) {
# Get the users information
%userenv = &Apache::lonnet::get('environment',
['firstname','middlename','lastname','generation',
'permanentemail','id'],$ccdomain,$ccuname);
- }
- if ((!$newuser) || ($context eq 'selfcreate')) {
%canmodify =
&Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,
\@userinfo,$rolesarray);
+ } elsif ($context eq 'selfcreate') {
+ %canmodify = &selfcreate_canmodify($context,$ccdomain,\@userinfo,
+ $inst_results,$rolesarray);
}
my %lt=&Apache::lonlocal::texthash(
'pd' => "Personal Data",
@@ -1429,7 +1522,7 @@ sub personal_data_display {
'lastname' => "Last Name",
'generation' => "Generation",
'permanentemail' => "Permanent e-mail address",
- 'id' => "ID/Student Number",
+ 'id' => "Student/Employee ID",
'lg' => "Login Data"
);
my %textboxsize = (
@@ -1506,6 +1599,21 @@ sub personal_data_display {
}
}
+sub selfcreate_canmodify {
+ my ($context,$dom,$userinfo,$inst_results,$rolesarray) = @_;
+ if (ref($inst_results) eq 'HASH') {
+ my @inststatuses = &get_inststatuses($inst_results);
+ if (@inststatuses == 0) {
+ @inststatuses = ('default');
+ }
+ $rolesarray = \@inststatuses;
+ }
+ my %canmodify =
+ &Apache::lonuserutils::can_modify_userinfo($context,$dom,$userinfo,
+ $rolesarray);
+ return %canmodify;
+}
+
sub get_inststatuses {
my ($insthashref) = @_;
my @inststatuses = ();
@@ -1638,6 +1746,7 @@ sub update_user_data {
$r->print('
'.&mt('User [_1] in domain [_2]',
$env{'form.ccuname'}, $env{'form.ccdomain'}).' ');
my (%alerts,%rulematch,%inst_results,%curr_rules);
+ my @usertools = ('aboutme','blog','portfolio');
if ($env{'form.makeuser'}) {
$r->print('
'.&mt('Creating new account.').' ');
# Check for the authentication mode and password
@@ -1697,26 +1806,34 @@ sub update_user_data {
$r->print(&mt('Generating user').': '.$result);
$uhome = &Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
- if (($uhome ne 'no_host') && ($env{'form.customquota'} == 1)) {
- my (%changeHash,$newportfolioquota);
- if ($env{'form.portfolioquota'} eq '') {
- $newportfolioquota = 0;
- } else {
- $newportfolioquota = $env{'form.portfolioquota'};
- $newportfolioquota =~ s/[^\d\.]//g;
+ my (%changeHash,%newcustom,%changed);
+ if ($uhome ne 'no_host') {
+ if ($env{'form.customquota'} == 1) {
+ if ($env{'form.portfolioquota'} eq '') {
+ $newcustom{'quota'} = 0;
+ } else {
+ $newcustom{'quota'} = $env{'form.portfolioquota'};
+ $newcustom{'quota'} =~ s/[^\d\.]//g;
+ }
+ $changed{'quota'} = "a_admin($newcustom{'quota'},\%changeHash);
}
- my $quotachanged = "a_admin($newportfolioquota,\%changeHash);
- if ($quotachanged) {
+ foreach my $item (@usertools) {
+ if ($env{'form.custom'.$item} == 1) {
+ $newcustom{$item} = $env{'form.tools_'.$item};
+ $changed{$item} = &tool_admin($item,$newcustom{$item},\%changeHash);
+ }
+ }
+ if (keys(%changed)) {
$changeHash{'firstname'} = $env{'form.cfirstname'};
$changeHash{'middlename'} = $env{'form.cmiddlename'};
$changeHash{'lastname'} = $env{'form.clastname'};
$changeHash{'generation'} = $env{'form.cgeneration'};
$changeHash{'id'} = $env{'form.cid'};
$changeHash{'permanentemail'} = $env{'form.cpermanentemail'};
- my $quotachgresult =
- &Apache::lonnet::put('environment',\%changeHash,
- $env{'form.ccdomain'},$env{'form.ccuname'});
- }
+ my $chgresult =
+ &Apache::lonnet::put('environment',\%changeHash,
+ $env{'form.ccdomain'},$env{'form.ccuname'});
+ }
}
$r->print('
'.&mt('Home server').': '.$uhome.' '.
&Apache::lonnet::hostname($uhome));
@@ -1749,7 +1866,8 @@ sub update_user_data {
# Check for need to change
my %userenv = &Apache::lonnet::get
('environment',['firstname','middlename','lastname','generation',
- 'id','permanentemail','portfolioquota','inststatus'],
+ 'id','permanentemail','portfolioquota','inststatus','tools.aboutme',
+ 'tools.blog','tools.portfolio'],
$env{'form.ccdomain'},$env{'form.ccuname'});
my ($tmp) = keys(%userenv);
if ($tmp =~ /^(con_lost|error)/i) {
@@ -1840,7 +1958,7 @@ sub update_user_data {
$env{'form.c'.$item} = $userenv{$item};
}
}
- # Check to see if we can change the ID/student number
+ # Check to see if we can change the Student/Employee ID
my $forceid = $env{'form.forceid'};
my $recurseid = $env{'form.recurseid'};
my (%alerts,%rulematch,%idinst_results,%curr_rules,%got_rules);
@@ -1851,7 +1969,10 @@ sub update_user_data {
(!$forceid)) {
if ($env{'form.cid'} ne $uidhash{$env{'form.ccuname'}}) {
$env{'form.cid'} = $userenv{'id'};
- $no_forceid_alert = &mt('New student/employeeID does not match existing ID for this user.').'
'.&mt('Change is not permitted without checking the \'Force ID change\' checkbox on the previous page.').'
'."\n";
+ $no_forceid_alert = &mt('New Student/Employee ID does not match existing ID for this user.')
+ .'
'
+ .&mt("Change is not permitted without checking the 'Force ID change' checkbox on the previous page.")
+ .'
'."\n";
}
}
if ($env{'form.cid'} ne $userenv{'id'}) {
@@ -1871,14 +1992,17 @@ sub update_user_data {
}
my ($quotachanged,$oldportfolioquota,$newportfolioquota,
$inststatus,$oldisdefault,$newisdefault,$olddefquotatext,
- $newdefquotatext);
+ $newdefquotatext,%oldaccess,%oldaccesstext,%newaccess,%newaccesstext);
my ($defquota,$settingstatus) =
&Apache::loncommon::default_quota($env{'form.ccdomain'},$inststatus);
- my $showquota;
+ my ($showquota,$showtools);
if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) {
$showquota = 1;
}
- my %changeHash;
+ if (&Apache::lonnet::allowed('mut',$env{'form.ccdomain'})) {
+ $showtools = 1;
+ }
+ my (%changeHash,%changed);
$changeHash{'portfolioquota'} = $userenv{'portfolioquota'};
if ($userenv{'portfolioquota'} ne '') {
$oldportfolioquota = $userenv{'portfolioquota'};
@@ -1890,10 +2014,10 @@ sub update_user_data {
$newportfolioquota =~ s/[^\d\.]//g;
}
if ($newportfolioquota != $oldportfolioquota) {
- $quotachanged = "a_admin($newportfolioquota,\%changeHash);
+ $changed{'quota'} = "a_admin($newportfolioquota,\%changeHash);
}
} else {
- $quotachanged = "a_admin('',\%changeHash);
+ $changed{'quota'} = "a_admin('',\%changeHash);
$newportfolioquota = $defquota;
$newisdefault = 1;
}
@@ -1907,7 +2031,7 @@ sub update_user_data {
$newportfolioquota = $env{'form.portfolioquota'};
$newportfolioquota =~ s/[^\d\.]//g;
}
- $quotachanged = "a_admin($newportfolioquota,\%changeHash);
+ $changed{'quota'} = "a_admin($newportfolioquota,\%changeHash);
} else {
$newportfolioquota = $defquota;
$newisdefault = 1;
@@ -1919,6 +2043,73 @@ sub update_user_data {
if ($newisdefault) {
$newdefquotatext = &get_defaultquota_text($settingstatus);
}
+
+ foreach my $tool (@usertools) {
+ if ($userenv{'tools.'.$tool} ne '') {
+ $oldaccess{$tool} = &mt('custom');
+ if ($userenv{'tools_'.$tool}) {
+ $oldaccesstext{$tool} = &mt("availability set to 'on'");
+ } else {
+ $oldaccesstext{$tool} = &mt("availability set to 'off'");
+ }
+ $changeHash{'tools.'.$tool} = $userenv{'tools.'.$tool};
+ if ($env{'form.custom'.$tool} == 1) {
+ if ($env{'form.tools_'.$tool} ne $userenv{'tools.'.$tool}) {
+ $changed{$tool} = &tool_admin($tool,$env{'form.tools_'.$tool},
+ \%changeHash);
+ if ($changed{$tool}) {
+ $newaccess{$tool} = &mt('custom');
+ if ($env{'form.tools_'.$tool}) {
+ $newaccesstext{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext{$tool} = &mt("availability set to 'off'");
+ }
+ } else {
+ $newaccess{$tool} = $oldaccess{$tool};
+ if ($userenv{'tools.'.$tool}) {
+ $newaccesstext{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext{$tool} = &mt("availability set to 'off'");
+ }
+ }
+ } else {
+ $newaccess{$tool} = $oldaccess{$tool};
+ $newaccesstext{$tool} = $oldaccesstext{$tool};
+ }
+ } else {
+ $changed{$tool} = &tool_admin($tool,'',\%changeHash);
+ if ($changed{$tool}) {
+ $newaccess{$tool} = &mt('default');
+ } else {
+ $newaccess{$tool} = $oldaccess{$tool};
+ if ($userenv{'tools.'.$tool}) {
+ $newaccesstext{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext{$tool} = &mt("availability set to 'off'");
+ }
+ }
+ }
+ } else {
+ $oldaccess{$tool} = &mt('default');
+ if ($env{'form.custom'.$tool} == 1) {
+ $changed{$tool} = &tool_admin($tool,$env{'form.tools_'.$tool},
+ \%changeHash);
+ if ($changed{$tool}) {
+ $newaccess{$tool} = &mt('custom');
+ if ($env{'form.tools_'.$tool}) {
+ $newaccesstext{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext{$tool} = &mt("availability set to 'off'");
+ }
+ } else {
+ $newaccess{$tool} = $oldaccess{$tool};
+ }
+ } else {
+ $newaccess{$tool} = $oldaccess{$tool};
+ }
+ }
+ }
+
if ($env{'form.cfirstname'} ne $userenv{'firstname'} ||
$env{'form.cmiddlename'} ne $userenv{'middlename'} ||
$env{'form.clastname'} ne $userenv{'lastname'} ||
@@ -1927,18 +2118,35 @@ sub update_user_data {
$env{'form.cpermanentemail'} ne $userenv{'permanentemail'} ) {
$namechanged = 1;
}
- if ($namechanged || $quotachanged) {
+ if (($namechanged) || (keys(%changed) > 0)) {
$changeHash{'firstname'} = $env{'form.cfirstname'};
$changeHash{'middlename'} = $env{'form.cmiddlename'};
$changeHash{'lastname'} = $env{'form.clastname'};
$changeHash{'generation'} = $env{'form.cgeneration'};
$changeHash{'id'} = $env{'form.cid'};
$changeHash{'permanentemail'} = $env{'form.cpermanentemail'};
- my ($quotachgresult,$namechgresult);
- if ($quotachanged) {
- $quotachgresult =
+ my ($chgresult,$namechgresult);
+ if (keys(%changed) > 0) {
+ $chgresult =
&Apache::lonnet::put('environment',\%changeHash,
$env{'form.ccdomain'},$env{'form.ccuname'});
+ if ($chgresult eq 'ok') {
+ if (($env{'user.name'} eq $env{'form.ccuname'}) &&
+ ($env{'user.domain'} eq $env{'form.ccdomain'})) {
+ my %newenvhash;
+ foreach my $key (keys(%changed)) {
+ if ($key ne 'quota') {
+ $newenvhash{'environment.tools.'.$key} =
+ $changeHash{'tools.'.$key};
+ $newenvhash{'environment.availabletools.'.$key} =
+ $changeHash{'tools.'.$key};
+ }
+ }
+ if (keys(%newenvhash)) {
+ &Apache::lonnet::appenv(\%newenvhash);
+ }
+ }
+ }
}
if ($namechanged) {
# Make the change
@@ -1957,19 +2165,22 @@ sub update_user_data {
);
}
if (($namechanged && $namechgresult eq 'ok') ||
- ($quotachanged && $quotachgresult eq 'ok')) {
+ ((keys(%changed) > 0) && $chgresult eq 'ok')) {
# Tell the user we changed the name
my %lt=&Apache::lonlocal::texthash(
- 'uic' => "User Information Changed",
- 'frst' => "first",
- 'mddl' => "middle",
- 'lst' => "last",
- 'gen' => "generation",
- 'id' => "ID/Student number",
- 'mail' => "permanent e-mail",
- 'disk' => "disk space allocated to portfolio files",
- 'prvs' => "Previous",
- 'chto' => "Changed To"
+ 'uic' => "User Information Changed",
+ 'frst' => "First",
+ 'mddl' => "Middle",
+ 'lst' => "Last",
+ 'gen' => "Generation",
+ 'id' => "Student/Employee ID",
+ 'mail' => "Permanent E-mail",
+ 'disk' => "Disk space allocated to portfolio files",
+ 'blog' => "Blog Availability",
+ 'aboutme' => "Home Page Availability",
+ 'portfolio' => "Portfolio Availability",
+ 'prvs' => "Previous",
+ 'chto' => "Changed To"
);
$r->print('
'.$lt{'uic'}.' '.
&Apache::loncommon::start_data_table().
@@ -1987,6 +2198,12 @@ END
$r->print("
$lt{'disk'} \n");
}
+ if ($showtools) {
+ foreach my $item (@usertools) {
+ $r->print("
+
$lt{$item} \n");
+ }
+ }
$r->print(&Apache::loncommon::end_data_table_header_row().
&Apache::loncommon::start_data_table_row());
$r->print(<<"END");
@@ -2002,10 +2219,16 @@ END
$r->print("
$oldportfolioquota Mb $olddefquotatext \n");
}
+ if ($showtools) {
+ foreach my $item (@usertools) {
+ $r->print("
+
$oldaccess{$item} $oldaccesstext{$item} \n");
+ }
+ }
$r->print(&Apache::loncommon::end_data_table_row().
&Apache::loncommon::start_data_table_row());
$r->print(<<"END");
-
$lt{'chto'}
+
$lt{'chto'}
$env{'form.cfirstname'}
$env{'form.cmiddlename'}
$env{'form.clastname'}
@@ -2017,6 +2240,12 @@ END
$r->print("
$newportfolioquota Mb $newdefquotatext \n");
}
+ if ($showtools) {
+ foreach my $item (@usertools) {
+ $r->print("
+
$newaccess{$item} $newaccesstext{$item} \n");
+ }
+ }
$r->print(&Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table().'
');
if ($env{'form.cid'} ne $userenv{'id'}) {
@@ -2045,12 +2274,15 @@ END
$env{'form.ccdomain'}.'
');
}
} else { # End of if ($env ... ) logic
- # They did not want to change the users name or quota but we can
- # still tell them what the name and quota are
+ # They did not want to change the users name, quota or tool availability,
+ # but we can still tell them what the name and quota and availabilities are
my %lt=&Apache::lonlocal::texthash(
- 'id' => "ID/Student number",
- 'mail' => "Permanent e-mail",
- 'disk' => "Disk space allocated to user's portfolio files",
+ 'id' => "Student/Employee ID",
+ 'mail' => "Permanent e-mail",
+ 'disk' => "Disk space allocated to user's portfolio files",
+ 'blog' => "Blog Availability",
+ 'aboutme' => "Home Page Availability",
+ 'portfolio' => "Portfolio Availability",
);
$r->print(<<"END");
$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} $userenv{'generation'}
@@ -2059,8 +2291,14 @@ END
$r->print(' ['.$lt{'mail'}.': '.
$userenv{'permanentemail'}.']');
}
+ if ($showtools) {
+ foreach my $item (@usertools) {
+ $r->print(' ['.$lt{$item}.': '.$newaccess{$item}.' '.
+ $newaccesstext{$item}.']'."\n");
+ }
+ }
if ($showquota) {
- $r->print(' ['.$lt{'disk'}.': '.$oldportfolioquota.' Mb '.
+ $r->print(' ['.$lt{'disk'}.': '.$oldportfolioquota.' Mb '.
$olddefquotatext.']');
}
$r->print(' ');
@@ -2091,8 +2329,10 @@ END
$r->print('
'.$rolestr.' '.
&mt('Contact your
helpdesk for more information.',"javascript:helpMenu('display')").'
');
}
- $r->print($no_forceid_alert.
- &Apache::lonuserutils::print_namespacing_alerts($env{'form.ccdomain'},\%alerts,\%curr_rules));
+ $r->print('
'
+ .$no_forceid_alert
+ .&Apache::lonuserutils::print_namespacing_alerts($env{'form.ccdomain'},\%alerts,\%curr_rules)
+ .' ');
}
if ($env{'form.action'} eq 'singlestudent') {
&enroll_single_student($r,$uhome,$amode,$genpwd,$now,$newuser,$context);
@@ -2234,8 +2474,8 @@ sub update_roles {
my $result=&Apache::lonnet::assignrole($env{'form.ccdomain'},
$env{'form.ccuname'},$url,$role,0,$now,'','',
$context);
- $output = &mt('Re-enabling [_1] in [_2]:
[_3] ',
- $role,$url,$result).'
';
+ $output = &mt('Re-enabling [_1] in [_2]: [_3]',
+ $role,$url,'
'.$result.' ').'
';
}
$r->print($output);
if (!grep(/^\Q$role\E$/,@rolechanges)) {
@@ -2248,8 +2488,8 @@ sub update_roles {
my $result = &Apache::lonnet::assigncustomrole(
$env{'form.ccdomain'}, $env{'form.ccuname'},
$url,$rdom,$rnam,$rolename,0,$now,undef,$context);
- $r->print(&mt('Re-enabling custom role [_1] by [_2]@[_3] in [_4] :
[_5] ',
- $rolename,$rnam,$rdom,$url,$result).'
');
+ $r->print(&mt('Re-enabling custom role [_1] by [_2]:[_3] in [_4] : [_5]',
+ $rolename,$rnam,$rdom,$url,'
'.$result.' ').'
');
if (!grep(/^cr$/,@rolechanges)) {
push(@rolechanges,'cr');
}
@@ -2478,12 +2718,27 @@ sub quota_admin {
my $quotachanged;
if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) {
# Current user has quota modification privileges
- $quotachanged = 1;
- $changeHash->{'portfolioquota'} = $setquota;
+ if (ref($changeHash) eq 'HASH') {
+ $quotachanged = 1;
+ $changeHash->{'portfolioquota'} = $setquota;
+ }
}
return $quotachanged;
}
+sub tool_admin {
+ my ($tool,$settool,$changeHash) = @_;
+ my $toolchanged;
+ if (&Apache::lonnet::allowed('mut',$env{'form.ccdomain'})) {
+ # Current user has quota modification privileges
+ if (ref($changeHash) eq 'HASH') {
+ $toolchanged = 1;
+ $changeHash->{'tools.'.$tool} = $settool;
+ }
+ }
+ return $toolchanged;
+}
+
sub build_roles {
my ($sectionstr,$sections,$role) = @_;
my $num_sections = 0;
@@ -2593,7 +2848,7 @@ sub custom_role_editor {
my @template_roles = ("cc","in","ta","ep","st");
foreach my $role (@template_roles) {
$head_script .= &make_script_template($role);
- $button_code .= &make_button_code($role);
+ $button_code .= &make_button_code($role).' ';
}
$head_script .= "\n".$jsback."\n".''."\n";
$r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script));
@@ -2613,10 +2868,15 @@ sub custom_role_editor {
'crl' => "Course Level",
'dml' => "Domain Level",
'ssl' => "System Level");
- $r->print(&mt('Select a Template').'
');
- $r->print('
');
+
+ $r->print('
'
+ .''
+ .'
'
+ );
+
$r->print(<
@@ -2676,34 +2936,35 @@ sub make_script_template {
my ($priv_item, $dummy) = split(/\&/,$priv);
$role_c{$priv_item} = 1;
}
+ my %role_d;
+ @temp = split(/:/,$Apache::lonnet::pr{$role.':d'});
+ foreach my $priv(@temp) {
+ my ($priv_item, $dummy) = split(/\&/,$priv);
+ $role_d{$priv_item} = 1;
+ }
+ my %role_s;
+ @temp = split(/:/,$Apache::lonnet::pr{$role.':s'});
+ foreach my $priv(@temp) {
+ my ($priv_item, $dummy) = split(/\&/,$priv);
+ $role_s{$priv_item} = 1;
+ }
foreach my $priv_item (keys(%full_c)) {
my ($priv, $dummy) = split(/\&/,$priv_item);
- if (exists($role_c{$priv})) {
+ if ((exists($role_c{$priv})) || (exists($role_d{$priv})) ||
+ (exists($role_s{$priv}))) {
$return_script .= "document.form1.$priv"."_c.checked = true;\n";
} else {
$return_script .= "document.form1.$priv"."_c.checked = false;\n";
}
}
- my %role_d;
- @temp = split(/:/,$Apache::lonnet::pr{$role.':d'});
- foreach my $priv(@temp) {
- my ($priv_item, $dummy) = split(/\&/,$priv);
- $role_d{$priv_item} = 1;
- }
foreach my $priv_item (keys(%full_d)) {
my ($priv, $dummy) = split(/\&/,$priv_item);
- if (exists($role_d{$priv})) {
+ if ((exists($role_d{$priv})) || (exists($role_s{$priv}))) {
$return_script .= "document.form1.$priv"."_d.checked = true;\n";
} else {
$return_script .= "document.form1.$priv"."_d.checked = false;\n";
}
}
- my %role_s;
- @temp = split(/:/,$Apache::lonnet::pr{$role.':s'});
- foreach my $priv(@temp) {
- my ($priv_item, $dummy) = split(/\&/,$priv);
- $role_s{$priv_item} = 1;
- }
foreach my $priv_item (keys(%full_s)) {
my ($priv, $dummy) = split(/\&/,$priv_item);
if (exists($role_s{$priv})) {
@@ -2719,7 +2980,7 @@ sub make_script_template {
sub make_button_code {
my ($role) = @_;
my $label = &Apache::lonnet::plaintext($role);
- my $button_code = ' ';
+ my $button_code = ' ';
return ($button_code);
}
# ---------------------------------------------------------- Call to definerole
@@ -3124,7 +3385,7 @@ sub print_main_menu {
action => 'upload',
permission => $permission->{'cusr'},
},
- { text => $links{$context}{'singleuser'},
+ { text => $links{$context}{'singleuser'},
help => 'Course_Change_Privileges',
action => 'singleuser',
permission => $permission->{'cusr'},
@@ -3168,7 +3429,7 @@ sub print_main_menu {
{ text => 'Configure User Self-enrollment',
help => 'Course_Self_Enrollment',
action => 'selfenroll',
- permission => $permission->{'cusr'},
+ permission => $permission->{'cusr'},
});
}
push(@courselinks,
@@ -3202,8 +3463,7 @@ sub print_main_menu {
$menu_html.=qq{};
} else {
$menu_html.=
- qq{ };
- }
+ qq{ }; }
$menu_html.= &mt($menu_item->{'text'}).' ';
$menu_html.='';
}
@@ -3400,14 +3660,32 @@ function getIndexByName(item) {
return -1;
}
ENDSCRIPT
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+
my $output = ''."\n".
- ''.$lt->{'selfenroll'}.' '."\n".
- '