Fixed a problem where visitors could post.
This commit is contained in:
parent
1c39a556d6
commit
68b4baeb7e
2 changed files with 18 additions and 6 deletions
|
|
@ -203,9 +203,13 @@ sub www_view {
|
||||||
$html .= $_[0]->description;
|
$html .= $_[0]->description;
|
||||||
$html = $_[0]->processMacros($html);
|
$html = $_[0]->processMacros($html);
|
||||||
$html .= '<table width="100%" cellpadding=2 cellspacing=1 border=0><tr>'.
|
$html .= '<table width="100%" cellpadding=2 cellspacing=1 border=0><tr>'.
|
||||||
'<td align="right" valign="bottom" class="tableMenu"><a href="'.
|
'<td align="right" valign="bottom" class="tableMenu">';
|
||||||
|
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"))) {
|
||||||
|
$html .= '<a href="'.
|
||||||
WebGUI::URL::page('func=post&mid=new&wid='.$_[0]->get("wobjectId")).'">'.
|
WebGUI::URL::page('func=post&mid=new&wid='.$_[0]->get("wobjectId")).'">'.
|
||||||
WebGUI::International::get(17,$namespace).'</a> · <a href="'.WebGUI::URL::page('func=search&wid='.$_[0]->get("wobjectId")).'">'
|
WebGUI::International::get(17,$namespace).'</a> · ';
|
||||||
|
}
|
||||||
|
$html .= '<a href="'.WebGUI::URL::page('func=search&wid='.$_[0]->get("wobjectId")).'">'
|
||||||
.WebGUI::International::get(364).'</a></td></tr></table>';
|
.WebGUI::International::get(364).'</a></td></tr></table>';
|
||||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||||
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td>
|
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td>
|
||||||
|
|
|
||||||
|
|
@ -128,8 +128,12 @@ sub _traditionalView {
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
$output .= '<table width="100%" cellpadding=2 cellspacing=1 border=0><tr>'.
|
$output .= '<table width="100%" cellpadding=2 cellspacing=1 border=0><tr>'.
|
||||||
'<td align="right" class="tableMenu"><a href="'.WebGUI::URL::page('func=editSubmission&sid=new&wid='.
|
'<td align="right" class="tableMenu">';
|
||||||
$_[0]->get("wobjectId")).'">'.WebGUI::International::get(20,$namespace).'</a> · <a href="'
|
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute"))) {
|
||||||
|
$output .= '<a href="'.WebGUI::URL::page('func=editSubmission&sid=new&wid='.
|
||||||
|
$_[0]->get("wobjectId")).'">'.WebGUI::International::get(20,$namespace).'</a> · ';
|
||||||
|
}
|
||||||
|
$output .= '<a href="'
|
||||||
.WebGUI::URL::page('func=search&wid='.$_[0]->get("wobjectId")).'">'
|
.WebGUI::URL::page('func=search&wid='.$_[0]->get("wobjectId")).'">'
|
||||||
.WebGUI::International::get(364).'</a></td></tr></table>';
|
.WebGUI::International::get(364).'</a></td></tr></table>';
|
||||||
$p = WebGUI::Paginator->new(WebGUI::URL::page(),\@row,$_[0]->get("submissionsPerPage"));
|
$p = WebGUI::Paginator->new(WebGUI::URL::page(),\@row,$_[0]->get("submissionsPerPage"));
|
||||||
|
|
@ -428,7 +432,9 @@ sub www_editSubmission {
|
||||||
$submission{convertCarriageReturns} = 1;
|
$submission{convertCarriageReturns} = 1;
|
||||||
$submission{userId} = $session{user}{userId};
|
$submission{userId} = $session{user}{userId};
|
||||||
}
|
}
|
||||||
if ($submission{userId} == $session{user}{userId} || WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"))) {
|
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute"))
|
||||||
|
|| $submission{userId} == $session{user}{userId}
|
||||||
|
|| WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"))) {
|
||||||
$output = '<h1>'.WebGUI::International::get(19,$namespace).'</h1>';
|
$output = '<h1>'.WebGUI::International::get(19,$namespace).'</h1>';
|
||||||
$f = WebGUI::HTMLForm->new;
|
$f = WebGUI::HTMLForm->new;
|
||||||
$f->hidden("wid",$session{form}{wid});
|
$f->hidden("wid",$session{form}{wid});
|
||||||
|
|
@ -463,7 +469,9 @@ sub www_editSubmission {
|
||||||
sub www_editSubmissionSave {
|
sub www_editSubmissionSave {
|
||||||
my ($sqlAdd,$owner,$image,$attachment,$title);
|
my ($sqlAdd,$owner,$image,$attachment,$title);
|
||||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId='$session{form}{sid}'");
|
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId='$session{form}{sid}'");
|
||||||
if ($owner == $session{user}{userId} || $session{form}{sid} eq "new" || WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"))) {
|
if ($owner == $session{user}{userId}
|
||||||
|
|| ($session{form}{sid} eq "new" && WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute")))
|
||||||
|
|| WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"))) {
|
||||||
if ($session{form}{sid} eq "new") {
|
if ($session{form}{sid} eq "new") {
|
||||||
$session{form}{sid} = getNextId("submissionId");
|
$session{form}{sid} = getNextId("submissionId");
|
||||||
WebGUI::SQL->write("insert into UserSubmission_submission (wobjectId,submissionId,userId,username)
|
WebGUI::SQL->write("insert into UserSubmission_submission (wobjectId,submissionId,userId,username)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue