version 1.49, 2006/03/07 16:15:48
|
version 1.52, 2006/03/15 19:41:26
|
Line 54 sub fail {
|
Line 54 sub fail {
|
|
|
sub start_page { |
sub start_page { |
my ($r,$title)=@_; |
my ($r,$title)=@_; |
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(&Apache::loncommon::start_page($title)); |
$r->print($html.'<head><title>'.&mt($title).'</title></head>'); |
|
$r->print(&Apache::loncommon::bodytag($title)); |
|
} |
} |
|
|
sub end_page { |
sub end_page { |
my ($r)=@_; |
my ($r)=@_; |
$r->print(&Apache::loncommon::endbodytag().'</html>'); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
=pod |
=pod |
Line 550 sub allowed_slot {
|
Line 548 sub allowed_slot {
|
} |
} |
&Apache::lonxml::debug("$slot_name type good"); |
&Apache::lonxml::debug("$slot_name type good"); |
|
|
|
my $userallowed=0; |
# its for a different set of users |
# its for a different set of users |
if (defined($slot->{'allowedsection'})) { |
if (defined($slot->{'allowedsections'})) { |
|
if (!defined($env{'request.role.sec'}) |
return 0; |
&& grep(/^No section assigned$/, |
|
split(',',$slot->{'allowedsections'}))) { |
|
$userallowed=1; |
|
} |
|
if (defined($env{'request.role.sec'}) |
|
&& grep(/^\Q$env{'request.role.sec'}\E$/, |
|
split(',',$slot->{'allowedsections'}))) { |
|
$userallowed=1; |
|
} |
} |
} |
&Apache::lonxml::debug("$slot_name type good"); |
&Apache::lonxml::debug("$slot_name sections is $userallowed"); |
|
|
# its for a different set of users |
# its for a different set of users |
if (defined($slot->{'allowedusers'})) { |
if (defined($slot->{'allowedusers'}) |
|
&& grep(/^\Q$env{'user.name'}:$env{'user.domain'}\E$/, |
return 0; |
split(',',$slot->{'allowedusers'}))) { |
|
$userallowed=1; |
|
} |
|
|
|
if (!defined($slot->{'allowedusers'}) |
|
&& !defined($slot->{'allowedsections'})) { |
|
$userallowed=1; |
} |
} |
&Apache::lonxml::debug("$slot_name type good"); |
|
|
&Apache::lonxml::debug("$slot_name user is $userallowed"); |
|
return 0 if (!$userallowed); |
|
|
# not allowed for this resource |
# not allowed for this resource |
if (defined($slot->{'symb'}) |
if (defined($slot->{'symb'}) |
&& $slot->{'symb'} ne $symb) { |
&& $slot->{'symb'} ne $symb) { |
return 0; |
return 0; |
} |
} |
|
|
my $conflict = &check_for_conflict($symb,$slot_name,$slot,$slots, |
my $conflict = &check_for_conflict($symb,$slot_name,$slot,$slots, |
$consumed_uniqueperiods); |
$consumed_uniqueperiods); |
if ($conflict) { |
if ($conflict) { |