version 1.24, 2003/05/21 00:48:27
|
version 1.33, 2003/11/08 01:45:26
|
Line 51 use Crypt::DES;
|
Line 51 use Crypt::DES;
|
use DynaLoader; # for Crypt::DES version |
use DynaLoader; # for Crypt::DES version |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
|
use Apache::lonlocal; |
|
|
# |
# |
# Write lonnet::passwd to do the call below. |
# Write lonnet::passwd to do the call below. |
Line 101 sub des_decrypt {
|
Line 102 sub des_decrypt {
|
################################################################ |
################################################################ |
|
|
################################################################ |
################################################################ |
|
# Language Change Subroutines # |
|
################################################################ |
|
sub languagechanger { |
|
my $r = shift; |
|
my $user = $ENV{'user.name'}; |
|
my $domain = $ENV{'user.domain'}; |
|
my %userenv = &Apache::lonnet::get |
|
('environment',['languages']); |
|
my $language=$userenv{'languages'}; |
|
|
|
my $bodytag=&Apache::loncommon::bodytag( |
|
'Change Your Language Preferences'); |
|
my $pref=&mt('Preferred language'); |
|
my %langchoices=('' => 'No language preference'); |
|
foreach (&Apache::loncommon::languageids()) { |
|
if (&Apache::loncommon::supportedlanguagecode($_)) { |
|
$langchoices{&Apache::loncommon::supportedlanguagecode($_)} |
|
= &Apache::loncommon::plainlanguagedescription($_); |
|
} |
|
} |
|
my $selectionbox=&Apache::loncommon::select_form($language,'language', |
|
%langchoices); |
|
$r->print(<<ENDLSCREEN); |
|
<html> |
|
$bodytag |
|
|
|
<form name="server" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="action" value="verify_and_change_languages" /> |
|
<br />$pref: $selectionbox |
|
ENDLSCREEN |
|
$r->print('<br /><input type="submit" value="'.&mt('Change').'" /></form></body></html>'); |
|
} |
|
|
|
|
|
sub verify_and_change_languages { |
|
my $r = shift; |
|
my $user = $ENV{'user.name'}; |
|
my $domain = $ENV{'user.domain'}; |
|
# Screenname |
|
my $newlanguage = $ENV{'form.language'}; |
|
$newlanguage=~s/[^\-\w]//g; |
|
my $message=''; |
|
if ($newlanguage) { |
|
&Apache::lonnet::put('environment',{'languages' => $newlanguage}); |
|
&Apache::lonnet::appenv('environment.languages' => $newlanguage); |
|
$message='Set new preferred languages to '.$newlanguage; |
|
} else { |
|
&Apache::lonnet::del('environment',['languages']); |
|
&Apache::lonnet::delenv('environment\.languages'); |
|
$message='Reset preferred language'; |
|
} |
|
my $bodytag=&Apache::loncommon::bodytag( |
|
'Change Your Language Preferences'); |
|
$r->print(<<ENDVCSCREEN); |
|
<html> |
|
$bodytag |
|
</p> |
|
$message |
|
</body></html> |
|
ENDVCSCREEN |
|
} |
|
|
|
|
|
################################################################ |
# Anonymous Discussion Name Change Subroutines # |
# Anonymous Discussion Name Change Subroutines # |
################################################################ |
################################################################ |
sub screennamechanger { |
sub screennamechanger { |
Line 180 sub msgforwardchanger {
|
Line 245 sub msgforwardchanger {
|
my $r = shift; |
my $r = shift; |
my $user = $ENV{'user.name'}; |
my $user = $ENV{'user.name'}; |
my $domain = $ENV{'user.domain'}; |
my $domain = $ENV{'user.domain'}; |
my %userenv = &Apache::lonnet::get('environment',['msgforward']); |
my %userenv = &Apache::lonnet::get('environment',['msgforward','notification','critnotification']); |
my $msgforward=$userenv{'msgforward'}; |
my $msgforward=$userenv{'msgforward'}; |
my $notification=$userenv{'notification'}; |
my $notification=$userenv{'notification'}; |
my $critnotification=$userenv{'critnotification'}; |
my $critnotification=$userenv{'critnotification'}; |
my $bodytag=&Apache::loncommon::bodytag( |
my $bodytag=&Apache::loncommon::bodytag( |
'Change Your Message Forwarding and Notification'); |
'Change Your Message Forwarding and Notification'); |
|
my $forwardingHelp = Apache::loncommon::help_open_topic("Prefs_Forwarding", |
|
"What are forwarding ". |
|
"and notification ". |
|
"addresses"); |
|
my $criticalMessageHelp = Apache::loncommon::help_open_topic("Course_Critical_Message", |
|
"What are critical messages"); |
|
|
$r->print(<<ENDMSG); |
$r->print(<<ENDMSG); |
<html> |
<html> |
$bodytag |
$bodytag |
|
$forwardingHelp <br /> |
<form name="server" action="/adm/preferences" method="post"> |
<form name="server" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_msgforward" /> |
<input type="hidden" name="action" value="verify_and_change_msgforward" /> |
New Forwarding Address(es) (<tt>user:domain,user:domain,...</tt>): |
New Forwarding Address(es) (<tt>user:domain,user:domain,...</tt>): |
Line 197 New Forwarding Address(es) (<tt>user:dom
|
Line 269 New Forwarding Address(es) (<tt>user:dom
|
New Message Notification Email Address(es) (<tt>joe\@doe.com,jane\@doe.edu,...</tt>): |
New Message Notification Email Address(es) (<tt>joe\@doe.com,jane\@doe.edu,...</tt>): |
<input type="text" size="40" value="$notification" name="notification" /><hr /> |
<input type="text" size="40" value="$notification" name="notification" /><hr /> |
New Critical Message Notification Email Address(es) (<tt>joe\@doe.com,jane\@doe.edu,...</tt>): |
New Critical Message Notification Email Address(es) (<tt>joe\@doe.com,jane\@doe.edu,...</tt>): |
<input type="text" size="40" value="$critnotification" name="critnotification" /><hr /> |
<input type="text" size="40" value="$critnotification" name="critnotification" />$criticalMessageHelp<hr /> |
<input type="submit" value="Change" /> |
<input type="submit" value="Change" /> |
</form> |
</form> |
</body> |
</body> |
Line 628 sub handler {
|
Line 700 sub handler {
|
my $r = shift; |
my $r = shift; |
my $user = $ENV{'user.name'}; |
my $user = $ENV{'user.name'}; |
my $domain = $ENV{'user.domain'}; |
my $domain = $ENV{'user.domain'}; |
$r->content_type('text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
# Some pages contain DES keys and should not be cached. |
# Some pages contain DES keys and should not be cached. |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
Line 650 sub handler {
|
Line 722 sub handler {
|
&colorschanger($r); |
&colorschanger($r); |
} elsif ($ENV{'form.action'} eq 'verify_and_change_colors') { |
} elsif ($ENV{'form.action'} eq 'verify_and_change_colors') { |
&verify_and_change_colors($r); |
&verify_and_change_colors($r); |
|
} elsif ($ENV{'form.action'} eq 'changelanguages') { |
|
&languagechanger($r); |
|
} elsif ($ENV{'form.action'} eq 'verify_and_change_languages') { |
|
&verify_and_change_languages($r); |
} elsif ($ENV{'form.action'} eq 'debugtoggle') { |
} elsif ($ENV{'form.action'} eq 'debugtoggle') { |
if (($ENV{'user.name'} eq 'albertel' ) || |
if (($ENV{'user.name'} eq 'albertel' ) || |
($ENV{'user.name'} eq 'kortemey' ) || |
($ENV{'user.name'} eq 'kortemey' ) || |
Line 708 ENDABOUTME
|
Line 784 ENDABOUTME
|
</form> |
</form> |
ENDCOLORFORM |
ENDCOLORFORM |
|
|
|
$r->print(<<ENDLANGUAGES); |
|
<form name="client" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="action" value="changelanguages" /> |
|
<input type="submit" value="Change language preferences" /> |
|
</form> |
|
ENDLANGUAGES |
|
|
if (($ENV{'user.name'} eq 'albertel' ) || |
if (($ENV{'user.name'} eq 'albertel' ) || |
($ENV{'user.name'} eq 'kortemey' ) || |
($ENV{'user.name'} eq 'kortemey' ) || |
($ENV{'user.name'} eq 'korte')) { |
($ENV{'user.name'} eq 'korte')) { |