version 1.49, 2004/11/02 00:17:24
|
version 1.52, 2005/01/20 21:32:55
|
Line 177 $message
|
Line 177 $message
|
ENDVCSCREEN |
ENDVCSCREEN |
} |
} |
|
|
|
################################################################ |
|
# Roles Page Preference Change Subroutines # |
|
################################################################ |
|
sub rolesprefchanger { |
|
my $r = shift; |
|
my $user = $ENV{'user.name'}; |
|
my $domain = $ENV{'user.domain'}; |
|
my %userenv = &Apache::lonnet::get |
|
('environment',['recentroles','recentrolesn']); |
|
my $hotlist_flag=$userenv{'recentroles'}; |
|
my $hotlist_n=$userenv{'recentrolesn'}; |
|
my $checked; |
|
if ($hotlist_flag) { |
|
$checked = 'checked="checked"'; |
|
} |
|
|
|
if (!$hotlist_n) { $hotlist_n=3; } |
|
my $options; |
|
for (my $i=1; $i<10; $i++) { |
|
my $select; |
|
if ($hotlist_n == $i) { $select = 'selected="selected"'; } |
|
$options .= "<option $select>$i</option>\n"; |
|
} |
|
|
|
$r->print(<<ENDSCREEN); |
|
<p>Some LON-CAPA users have a long list of roles. The Recent Roles Hotlist |
|
feature keeps track of the last N roles which have been |
|
visited and places a table of these at the top of the roles page. |
|
People with very few roles should leave this feature disabled. |
|
</p> |
|
|
|
<form name="server" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="action" value="verify_and_change_rolespref" /> |
|
<br />Enable Recent Roles Hotlist: |
|
<input type="checkbox" $checked name="recentroles" value="true" /> |
|
<br />Number of roles in Hotlist: |
|
<select name="recentrolesn" size="1"> |
|
$options |
|
</select> |
|
<br /> |
|
<input type="submit" value="Change" /> |
|
</form> |
|
ENDSCREEN |
|
} |
|
|
|
sub verify_and_change_rolespref { |
|
my $r = shift; |
|
my $user = $ENV{'user.name'}; |
|
my $domain = $ENV{'user.domain'}; |
|
# Recent Roles Hotlist Flag |
|
my $hotlist_flag = $ENV{'form.recentroles'}; |
|
my $hotlist_n = $ENV{'form.recentrolesn'}; |
|
my $message=''; |
|
if ($hotlist_flag) { |
|
&Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag}); |
|
&Apache::lonnet::appenv('environment.recentroles' => $hotlist_flag); |
|
$message='Recent Roles Hotlist is Enabled'; |
|
} else { |
|
&Apache::lonnet::del('environment',['recentroles']); |
|
&Apache::lonnet::delenv('environment\.recentroles'); |
|
$message='Recent Roles Hotlist is Disabled'; |
|
} |
|
if ($hotlist_n) { |
|
&Apache::lonnet::put('environment',{'recentrolesn' => $hotlist_n}); |
|
&Apache::lonnet::appenv('environment.recentrolesn' => $hotlist_n); |
|
if ($hotlist_flag) { |
|
$message.="<br />Display $hotlist_n Most Recent Roles\n"; |
|
} |
|
} |
|
|
|
$r->print(<<ENDRPSCREEN); |
|
</p> |
|
$message |
|
ENDRPSCREEN |
|
} |
|
|
|
|
|
|
################################################################ |
################################################################ |
# Anonymous Discussion Name Change Subroutines # |
# Anonymous Discussion Name Change Subroutines # |
Line 504 sub passwordchanger {
|
Line 581 sub passwordchanger {
|
lextkey=this.document.client.elements.lkey_cpass.value; |
lextkey=this.document.client.elements.lkey_cpass.value; |
initkeys(); |
initkeys(); |
|
|
this.document.server.elements.currentpass.value |
this.document.pserver.elements.currentpass.value |
=crypted(this.document.client.elements.currentpass.value); |
=crypted(this.document.client.elements.currentpass.value); |
|
|
uextkey=this.document.client.elements.ukey_npass1.value; |
uextkey=this.document.client.elements.ukey_npass1.value; |
lextkey=this.document.client.elements.lkey_npass1.value; |
lextkey=this.document.client.elements.lkey_npass1.value; |
initkeys(); |
initkeys(); |
this.document.server.elements.newpass_1.value |
this.document.pserver.elements.newpass_1.value |
=crypted(this.document.client.elements.newpass_1.value); |
=crypted(this.document.client.elements.newpass_1.value); |
|
|
uextkey=this.document.client.elements.ukey_npass2.value; |
uextkey=this.document.client.elements.ukey_npass2.value; |
lextkey=this.document.client.elements.lkey_npass2.value; |
lextkey=this.document.client.elements.lkey_npass2.value; |
initkeys(); |
initkeys(); |
this.document.server.elements.newpass_2.value |
this.document.pserver.elements.newpass_2.value |
=crypted(this.document.client.elements.newpass_2.value); |
=crypted(this.document.client.elements.newpass_2.value); |
|
|
this.document.server.submit(); |
this.document.pserver.submit(); |
} |
} |
|
|
</script> |
</script> |
Line 530 $errormessage
|
Line 607 $errormessage
|
ensure that unencrypted passwords will not be sent out by a |
ensure that unencrypted passwords will not be sent out by a |
crappy browser --> |
crappy browser --> |
|
|
<form name="server" action="/adm/preferences" method="post"> |
<form name="pserver" action="/adm/preferences" method="post"> |
<input type="hidden" name="logtoken" value="$logtoken" /> |
<input type="hidden" name="logtoken" value="$logtoken" /> |
<input type="hidden" name="action" value="verify_and_change_pass" /> |
<input type="hidden" name="action" value="verify_and_change_pass" /> |
<input type="hidden" name="currentpass" value="" /> |
<input type="hidden" name="currentpass" value="" /> |
Line 953 sub handler {
|
Line 1030 sub handler {
|
subroutine => \&verify_and_change_discussion, } |
subroutine => \&verify_and_change_discussion, } |
)); |
)); |
|
|
if ($ENV{'user.name'} =~ /^(albertel|koretemey|korte|hallmat3|turtle)$/) { |
push (@Options,({ action => 'changerolespref', |
|
linktext => 'Change Roles Page Preferences', |
|
href => '/adm/preferences', |
|
subroutine => \&rolesprefchanger, |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changerolespref', |
|
text => 'Change Roles Pref'}, |
|
}, |
|
{ action => 'verify_and_change_rolespref', |
|
subroutine => \&verify_and_change_rolespref, |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changerolespref', |
|
text => 'Change Roles Preferences'}, |
|
printmenu => 'yes', |
|
})); |
|
|
|
|
|
if ($ENV{'user.name'} =~ /^(albertel|fox|foxr|koretemey|korte|hallmat3|turtle)$/) { |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
printmenu => 'yes', |
printmenu => 'yes', |
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |
Line 988 ENDHEADER
|
Line 1082 ENDHEADER
|
if (($printmenu eq 'yes') && (!$ENV{'form.returnurl'})) { |
if (($printmenu eq 'yes') && (!$ENV{'form.returnurl'})) { |
my $optionlist = '<table cellpadding="5">'; |
my $optionlist = '<table cellpadding="5">'; |
if ($ENV{'user.name'} =~ |
if ($ENV{'user.name'} =~ |
/^(albertel|kortemey|korte|hallmat3|turtle)$/ |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle)$/ |
) { |
) { |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
linktext => 'Toggle Debug Messages', |
linktext => 'Toggle Debug Messages', |