version 1.349, 2004/12/03 22:14:22
|
version 1.350, 2004/12/09 23:45:59
|
Line 1596 sub whichuser {
|
Line 1596 sub whichuser {
|
my ($passedsymb)=@_; |
my ($passedsymb)=@_; |
my ($symb,$courseid,$domain,$name,$publicuser); |
my ($symb,$courseid,$domain,$name,$publicuser); |
if (defined($ENV{'form.grade_symb'})) { |
if (defined($ENV{'form.grade_symb'})) { |
my $tmp_courseid=$ENV{'form.grade_courseid'}; |
my ($tmp_courseid)= |
my $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid); |
&Apache::loncommon::get_env_multiple('form.grade_courseid'); |
if (!$allowed && |
my $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid); |
exists($ENV{'request.course.sec'}) && |
if (!$allowed && |
$ENV{'request.course.sec'} !~ /^\s*$/) { |
exists($ENV{'request.course.sec'}) && |
$allowed=&Apache::lonnet::allowed('vgr',$ENV{'form.grade_courseid'}. |
$ENV{'request.course.sec'} !~ /^\s*$/) { |
'/'.$ENV{'request.course.sec'}); |
$allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid. |
} |
'/'.$ENV{'request.course.sec'}); |
if ($allowed) { |
} |
$symb=$ENV{'form.grade_symb'}; |
if ($allowed) { |
$courseid=$ENV{'form.grade_courseid'}; |
($symb)=&Apache::loncommon::get_env_multiple('form.grade_symb'); |
$domain=$ENV{'form.grade_domain'}; |
$courseid=$tmp_courseid; |
$name=$ENV{'form.grade_username'}; |
($domain)=&Apache::loncommon::get_env_multiple('form.grade_domain'); |
} |
($name)=&Apache::loncommon::get_env_multiple('form.grade_username'); |
} else { |
return ($symb,$courseid,$domain,$name,$publicuser); |
if (!$passedsymb) { |
|
$symb=&Apache::lonnet::symbread(); |
|
} else { |
|
$symb=$passedsymb; |
|
} |
} |
$courseid=$ENV{'request.course.id'}; |
} |
$domain=$ENV{'user.domain'}; |
if (!$passedsymb) { |
$name=$ENV{'user.name'}; |
$symb=&Apache::lonnet::symbread(); |
if ($name eq 'public' && $domain eq 'public') { |
} else { |
if (!defined($ENV{'form.username'})) { |
$symb=$passedsymb; |
$ENV{'form.username'}.=time.rand(10000000); |
} |
} |
$courseid=$ENV{'request.course.id'}; |
$name.=$ENV{'form.username'}; |
$domain=$ENV{'user.domain'}; |
|
$name=$ENV{'user.name'}; |
|
if ($name eq 'public' && $domain eq 'public') { |
|
if (!defined($ENV{'form.username'})) { |
|
$ENV{'form.username'}.=time.rand(10000000); |
} |
} |
|
$name.=$ENV{'form.username'}; |
} |
} |
return ($symb,$courseid,$domain,$name,$publicuser); |
return ($symb,$courseid,$domain,$name,$publicuser); |
} |
} |