[LON-CAPA-cvs] cvs: loncom /interface lonpreferences.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Mon, 19 Aug 2002 13:10:56 -0000
matthew Mon Aug 19 09:10:56 2002 EDT
Modified files:
/loncom/interface lonpreferences.pm
Log:
&screennamechanger and &verify_and_change_screenname removed a few unused
variables.
Minor cleanups to password changing verbage.
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.8 loncom/interface/lonpreferences.pm:1.9
--- loncom/interface/lonpreferences.pm:1.8 Tue Apr 30 10:03:52 2002
+++ loncom/interface/lonpreferences.pm Mon Aug 19 09:10:55 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.8 2002/04/30 14:03:52 matthew Exp $
+# $Id: lonpreferences.pm,v 1.9 2002/08/19 13:10:55 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -98,13 +98,14 @@
################################################################
# Handler subroutines #
################################################################
+
+################################################################
+# Anonymous Discussion Name Change Subroutines #
+################################################################
sub screennamechanger {
my $r = shift;
- my $errormessage = shift;
- $errormessage = ($errormessage || '');
my $user = $ENV{'user.name'};
my $domain = $ENV{'user.domain'};
- my $homeserver = $ENV{'user.home'};
my %userenv = &Apache::lonnet::get('environment',['screenname']);
my $screenname=$userenv{'screenname'};
$r->print(<<ENDSCREEN);
@@ -112,11 +113,9 @@
<body bgcolor="#FFFFFF">
<h1>Preferences for $user</h1>
<h3>$user is a member of domain $domain</h3>
-$errormessage
<p>
Change anonymous discussion screen name for $user
</p>
-
<form name="server" action="/adm/preferences" method="post">
<input type="hidden" name="action" value="verify_and_change_screenname" />
New screenname:
@@ -132,7 +131,6 @@
my $r = shift;
my $user = $ENV{'user.name'};
my $domain = $ENV{'user.domain'};
- my $homeserver = $ENV{'user.home'};
my $newscreen = $ENV{'form.screenname'};
$newscreen=~s/\W//g;
my $message='';
@@ -194,13 +192,14 @@
$lkey_npass2= hex($lkey_npass2);
# Output javascript to deal with passwords
# Output DES javascript
+ $r->print("<html><head>");
{
my $include = $r->dir_config('lonIncludes');
my $jsh=Apache::File->new($include."/londes.js");
$r->print(<$jsh>);
}
$r->print(<<ENDFORM);
-
+</head>
<body bgcolor="#FFFFFF" onLoad="init();">
<script language="JavaScript">
@@ -359,12 +358,12 @@
# Inform the user the password has (not?) been changed
if ($result =~ /^ok$/) {
$r->print(<<"ENDTEXT");
-<h2>Password for $user was successfully changed</h2>
+<h2>The password for $user was successfully changed</h2>
ENDTEXT
} else {
# error error: run in circles, scream and shout
$r->print(<<ENDERROR);
-<h2><font color="#ff0000">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.
ENDERROR
}
@@ -375,7 +374,6 @@
# other handler subroutines #
######################################################
-
################################################################
# Main handler #
################################################################
@@ -388,7 +386,7 @@
&Apache::loncommon::no_cache($r);
$r->send_http_header;
return OK if $r->header_only;
- # Spit out the header
+ #
if ($ENV{'form.action'} eq 'changepass') {
&passwordchanger($r);
} elsif ($ENV{'form.action'} eq 'verify_and_change_pass') {