Comment 1 for bug 600442

Revision history for this message
Malcolm Fitzgerald (malcolm-notyourhomework) wrote :

Correction. The bug is in cgiStore, so it affects cgiChanged too.

I have used the code below. It replaces text near line 50 in cgiStore; near line 680 in cgiChanged and near line 5700 in woda-max.pl.

You will see that I have simple wrapped the text and button within a test for rights to add.

A more subtle issue is that I have changed the variable from a global $x to a my variable named $txt. I did this because the call to wbAllowed was trashing $x and the end result was that $WBB{rights} was being printed onscreen.

my $txt = <<EOM ; #UK
<p>Thank you for contributing to $WBB{'dbTitle'}. Your edits were saved at URL <p>
<center><p><a class="BUTTON" href="$url">$url</a>.</p></center>
<p>
This information may be useful to locate the record for editing or updating.
You may wish to <tt>[bookmark]</tt> it.
<p>
EOM

if ( &wbAllowed( $Group, 'Add' ) ) {
 $txt .= '<p>To add a record, click on the add icon in the toolbar.</p>'; #UK
}

$y = "Success!"; #UK
print &formatWindow( $y, $txt );

if ( &wbAllowed( $Group, 'Add' ) ) {
$t = "Add another record"; #UK
push( @Toolbar, <<EOM);
<a href="$SCRIPT/Add">
<img $ICONPAR src="$ICONURL/add.gif" alt="$t" title="$t"></a>
EOM
}