tazbug diff web/bugs.cgi @ rev 159

Remove ashism ==
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 26 08:28:10 2019 +0100 (2019-02-26)
parents db4fbbd66ac3
children 86c2bff8ff74
line diff
     1.1 --- a/web/bugs.cgi	Thu Jan 10 10:36:26 2019 +0100
     1.2 +++ b/web/bugs.cgi	Tue Feb 26 08:28:10 2019 +0100
     1.3 @@ -106,7 +106,7 @@
     1.4  	user="$(echo $auth | cut -d ":" -f 1)"
     1.5  	md5cookie="$(echo $auth | cut -d ":" -f 2)"
     1.6  	[ -f "$sessions/$user" ] && md5session="$(cat $sessions/$user)"
     1.7 -	if [ "$md5cookie" == "$md5session" ] && [ "$auth" ]; then
     1.8 +	if [ "$md5cookie" = "$md5session" ] && [ "$auth" ]; then
     1.9  		return 0
    1.10  	else
    1.11  		return 1
    1.12 @@ -179,7 +179,7 @@
    1.13  
    1.14  # Link for online signup if enabled.
    1.15  online_signup() {
    1.16 -	if [ "$ONLINE_SIGNUP" == "yes" ]; then
    1.17 +	if [ "$ONLINE_SIGNUP" = "yes" ]; then
    1.18  		echo -n "<a href='$script?signup&amp;online'>"
    1.19  		gettext "Sign Up Online"
    1.20  		echo '</a></p>'
    1.21 @@ -262,7 +262,7 @@
    1.22  		for id in $(ls $bugdir/$status)
    1.23  		do
    1.24  			. $bugdir/$status/$id/bug.conf
    1.25 -			if [ "$PRIORITY" == "$pr" ]; then
    1.26 +			if [ "$PRIORITY" = "$pr" ]; then
    1.27  				[ -f "${PEOPLE}/${CREATOR}/account.conf" ] && \
    1.28  					. ${PEOPLE}/${CREATOR}/account.conf
    1.29  				cat << EOT
    1.30 @@ -335,12 +335,12 @@
    1.31  	fi
    1.32  	echo '<div id="tools">'
    1.33  	if check_auth; then
    1.34 -		if [ "$STATUS" == "OPEN" ]; then
    1.35 +		if [ "$STATUS" = "OPEN" ]; then
    1.36  			cat << EOT
    1.37  <a href="?id=$id&amp;close">$(gettext "Close bug")</a>
    1.38  EOT
    1.39  		# Only original user and admin can edit a bug
    1.40 -		if [ "$user" == "$CREATOR" ] || admin_user; then
    1.41 +		if [ "$user" = "$CREATOR" ] || admin_user; then
    1.42  			cat << EOT
    1.43  <a href="?editbug=$id">$(gettext "Edit bug")</a>
    1.44  EOT
    1.45 @@ -356,7 +356,7 @@
    1.46  
    1.47  <h3>$(gettext "Messages")</h3>
    1.48  EOT
    1.49 -	[ "$msgs" == "0" ] && gettext "No messages"
    1.50 +	[ "$msgs" = "0" ] && gettext "No messages"
    1.51  	for msg in $(ls -1tr $bugdir/$id/msg.*)
    1.52  	do
    1.53  		#
    1.54 @@ -373,7 +373,7 @@
    1.55  			msgid=$(echo $msg | cut -d "." -f 2)
    1.56  			del=""
    1.57  			# User can delete his post as well as admin.
    1.58 -			if [ "$user" == "$USER" ] || admin_user; then
    1.59 +			if [ "$user" = "$USER" ] || admin_user; then
    1.60  				del="- <a href=\"?id=$id&amp;delmsg=$msgid\">delete</a>"
    1.61  			fi
    1.62  			cat << EOT
    1.63 @@ -498,7 +498,7 @@
    1.64  # Edit/Save a bug
    1.65  edit_bug() {
    1.66  	. $bugdir/$id/bug.conf
    1.67 -	if admin_user || [ "$user" == "$CREATOR" ]; then
    1.68 +	if admin_user || [ "$user" = "$CREATOR" ]; then
    1.69  		continue
    1.70  	else
    1.71  		gettext "You can't edit someone else's bug!" && exit 0
    1.72 @@ -605,7 +605,7 @@
    1.73  EOT
    1.74  	chmod 0600 $PEOPLE/$user/account.conf
    1.75  	# First created user is admin
    1.76 -	if [ $(ls ${PEOPLE} | wc -l) == "1" ]; then
    1.77 +	if [ $(ls ${PEOPLE} | wc -l) = "1" ]; then
    1.78  		echo "$user" > ${ADMIN_USERS}
    1.79  	fi
    1.80  }
    1.81 @@ -635,7 +635,7 @@
    1.82  		fi;
    1.83  
    1.84  		valid=$(fgrep "${user}:" $AUTH_FILE | cut -d ":" -f 2)
    1.85 -		if [ "$pass" == "$valid" ] && [ "$pass" != "" ]; then
    1.86 +		if [ "$pass" = "$valid" ] && [ "$pass" != "" ]; then
    1.87  			if [[ "$(POST id)" ]] ;then
    1.88  				IDLOC="?id=$(POST id)"
    1.89  			fi
    1.90 @@ -802,7 +802,7 @@
    1.91  		html_header
    1.92  		user_box
    1.93  		echo "<h2>$(gettext "Sign Up")</h2>"
    1.94 -		if [ "$ONLINE_SIGNUP" == "yes" ]; then
    1.95 +		if [ "$ONLINE_SIGNUP" = "yes" ]; then
    1.96  			signup_page
    1.97  		else
    1.98  			gettext "Online registration is disabled"
    1.99 @@ -844,7 +844,7 @@
   1.100  			fi
   1.101  			bugdir=$(dirname $bugdir)
   1.102  		done
   1.103 -		if [ "$found" == "0" ]; then
   1.104 +		if [ "$found" = "0" ]; then
   1.105  			echo "<p>$(gettext 'No result found for') : $(GET search)</p>"
   1.106  		else
   1.107  			echo "<p> $found $(gettext 'results found')</p>"