public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, master, updated. c2f80e67a711eee43dd5c815defc689fc7604b64
Date: Tue, 05 Aug 2014 21:32:26 +0200	[thread overview]
Message-ID: <20140805193226.6A6CF21013@argus.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3372 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, master has been updated
       via  c2f80e67a711eee43dd5c815defc689fc7604b64 (commit)
      from  5354d0f5c902f208d755b3b8a06f5896d4d2c975 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c2f80e67a711eee43dd5c815defc689fc7604b64
Author: Stefan Schantl <stefan.schantl(a)ipfire.org>
Date:   Tue Aug 5 21:24:44 2014 +0200

    ddns.cgi: Fix enable/disable handling of entries.
    
    When the "enabled" checkbox is checked a "on" will be returned,
    if the box is unchecked checkboxes will return nothing.
    
    As a result of this behaviour the ddns.conf contained entries which have been disabled in the WUI.
    
    We now check if the checkbox returns a "on", otherwise we will set the "enabled" value to "off" to
    prevent from this problem.

-----------------------------------------------------------------------

Summary of changes:
 html/cgi-bin/ddns.cgi | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Difference in files:
diff --git a/html/cgi-bin/ddns.cgi b/html/cgi-bin/ddns.cgi
index 65e3bee..dc5dacc 100644
--- a/html/cgi-bin/ddns.cgi
+++ b/html/cgi-bin/ddns.cgi
@@ -197,6 +197,12 @@ if (($settings{'ACTION'} eq $Lang::tr{'add'}) || ($settings{'ACTION'} eq $Lang::
 		# Splitt hostname field into 2 parts for storrage.
 		my($hostname, $domain) = split(/\./, $settings{'HOSTNAME'}, 2);
 
+		# Handle enabled checkbox. When the checkbox is selected a "on" will be returned,
+		# if the checkbox is not checked nothing is returned in this case we set the value to "off".
+		if ($settings{'ENABLED'} ne 'on') {
+			$settings{'ENABLED'} = 'off';
+		}
+
 		# Handle adding new accounts.
 		if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
 
@@ -215,8 +221,6 @@ if (($settings{'ACTION'} eq $Lang::tr{'add'}) || ($settings{'ACTION'} eq $Lang::
 			# Write out notice to logfile.
 			&General::log($Lang::tr{'ddns hostname added'});
 
-			# Update ddns config file.
-
 		# Handle account edditing.
 		} elsif ($settings{'ACTION'} eq $Lang::tr{'update'}) {
 
@@ -354,7 +358,9 @@ $checked{'BEHINDROUTER'}{'RED_IP'} = '';
 $checked{'BEHINDROUTER'}{'FETCH_IP'} = '';
 $checked{'BEHINDROUTER'}{$settings{'BEHINDROUTER'}} = "checked='checked'";
 
-$checked{'ENABLED'}{'on'} = ($settings{'ENABLED'} eq '' ) ? '' : "checked='checked'";
+$checked{'ENABLED'}{'on'} = '';
+$checked{'ENABLED'}{'off'} = '';
+$checked{'ENABLED'}{$settings{'ENABLED'}} = "checked='checked'";
 
 # Show box for errormessages..
 if ($errormessage) {
@@ -451,7 +457,7 @@ print <<END
 
 	<tr>
 		<td class='base'>$Lang::tr{'enabled'}</td>
-		<td><input type='checkbox' name='ENABLED' value='on' $checked{'ENABLED'}{'on'} /></td>
+		<td><input type='checkbox' name='ENABLED' $checked{'ENABLED'}{'on'} /></td>
 		<td class='base'>$Lang::tr{'username'}</td>
 		<td><input type='text' name='LOGIN' value='$settings{'LOGIN'}' /></td>
 	</tr>


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2014-08-05 19:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140805193226.6A6CF21013@argus.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox