version 1.263, 2011/10/25 15:15:02
|
version 1.266, 2012/05/16 21:19:44
|
Line 221 sub handler {
|
Line 221 sub handler {
|
} else { |
} else { |
$checkingtxt = &mt('Checking for new roles ...'); |
$checkingtxt = &mt('Checking for new roles ...'); |
} |
} |
$updateresult = '<div class="LC_info">'.$checkingtxt.'</div>'; |
$updateresult = '<span class="LC_info">'.$checkingtxt.'</span>'; |
$updateresult .= &update_session_roles(); |
$updateresult .= &update_session_roles(); |
&Apache::lonnet::appenv({'user.update.time' => $now}); |
&Apache::lonnet::appenv({'user.update.time' => $now}); |
$update = $now; |
$update = $now; |
Line 781 ENDHEADER
|
Line 781 ENDHEADER
|
if ($env{'form.showall'}) { |
if ($env{'form.showall'}) { |
$showall .= ' checked="checked" '; |
$showall .= ' checked="checked" '; |
} |
} |
$showall .= ' />'.&mt('Show all roles').'</label>'. |
$showall .= ' />'.&mt('Show all roles').'</label> '. |
'<input type="submit" value="'.&mt('Update display').'" />'; |
'<input type="submit" value="'.&mt('Update display').'" />'; |
if ($do_update) { |
if ($do_update) { |
$r->print('<div class="LC_left_float"><fieldset>'. |
$r->print('<div class="LC_left_float"><fieldset>'. |
Line 1613 sub check_forcc {
|
Line 1613 sub check_forcc {
|
} else { |
} else { |
$ccrole = 'cc'; |
$ccrole = 'cc'; |
} |
} |
if ($cdom ne '' && $cnum ne '') { |
if (&Apache::lonnet::is_course($cdom,$cnum)) { |
if (&Apache::lonnet::is_course($cdom,$cnum)) { |
my $envkey = 'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum; |
my $envkey = 'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum; |
if (defined($env{$envkey})) { |
if (defined($env{$envkey})) { |
$is_cc = 1; |
$is_cc = 1; |
my ($tstart,$tend)=split(/\./,$env{$envkey}); |
my ($tstart,$tend)=split(/\./,$env{$envkey}); |
my $limit = $update; |
my $limit = $update; |
if ($env{'request.role'} eq $ccrole.'./'.$cdom.'/'.$cnum) { |
if ($env{'request.role'} eq $ccrole.'./'.$cdom.'/'.$cnum) { |
$limit = $then; |
$limit = $then; |
|
} |
|
if ($tstart && $tstart>$refresh) { $is_cc = 0; } |
|
if ($tend && $tend <$limit) { $is_cc = 0; } |
|
} |
} |
|
if ($tstart && $tstart>$refresh) { $is_cc = 0; } |
|
if ($tend && $tend <$limit) { $is_cc = 0; } |
} |
} |
} |
} |
return $is_cc; |
return $is_cc; |
Line 1871 sub update_session_roles {
|
Line 1869 sub update_session_roles {
|
['active','future','previous'], |
['active','future','previous'], |
undef,undef,1); |
undef,undef,1); |
my ($msg,@newsec,$oldsec,$currrole_expired,@changed_roles, |
my ($msg,@newsec,$oldsec,$currrole_expired,@changed_roles, |
%changed_groups,%dbroles, %deletedroles,%allroles,%allgroups, |
%changed_groups,%dbroles,%deletedroles,%allroles,%allgroups, |
%userroles,%checkedgroup,%crprivs,$hasgroups,%rolechange, |
%userroles,%checkedgroup,%crprivs,$hasgroups,%rolechange, |
%groupchange,%newrole,%newgroup,%customprivchg,%groups_roles, |
%groupchange,%newrole,%newgroup,%customprivchg,%groups_roles, |
@rolecodes); |
@rolecodes); |
Line 2108 sub update_session_roles {
|
Line 2106 sub update_session_roles {
|
foreach my $priv (@privs) { |
foreach my $priv (@privs) { |
my ($blank,@prv) = split(/:/,$priv); |
my ($blank,@prv) = split(/:/,$priv); |
@prv = map { $_ .= (/\&\w+$/ ? '':'&F') } @prv; |
@prv = map { $_ .= (/\&\w+$/ ? '':'&F') } @prv; |
$priv = ':'.join(':',sort(@prv)); |
if (@prv) { |
|
$priv = ':'.join(':',sort(@prv)); |
|
} |
$crprivs{$rest}{$scopes[$i]} = $priv; |
$crprivs{$rest}{$scopes[$i]} = $priv; |
$i++; |
$i++; |
} |
} |
Line 2212 sub update_session_roles {
|
Line 2212 sub update_session_roles {
|
$msg .= '<br />'.&mt('However you can continue to use this role until you logout, click the "Re-Select" button, or your session has been idle for more than 24 hours.').'</div>'; |
$msg .= '<br />'.&mt('However you can continue to use this role until you logout, click the "Re-Select" button, or your session has been idle for more than 24 hours.').'</div>'; |
} |
} |
if (!@changed_roles || !(keys(%changed_groups))) { |
if (!@changed_roles || !(keys(%changed_groups))) { |
$msg .= '<ul>'; |
my ($rolesmsg,$groupsmsg); |
if (!@changed_roles) { |
if (!@changed_roles) { |
$msg .= '<li>'; |
|
if (&Apache::loncommon::show_course()) { |
if (&Apache::loncommon::show_course()) { |
$msg .= &mt('No new courses or communities'); |
$rolesmsg = &mt('No new courses or communities'); |
} else { |
} else { |
$msg .= &mt('No role changes'); |
$rolesmsg = &mt('No role changes'); |
} |
} |
$msg .= '</li>'; |
|
} |
} |
if ($hasgroups && !(keys(%changed_groups)) && !(grep(/gr/,@changed_roles))) { |
if ($hasgroups && !(keys(%changed_groups)) && !(grep(/gr/,@changed_roles))) { |
$msg .= '<li>'.&mt('No changes in course/community groups').'</li>'; |
$groupsmsg = &mt('No changes in course/community groups'); |
} |
} |
$msg .= '</ul>'; |
|
if (!@changed_roles && !(keys(%changed_groups))) { |
if (!@changed_roles && !(keys(%changed_groups))) { |
|
if (($msg ne '') || ($groupsmsg ne '')) { |
|
$msg .= '<ul>'; |
|
if ($rolesmsg) { |
|
$msg .= '<li>'.$rolesmsg.'</li>'; |
|
} |
|
if ($groupsmsg) { |
|
$msg .= '<li>'.$groupsmsg.'</li>'; |
|
} |
|
$msg .= '</ul>'; |
|
} else { |
|
$msg = ' <span class="LC_cusr_emph">'.$rolesmsg.'</span><br /><br />'; |
|
} |
return $msg; |
return $msg; |
} |
} |
} |
} |