version 1.40, 2009/03/09 01:58:52
|
version 1.42, 2009/10/31 17:55:01
|
Line 92 sub update_LC {
|
Line 92 sub update_LC {
|
open(FILE,"<$$configvars{'lonTabDir'}.'/rolesplain.tab"); |
open(FILE,"<$$configvars{'lonTabDir'}.'/rolesplain.tab"); |
my @rolesplain = <FILE>; |
my @rolesplain = <FILE>; |
close(FILE); |
close(FILE); |
foreach (@rolesplain) { |
foreach my $item (@rolesplain) { |
if ($_ =~ /^(st|ta|ex|ad|in|cc):([\w\s]+)$/) { |
if ($_ =~ /^(st|ta|ex|ad|in|cc|co):([\w\s]+):?([\w\s]*)/) { |
$longroles{$1} = $2; |
if ($courseinfo{'type'} eq 'Community') { |
|
unless($1 eq 'cc') { |
|
$longroles{$1} = $3; |
|
} |
|
} else { |
|
unless($1 eq 'co') { |
|
$longroles{$1} = $2; |
|
} |
|
} |
} |
} |
} |
} |
|
|
Line 540 sub create_newuser {
|
Line 548 sub create_newuser {
|
} else { |
} else { |
my $subject = &mt('New LON-CAPA account'); |
my $subject = &mt('New LON-CAPA account'); |
my $body; |
my $body; |
|
my $portalurl = 'http://'.$ENV{'SERVER_NAME'}; |
|
my $protocol = 'http'; |
|
my $lonhost=&Apache::lonnet::domain($udom,'primary'); |
|
if ($lonhost ne '') { |
|
my $ip = &Apache::lonnet::get_host_ip($lonhost); |
|
if ($Apache::lonnet::protocol{$lonhost} eq 'https') { |
|
$protocol = 'https'; |
|
} |
|
if ($ip ne '') { |
|
$portalurl = $protocol.'://'.$ip |
|
} |
|
} |
if ($context eq 'createowner') { |
if ($context eq 'createowner') { |
$body = &mt('A user account has been created for you while creating your new course in the LON-CAPA course management and online homework system.')."\n\n".&mt('You should log-in to the system using the following credentials:')."\n".&mt('username: ').$uname."\n".&mt('password: ').$authparam."\n\n".&mt('The URL you should use to access the LON-CAPA system at your school is: ').'http://'.$ENV{'SERVER_NAME'}."\n\n"; |
$body = &mt('A user account has been created for you while creating your new course in the LON-CAPA course management and online homework system.')."\n\n".&mt('You should log-in to the system using the following credentials:')."\n".&mt('username: ').$uname."\n".&mt('password: ').$authparam."\n\n".&mt('The URL you should use to access the LON-CAPA system at your institution is: ').$portalurl."\n\n"; |
} elsif ($context eq 'createcourse') { |
} elsif ($context eq 'createcourse') { |
$body = &mt('You have been assigned the role of [_1] in a new course: [_2] - [_3] in the LON-CAPA course management and online homework system.',$$longroles{$role},$$courseinfo{'description'},$$courseinfo{'inst_code'}).' '.&mt('As you did not have an existing user account in the system, one has been created for you.')."\n\n".&mt("You should log-in to the system using the following credentials:\nusername: [_1]\npassword: [_2]",$uname,$authparam)."\n\n".&mt('The URL you should use to access the LON-CAPA system at your school is: '),'http://'.$ENV{'SERVER_NAME'}."\n\n"; |
$body = &mt('You have been assigned the role of [_1] in a new course: [_2] - [_3] in the LON-CAPA course management and online homework system.',$$longroles{$role},$$courseinfo{'description'},$$courseinfo{'inst_code'}).' '.&mt('As you did not have an existing user account in the system, one has been created for you.')."\n\n".&mt("You should log-in to the system using the following credentials:\nusername: [_1]\npassword: [_2]",$uname,$authparam)."\n\n".&mt('The URL you should use to access the LON-CAPA system at your institution is: ').$portalurl."\n\n"; |
} else { |
} else { |
my $access_start = 'immediately'; |
my $access_start = 'immediately'; |
if ($start > 0) { |
if ($start > 0) { |
$access_start = localtime($start) |
$access_start = localtime($start) |
} |
} |
$body = &mt('You have been enrolled in the LON-CAPA system at your school, because you are a registered student in a class that is using the LON-CAPA couse management and online homework system.')."\n\n".&mt("You should log-in to the system using the following credentials:\nusername: [_1]\npassword: [_2]",$uname,$authparam)."\n\n".&mt('The URL you should use to access the LON-CAPA system at your school is: ').'http://'.$ENV{'SERVER_NAME'}."\n\n".&mt('When you log-in you will be able to access the LON-CAPA course for [_1] - [_2] starting [_3].',$$courseinfo{'description'},$$courseinfo{'inst_code'},$access_start)."\n"; |
$body = &mt('You have been enrolled in the LON-CAPA system at your institution, because you are a registered student in a class which is using the LON-CAPA couse management and online homework system.')."\n\n".&mt("You should log-in to the system using the following credentials:\nusername: [_1]\npassword: [_2]",$uname,$authparam)."\n\n".&mt('The URL you should use to access the LON-CAPA system at your institution is: ').$portalurl."\n\n".&mt('When you log-in you will be able to access the LON-CAPA course for [_1] - [_2] starting [_3].',$$courseinfo{'description'},$$courseinfo{'inst_code'},$access_start)."\n"; |
} |
} |
&Apache::lonmsg::sendemail($emailaddr,$subject,$body); |
&Apache::lonmsg::sendemail($emailaddr,$subject,$body); |
} |
} |
Line 621 sub execute_add {
|
Line 641 sub execute_add {
|
# Get the user's e-mail address |
# Get the user's e-mail address |
if ($userenv{critnotification} =~ m/%40/) { |
if ($userenv{critnotification} =~ m/%40/) { |
unless ($emailenc eq $userenv{critnotification}) { |
unless ($emailenc eq $userenv{critnotification}) { |
$$logmsg .= &mt('Current critical notification e-mail |
$$logmsg .= &mt('Current critical notification e-mail - [_1] for [_2] is different to e-mail address in institutional classlist - [_3].', |
- [_1] for [_2] is different to e-mail address in institutional classlist - [_3].',$userenv{critnotification},$uname,$emailenc).$linefeed; |
$userenv{critnotification},$uname,$emailenc). |
|
$linefeed; |
} |
} |
} |
} |
if ($userenv{notification} =~ m/%40/) { |
if ($userenv{notification} =~ m/%40/) { |
unless ($emailenc eq $userenv{notification}) { |
unless ($emailenc eq $userenv{notification}) { |
$$logmsg .= &mt('Current standard notification e-mail |
$$logmsg .= &mt('Current standard notification e-mail - [_1] for [_2] is different to e-mail address in institutional classlist - [_3].', |
- [_1] for [_2] is different to e-mail address in institutional classlist - [_3]',$userenv{notification},$uname,$emailenc).$linefeed; |
$userenv{notification},$uname,$emailenc). |
|
$linefeed; |
} |
} |
} |
} |
if ($userenv{permanentemail} =~ m/%40/) { |
if ($userenv{permanentemail} =~ m/%40/) { |