version 1.73, 2006/01/06 19:05:30
|
version 1.76, 2006/03/15 22:11:04
|
Line 659 sub passwordchanger {
|
Line 659 sub passwordchanger {
|
$lkey_npass2= hex($lkey_npass2); |
$lkey_npass2= hex($lkey_npass2); |
# Output javascript to deal with passwords |
# Output javascript to deal with passwords |
# Output DES javascript |
# Output DES javascript |
my $html=&Apache::lonxml::xmlbegin(); |
|
$r->print($html."<head>"); |
|
{ |
{ |
my $include = $r->dir_config('lonIncludes'); |
my $include = $r->dir_config('lonIncludes'); |
my $jsh=Apache::File->new($include."/londes.js"); |
my $jsh=Apache::File->new($include."/londes.js"); |
Line 741 sub verify_and_change_password {
|
Line 739 sub verify_and_change_password {
|
# Check for authentication types that allow changing of the password. |
# Check for authentication types that allow changing of the password. |
return if ($currentauth !~ /^(unix|internal):/); |
return if ($currentauth !~ /^(unix|internal):/); |
# |
# |
my $html=&Apache::lonxml::xmlbegin(); |
|
$r->print(<<ENDHEADER); |
|
$html |
|
<head> |
|
<title>LON-CAPA Preferences: Change password for $user</title> |
|
</head> |
|
ENDHEADER |
|
# |
|
my $currentpass = $env{'form.currentpass'}; |
my $currentpass = $env{'form.currentpass'}; |
my $newpass1 = $env{'form.newpass_1'}; |
my $newpass1 = $env{'form.newpass_1'}; |
my $newpass2 = $env{'form.newpass_2'}; |
my $newpass2 = $env{'form.newpass_2'}; |
Line 773 password decryption. Please log out and
|
Line 763 password decryption. Please log out and
|
</p> |
</p> |
ENDERROR |
ENDERROR |
# Probably should log an error here |
# Probably should log an error here |
return; |
return 1; |
} |
} |
my ($ckey,$n1key,$n2key)=split(/&/,$tmpinfo); |
my ($ckey,$n1key,$n2key)=split(/&/,$tmpinfo); |
# |
# |
Line 786 ENDERROR
|
Line 776 ENDERROR
|
'<font color="#ff0000">ERROR:</font>'. |
'<font color="#ff0000">ERROR:</font>'. |
'The new passwords you entered do not match. '. |
'The new passwords you entered do not match. '. |
'Please try again.'); |
'Please try again.'); |
return; |
return 1; |
} |
} |
if (length($newpass1) < 7) { |
if (length($newpass1) < 7) { |
&passwordchanger($r, |
&passwordchanger($r, |
'<font color="#ff0000">ERROR:</font>'. |
'<font color="#ff0000">ERROR:</font>'. |
'Passwords must be a minimum of 7 characters long. '. |
'Passwords must be a minimum of 7 characters long. '. |
'Please try again.'); |
'Please try again.'); |
return; |
return 1; |
} |
} |
# |
# |
# Check for bad characters |
# Check for bad characters |
Line 828 ENDTEXT
|
Line 818 ENDTEXT
|
<h2><font color="#ff0000">The password for $user was not changed</font></h2> |
<h2><font color="#ff0000">The password for $user was not changed</font></h2> |
Please make sure your old password was entered correctly. |
Please make sure your old password was entered correctly. |
ENDERROR |
ENDERROR |
|
return 1; |
} |
} |
return; |
return; |
} |
} |
Line 1096 sub handler {
|
Line 1087 sub handler {
|
breadcrumb => |
breadcrumb => |
{ href =>'/adm/preferences?action=changepass', |
{ href =>'/adm/preferences?action=changepass', |
text => 'Change Password'}, |
text => 'Change Password'}, |
printmenu => 'yes', |
printmenu => 'not_on_error', |
})); |
})); |
} |
} |
push (@Options,({ action => 'changescreenname', |
push (@Options,({ action => 'changescreenname', |
Line 1233 sub handler {
|
Line 1224 sub handler {
|
text => 'Change Math Preferences'}, |
text => 'Change Math Preferences'}, |
printmenu => 'yes', |
printmenu => 'yes', |
})); |
})); |
if ($env{'user.adv'}) { |
if (&Apache::lonnet::allowed('whn',$env{'request.course.id'}) |
|
|| &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' |
|
.$env{'request.course.sec'})) { |
push (@Options,({ action => 'changecourseinit', |
push (@Options,({ action => 'changecourseinit', |
linktext => 'Change Course Initialization Preference', |
linktext => 'Change Course Initialization Preference', |
href => '/adm/preferences', |
href => '/adm/preferences', |
Line 1256 sub handler {
|
Line 1249 sub handler {
|
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |
})); |
})); |
} |
} |
my $html=&Apache::lonxml::xmlbegin(); |
|
$r->print(<<ENDHEADER); |
$r->print(&Apache::loncommon::start_page('Change Preferences')); |
$html |
|
<head> |
|
<title>LON-CAPA Preferences</title> |
|
</head> |
|
ENDHEADER |
|
my $call = undef; |
my $call = undef; |
my $help = undef; |
my $help = undef; |
my $printmenu = 'yes'; |
my $printmenu = 'yes'; |
Line 1277 ENDHEADER
|
Line 1266 ENDHEADER
|
$help=$option->{'help'}; |
$help=$option->{'help'}; |
} |
} |
} |
} |
$r->print(&Apache::loncommon::bodytag('Change Preferences')); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
(undef,'Change Preferences',$help)); |
(undef,'Change Preferences',$help)); |
|
my $error; |
if (defined($call)) { |
if (defined($call)) { |
$call->($r); |
$error = $call->($r); |
} |
} |
if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) { |
if ( ( ($printmenu eq 'yes') |
|
|| ($printmenu eq 'not_on_error' && !$error) ) |
|
&& (!$env{'form.returnurl'})) { |
my $optionlist = '<table cellpadding="5">'; |
my $optionlist = '<table cellpadding="5">'; |
if ($env{'user.name'} =~ |
if ($env{'user.name'} =~ |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/ |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/ |
Line 1327 ENDHEADER
|
Line 1318 ENDHEADER
|
$r->print('<br /><a href="'.$env{'form.returnurl'}.'"><font size="+1">'. |
$r->print('<br /><a href="'.$env{'form.returnurl'}.'"><font size="+1">'. |
&mt('Return').'</font></a>'); |
&mt('Return').'</font></a>'); |
} |
} |
$r->print(&Apache::loncommon::endbodytag().'</html>'); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|