version 1.183, 2006/03/06 19:21:22
|
version 1.184, 2006/03/15 19:41:26
|
Line 2541 sub adddiscuss {
|
Line 2541 sub adddiscuss {
|
} |
} |
if (($symb) && ($email)) { |
if (($symb) && ($email)) { |
if ($env{'form.editdisc'}) { |
if ($env{'form.editdisc'}) { |
my %newcontrib = (); |
|
$contrib{'ip'}=$ENV{'REMOTE_ADDR'}; |
$contrib{'ip'}=$ENV{'REMOTE_ADDR'}; |
$contrib{'host'}=$Apache::lonnet::perlvar{'lonHostID'}; |
$contrib{'host'}=$Apache::lonnet::perlvar{'lonHostID'}; |
$contrib{'timestamp'} = time; |
$contrib{'timestamp'} = time; |
Line 2584 sub adddiscuss {
|
Line 2583 sub adddiscuss {
|
} |
} |
} |
} |
$contrib{'history'} .= $oldcontrib{$oldidx.':timestamp'}; |
$contrib{'history'} .= $oldcontrib{$oldidx.':timestamp'}; |
foreach (keys %contrib) { |
|
my $key = $oldidx.':'.&Apache::lonnet::escape($oldsymb).':'.$_; |
|
$newcontrib{$key} = $contrib{$_}; |
|
} |
|
my $put_reply = &Apache::lonnet::putstore($env{'request.course.id'}, |
my $put_reply = &Apache::lonnet::putstore($env{'request.course.id'}, |
$oldsymb,$oldidx,\%contrib, |
$oldsymb,$oldidx,\%contrib, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
Line 3498 sub editing_allowed {
|
Line 3493 sub editing_allowed {
|
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my $role = (split(/\./,$env{'request.role'}))[0]; |
my $role = (split(/\./,$env{'request.role'}))[0]; |
my $section = $env{'request.course.sec'}; |
my $section = $env{'request.course.sec'}; |
my $allow_editing_config = $env{'course.'.$env{'request.course.id'}. |
my $allow_editing_config = |
'.allow_discussion_post_editing'}; |
$env{'course.'.$cid.'.allow_discussion_post_editing'}; |
if ($allow_editing_config =~ m/^\s*yes\s*$/i) { |
if ($allow_editing_config =~ m/^\s*yes\s*$/i) { |
$can_edit = 1; |
$can_edit = 1; |
} else { |
} else { |
my @editor_roles = split(/,/,$allow_editing_config); |
foreach my $editor (split(/,/,$allow_editing_config)) { |
if (@editor_roles > 0) { |
my ($editor_role,$editor_sec) = split(/:/,$editor); |
foreach my $editor (@editor_roles) { |
if ($editor_role eq $role |
my ($editor_role,$editor_sec) = split(/:/,$editor); |
&& defined($editor_sec) |
if ($editor_role eq $role) { |
&& defined($section) |
if (defined($editor_sec)) { |
&& $editor_sec eq $section) { |
if (defined($section)) { |
$can_edit = 1; |
if ($editor_sec eq $section) { |
last; |
$can_edit = 1; |
} |
last; |
if ($editor_role eq $role |
} |
&& !defined($editor_sec)) { |
} |
$can_edit = 1; |
} else { |
} |
$can_edit = 1; |
} |
last; |
|
} |
|
} |
|
} |
|
} |
|
} |
} |
return $can_edit; |
return $can_edit; |
} |
} |