tazbug diff web/bugs.cgi @ rev 105

Overall improvments
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 10 18:12:00 2017 +0100 (2017-02-10)
parents 60234e42d5c4
children 1a43d9e16913
line diff
     1.1 --- a/web/bugs.cgi	Fri Feb 10 14:54:49 2017 +0100
     1.2 +++ b/web/bugs.cgi	Fri Feb 10 18:12:00 2017 +0100
     1.3 @@ -308,8 +308,13 @@
     1.4  		if [ "$STATUS" == "OPEN" ]; then
     1.5  			cat << EOT
     1.6  <a href="?id=$id&amp;close">$(gettext "Close bug")</a>
     1.7 +EOT
     1.8 +		# Only original user and admin can edit a bug
     1.9 +		if [ "$user" == "$CREATOR" ] || admin_user; then
    1.10 +			cat << EOT
    1.11  <a href="?edit=$id">$(gettext "Edit bug")</a>
    1.12  EOT
    1.13 +		fi
    1.14  		else
    1.15  			cat << EOT
    1.16  <a href="?id=$id&amp;open">$(gettext "Re open bug")</a>
    1.17 @@ -448,10 +453,14 @@
    1.18  EOT
    1.19  }
    1.20  
    1.21 -
    1.22  # Edit/Save a bug
    1.23  edit_bug() {
    1.24  	. $bugdir/$id/bug.conf
    1.25 +	if admin_user || [ "$user" == "$CREATOR" ]; then
    1.26 +		continue
    1.27 +	else
    1.28 +		gettext "You can't edit someone else bug!" && exit 0
    1.29 +	fi
    1.30  	cat << EOT
    1.31  <h2>$(eval_gettext 'Edit Bug $bug')</h2>
    1.32  <div id="edit">