version 1.462, 2006/10/10 21:57:31
|
version 1.466, 2006/10/31 22:05:53
|
Line 2067 sub getnames {
|
Line 2067 sub getnames {
|
} |
} |
} |
} |
|
|
|
sub getemails { |
|
my ($uname,$udom)=@_; |
|
if ($udom eq 'public' && $uname eq 'public') { |
|
return; |
|
} |
|
my $id=$uname.':'.$udom; |
|
my ($names,$cached)=&Apache::lonnet::is_cached_new('emailscache',$id); |
|
if ($cached) { |
|
return %{$names}; |
|
} else { |
|
my %loadnames=&Apache::lonnet::get('environment', |
|
['notification','critnotification', |
|
'permanentemail'], |
|
$udom,$uname); |
|
&Apache::lonnet::do_cache_new('emailscache',$id,\%loadnames); |
|
return %loadnames; |
|
} |
|
} |
|
|
# ------------------------------------------------------------------ Screenname |
# ------------------------------------------------------------------ Screenname |
|
|
=pod |
=pod |
Line 2596 sub submlink {
|
Line 2615 sub submlink {
|
my ($text,$uname,$udom,$symb,$target)=@_; |
my ($text,$uname,$udom,$symb,$target)=@_; |
if (!($uname && $udom)) { |
if (!($uname && $udom)) { |
(my $cursymb, my $courseid,$udom,$uname)= |
(my $cursymb, my $courseid,$udom,$uname)= |
&Apache::lonxml::whichuser($symb); |
&Apache::lonnet::whichuser($symb); |
if (!$symb) { $symb=$cursymb; } |
if (!$symb) { $symb=$cursymb; } |
} |
} |
if (!$symb) { $symb=&Apache::lonnet::symbread(); } |
if (!$symb) { $symb=&Apache::lonnet::symbread(); } |
Line 2642 sub pprmlink {
|
Line 2661 sub pprmlink {
|
my ($text,$uname,$udom,$symb,$target)=@_; |
my ($text,$uname,$udom,$symb,$target)=@_; |
if (!($uname && $udom)) { |
if (!($uname && $udom)) { |
(my $cursymb, my $courseid,$udom,$uname)= |
(my $cursymb, my $courseid,$udom,$uname)= |
&Apache::lonxml::whichuser($symb); |
&Apache::lonnet::whichuser($symb); |
if (!$symb) { $symb=$cursymb; } |
if (!$symb) { $symb=$cursymb; } |
} |
} |
if (!$symb) { $symb=&Apache::lonnet::symbread(); } |
if (!$symb) { $symb=&Apache::lonnet::symbread(); } |
Line 3388 table.LC_whatsnew tr.LC_empty_row td {
|
Line 3407 table.LC_whatsnew tr.LC_empty_row td {
|
text-align: center; |
text-align: center; |
padding: 8px; |
padding: 8px; |
} |
} |
|
table.LC_whatsnew tr.LC_empty_row td { |
|
padding: 4ex |
|
} |
|
|
|
|
table.LC_whatsnew { |
table.LC_whatsnew { |
} |
} |
Line 3728 Inputs: $title - optional title for the
|
Line 3751 Inputs: $title - optional title for the
|
bgcolor -> override the default page bgcolor |
bgcolor -> override the default page bgcolor |
no_auto_mt_title |
no_auto_mt_title |
-> prevent &mt()ing the title arg |
-> prevent &mt()ing the title arg |
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 4676 sub get_env_multiple {
|
Line 4700 sub get_env_multiple {
|
|
|
=pod |
=pod |
|
|
=back |
=back |
|
|
=head1 CSV Upload/Handling functions |
=head1 CSV Upload/Handling functions |
|
|
Line 6004 sub escape_url {
|
Line 6028 sub escape_url {
|
|
|
# -------------------------------------------------------- Initliaze user login |
# -------------------------------------------------------- Initliaze user login |
sub init_user_environment { |
sub init_user_environment { |
my ($r, $username, $domain, $authhost, $form, $extra_env) = @_; |
my ($r, $username, $domain, $authhost, $form, $args) = @_; |
my $lonids=$Apache::lonnet::perlvar{'lonIDsDir'}; |
my $lonids=$Apache::lonnet::perlvar{'lonIDsDir'}; |
|
|
my $public=($username eq 'public' && $domain eq 'public'); |
my $public=($username eq 'public' && $domain eq 'public'); |
Line 6032 sub init_user_environment {
|
Line 6056 sub init_user_environment {
|
} |
} |
if (!$cookie) { $cookie="publicuser_$oldest"; } |
if (!$cookie) { $cookie="publicuser_$oldest"; } |
} else { |
} else { |
opendir(DIR,$lonids); |
# if this isn't a robot, kill any existing non-robot sessions |
while ($filename=readdir(DIR)) { |
if (!$args->{'robot'}) { |
if ($filename=~/^$username\_\d+\_$domain\_$authhost\.id$/) { |
opendir(DIR,$lonids); |
unlink($lonids.'/'.$filename); |
while ($filename=readdir(DIR)) { |
|
if ($filename=~/^$username\_\d+\_$domain\_$authhost\.id$/) { |
|
unlink($lonids.'/'.$filename); |
|
} |
} |
} |
|
closedir(DIR); |
} |
} |
closedir(DIR); |
|
|
|
# Give them a new cookie |
# Give them a new cookie |
|
my $id = ($args->{'robot'} ? 'robot'.$args->{'robot'} |
$cookie="$username\_$now\_$domain\_$authhost"; |
: $now); |
|
$cookie="$username\_$id\_$domain\_$authhost"; |
|
|
# Initialize roles |
# Initialize roles |
|
|
Line 6136 sub init_user_environment {
|
Line 6163 sub init_user_environment {
|
&_add_to_env(\%disk_env,\%initial_env); |
&_add_to_env(\%disk_env,\%initial_env); |
&_add_to_env(\%disk_env,\%userenv,'environment.'); |
&_add_to_env(\%disk_env,\%userenv,'environment.'); |
&_add_to_env(\%disk_env,$userroles); |
&_add_to_env(\%disk_env,$userroles); |
&_add_to_env(\%disk_env,$extra_env); |
if (ref($args->{'extra_env'})) { |
|
&_add_to_env(\%disk_env,$args->{'extra_env'}); |
|
} |
untie(%disk_env); |
untie(%disk_env); |
} else { |
} else { |
&Apache::lonnet::logthis("<font color=\"blue\">WARNING: ". |
&Apache::lonnet::logthis("<font color=\"blue\">WARNING: ". |