--- loncom/interface/lonfeedback.pm 2006/03/06 19:21:22 1.183
+++ loncom/interface/lonfeedback.pm 2006/03/15 22:06:08 1.185
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.183 2006/03/06 19:21:22 www Exp $
+# $Id: lonfeedback.pm,v 1.185 2006/03/15 22:06:08 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2314,8 +2314,8 @@ sub screen_header {
' ('.&mt('name only visible to course faculty').') '.
''.&mt('Change Screenname').'';
}
- #$discussoptions.='
';
+ $discussoptions.='
';
}
if ($msgoptions) { $msgoptions='
'.&mt('Sending Messages').'
'.$msgoptions; }
if ($discussoptions) {
@@ -2541,7 +2541,6 @@ sub adddiscuss {
}
if (($symb) && ($email)) {
if ($env{'form.editdisc'}) {
- my %newcontrib = ();
$contrib{'ip'}=$ENV{'REMOTE_ADDR'};
$contrib{'host'}=$Apache::lonnet::perlvar{'lonHostID'};
$contrib{'timestamp'} = time;
@@ -2584,10 +2583,6 @@ sub adddiscuss {
}
}
$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'},
$oldsymb,$oldidx,\%contrib,
$env{'course.'.$env{'request.course.id'}.'.domain'},
@@ -3498,30 +3493,25 @@ sub editing_allowed {
my $cid = $env{'request.course.id'};
my $role = (split(/\./,$env{'request.role'}))[0];
my $section = $env{'request.course.sec'};
- my $allow_editing_config = $env{'course.'.$env{'request.course.id'}.
- '.allow_discussion_post_editing'};
+ my $allow_editing_config =
+ $env{'course.'.$cid.'.allow_discussion_post_editing'};
if ($allow_editing_config =~ m/^\s*yes\s*$/i) {
$can_edit = 1;
} else {
- my @editor_roles = split(/,/,$allow_editing_config);
- if (@editor_roles > 0) {
- foreach my $editor (@editor_roles) {
- my ($editor_role,$editor_sec) = split(/:/,$editor);
- if ($editor_role eq $role) {
- if (defined($editor_sec)) {
- if (defined($section)) {
- if ($editor_sec eq $section) {
- $can_edit = 1;
- last;
- }
- }
- } else {
- $can_edit = 1;
- last;
- }
- }
- }
- }
+ foreach my $editor (split(/,/,$allow_editing_config)) {
+ my ($editor_role,$editor_sec) = split(/:/,$editor);
+ if ($editor_role eq $role
+ && defined($editor_sec)
+ && defined($section)
+ && $editor_sec eq $section) {
+ $can_edit = 1;
+ last;
+ }
+ if ($editor_role eq $role
+ && !defined($editor_sec)) {
+ $can_edit = 1;
+ }
+ }
}
return $can_edit;
}