version 1.153, 2009/04/25 17:14:24
|
version 1.157, 2009/05/05 11:40:51
|
Line 473 sub verify_and_change_rolespref {
|
Line 473 sub verify_and_change_rolespref {
|
# Unset any roles that were previously frozen but aren't in list |
# Unset any roles that were previously frozen but aren't in list |
foreach my $role_key (sort(keys(%recent_roles))) { |
foreach my $role_key (sort(keys(%recent_roles))) { |
if (($frozen_roles{$role_key}) && (!exists($freeze{$role_key}))) { |
if (($frozen_roles{$role_key}) && (!exists($freeze{$role_key}))) { |
$message .= "<br />".&mt('Unfreezing '.$role.': [_1]',$role_text{$role_key})."\n"; |
$message .= "<br />".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]',$role_text{$role_key}))."\n"; |
&Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0); |
&Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0); |
} |
} |
} |
} |
Line 481 sub verify_and_change_rolespref {
|
Line 481 sub verify_and_change_rolespref {
|
# Freeze selected roles |
# Freeze selected roles |
foreach my $role_key (@freeze_list) { |
foreach my $role_key (@freeze_list) { |
if (!$frozen_roles{$role_key}) { |
if (!$frozen_roles{$role_key}) { |
$message .= "<br />".&mt('Freezing '.$role.': [_1]',$role_text{$role_key})."\n"; |
$message .= "<br />". |
|
&Apache::lonhtmlcommon::confirm_success(&mt('Freezing '.$role.': [_1]',$role_text{$role_key}))."\n"; |
&Apache::lonhtmlcommon::store_recent('roles', |
&Apache::lonhtmlcommon::store_recent('roles', |
$role_key,' ',1); |
$role_key,' ',1); |
} |
} |
Line 568 sub verify_and_change_screenname {
|
Line 569 sub verify_and_change_screenname {
|
################################################################ |
################################################################ |
sub iconchanger { |
sub iconchanger { |
my $r = shift; |
my $r = shift; |
Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{ href => '/adm/preferences?action=changeicons', |
{ href => '/adm/preferences?action=changeicons', |
text => 'Change Main Menu'}); |
text => 'Change Main Menu'}); |
$r->print(Apache::loncommon::start_page('Page Display Settings')); |
$r->print(Apache::loncommon::start_page('Page Display Settings')); |
Line 669 sub verify_and_change_clicker {
|
Line 670 sub verify_and_change_clicker {
|
|
|
sub domcoordchanger { |
sub domcoordchanger { |
my $r = shift; |
my $r = shift; |
Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{ href => '/adm/preferences?action=changedomcoord', |
{ href => '/adm/preferences?action=changedomcoord', |
text => 'Restrict Domain Coordinator Access'}); |
text => 'Restrict Domain Coordinator Access'}); |
$r->print(Apache::loncommon::start_page('Restrict Domain Coordinator Access')); |
$r->print(Apache::loncommon::start_page('Restrict Domain Coordinator Access')); |
Line 1076 sub colorschanger {
|
Line 1077 sub colorschanger {
|
# figure out colors |
# figure out colors |
my $function=&Apache::loncommon::get_users_function(); |
my $function=&Apache::loncommon::get_users_function(); |
my $domain=&Apache::loncommon::determinedomain(); |
my $domain=&Apache::loncommon::determinedomain(); |
my %colortypes=('pgbg' => 'Page Background', |
my %colortypes=&Apache::lonlocal::texthash( |
'tabbg' => 'Header Background', |
'pgbg' => 'Page Background Color', |
'sidebg'=> 'Header Border', |
'tabbg' => 'Header Background Color', |
'font' => 'Font', |
'sidebg' => 'Header Border Color', |
'link' => 'Un-Visited Link', |
'font' => 'Font Color', |
'vlink' => 'Visited Link', |
'fontmenu' => 'Font Menu Color', |
'alink' => 'Active Link'); |
'link' => 'Un-Visited Link Color', |
|
'vlink' => 'Visited Link Color', |
|
'alink' => 'Active Link Color', |
|
); |
my $start_data_table = &Apache::loncommon::start_data_table(); |
my $start_data_table = &Apache::loncommon::start_data_table(); |
my $chtable=''; |
my $chtable=''; |
foreach my $item (sort(keys(%colortypes))) { |
foreach my $item (sort(keys(%colortypes))) { |
Line 1093 sub colorschanger {
|
Line 1097 sub colorschanger {
|
'" size="10" value="'.$curcol. |
'" size="10" value="'.$curcol. |
'" /></td><td><a href="javascript:pjump('."'color_custom','".$colortypes{$item}. |
'" /></td><td><a href="javascript:pjump('."'color_custom','".$colortypes{$item}. |
"','".$curcol."','" |
"','".$curcol."','" |
.$item."','parmform.pres','psub'".');">Select</a></td>'. |
.$item."','parmform.pres','psub'".');">'.&mt('Select').'</a></td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
my $end_data_table = &Apache::loncommon::end_data_table(); |
my $end_data_table = &Apache::loncommon::end_data_table(); |
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
my $save = &mt('Save'); |
my $savebutton = &mt('Save'); |
my $rstall = &mt('Reset All'); |
my $resetbutton = &mt('Reset All'); |
my $resetdefault = &mt('Reset All Colors to Default'); |
my $resetbuttondesc = &mt('Reset All Colors to Default'); |
$r->print(<<ENDCOL); |
$r->print(<<ENDCOL); |
<script type="text/javascript" language="JavaScript"> |
<script type="text/javascript" language="JavaScript"> |
|
|
Line 1139 $start_data_table
|
Line 1143 $start_data_table
|
$chtable |
$chtable |
$end_data_table |
$end_data_table |
</table> |
</table> |
<input type="submit" value="$save" /> |
<p> |
<input type="submit" name="resetall" value="$rstall" title="$resetdefault" /> |
<input type="submit" value="$savebutton" /> |
|
<input type="submit" name="resetall" value="$resetbutton" title="$resetbuttondesc" /> |
|
</p> |
</form> |
</form> |
ENDCOL |
ENDCOL |
} |
} |
Line 1150 sub verify_and_change_colors {
|
Line 1156 sub verify_and_change_colors {
|
# figure out colors |
# figure out colors |
my $function=&Apache::loncommon::get_users_function(); |
my $function=&Apache::loncommon::get_users_function(); |
my $domain=&Apache::loncommon::determinedomain(); |
my $domain=&Apache::loncommon::determinedomain(); |
my %colortypes=('pgbg' => 'Page Background', |
my %colortypes=&Apache::lonlocal::texthash( |
'tabbg' => 'Header Background', |
'pgbg' => 'Page Background Color', |
'sidebg'=> 'Header Border', |
'tabbg' => 'Header Background Color', |
'font' => 'Font', |
'sidebg' => 'Header Border Color', |
'link' => 'Un-Visited Link', |
'font' => 'Font Color', |
'vlink' => 'Visited Link', |
'fontmenu' => 'Font Menu Color', |
'alink' => 'Active Link'); |
'link' => 'Un-Visited Link Color', |
|
'vlink' => 'Visited Link Color', |
|
'alink' => 'Active Link Color', |
|
); |
|
|
my $message=''; |
my $message=''; |
foreach my $item (keys %colortypes) { |
foreach my $item (keys %colortypes) { |
Line 1165 sub verify_and_change_colors {
|
Line 1174 sub verify_and_change_colors {
|
if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) { |
if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) { |
&Apache::lonnet::put('environment',{$entry => $color}); |
&Apache::lonnet::put('environment',{$entry => $color}); |
&Apache::lonnet::appenv({'environment.'.$entry => $color}); |
&Apache::lonnet::appenv({'environment.'.$entry => $color}); |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set '.$colortypes{$item}.' to ').'<tt>"'.$color.'"</tt>').'<br />'; |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.$colortypes{$item}.'</i>','<tt>"'.$color.'"</tt>')) |
|
.'<br />'; |
} else { |
} else { |
&Apache::lonnet::del('environment',[$entry]); |
&Apache::lonnet::del('environment',[$entry]); |
&Apache::lonnet::delenv('environment.'.$entry); |
&Apache::lonnet::delenv('environment.'.$entry); |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset '.$colortypes{$item}.'.')).'<br />'; |
$message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]','<i>'.$colortypes{$item}.'</i>')) |
|
.'<br />'; |
} |
} |
} |
} |
|
|
my $now = time; |
my $now = time; |
&Apache::lonnet::put('environment',{'color.timestamp' => $now}); |
&Apache::lonnet::put('environment',{'color.timestamp' => $now}); |
&Apache::lonnet::appenv({'environment.color.timestamp' => $now}); |
&Apache::lonnet::appenv({'environment.color.timestamp' => $now}); |
Line 1205 sub passwordchanger {
|
Line 1217 sub passwordchanger {
|
$defdom = $r->dir_config('lonDefDomain'); |
$defdom = $r->dir_config('lonDefDomain'); |
my %data = &Apache::lonnet::tmpget($mailtoken); |
my %data = &Apache::lonnet::tmpget($mailtoken); |
if (keys(%data) == 0) { |
if (keys(%data) == 0) { |
$r->print(&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a <a href="/adm/resetpw">new request</a> for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.')); |
$r->print(&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.' |
|
,'<a href="/adm/resetpw">','</a>') |
|
); |
return; |
return; |
} |
} |
if (defined($data{time})) { |
if (defined($data{time})) { |
Line 1538 ENDERROR
|
Line 1552 ENDERROR
|
} |
} |
} else { |
} else { |
# error error: run in circles, scream and shout |
# error error: run in circles, scream and shout |
$message = &mt("The password for [_1] was not changed.",$user).' '.&mt('Please make sure your old password was entered correctly.'); |
$message = &Apache::lonhtmlcommon::confirm_success( |
|
&mt("The password for [_1] was not changed.",$user).' '.&mt('Please make sure your old password was entered correctly.'),1); |
unless ($caller eq 'reset_by_email') { |
unless ($caller eq 'reset_by_email') { |
&print_main_menu($r, $message); |
&print_main_menu($r, $message); |
} |
} |
Line 2040 sub handler {
|
Line 2055 sub handler {
|
}elsif($env{'form.action'} eq 'verify_and_change_coursepage'){ |
}elsif($env{'form.action'} eq 'verify_and_change_coursepage'){ |
&verify_and_change_coursepage($r); |
&verify_and_change_coursepage($r); |
}elsif($env{'form.action'} eq 'debugtoggle'){ |
}elsif($env{'form.action'} eq 'debugtoggle'){ |
toggle_debug(); |
&toggle_debug(); |
print_main_menu($r); |
&print_main_menu($r); |
} |
} |
|
|
return OK; |
return OK; |
Line 2322 sub handler2 {
|
Line 2337 sub handler2 {
|
})); |
})); |
} |
} |
|
|
if ($env{'user.name'} =~ /^(albertel|fox|foxr|kortemey|korte|raeburn)$/) { |
if (($env{'user.name'} =~ /^(albertel|fox|foxr|kortemey|korte|raeburn)$/) |
|
&& ($env{'user.domain'} =~/^(msu|gerd)$/)){ |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
printmenu => 'yes', |
printmenu => 'yes', |
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |