Skip to content

Commit

Permalink
Merge pull request #15 from ancorgs/pre907907_cleanup
Browse files Browse the repository at this point in the history
Code cleanup and some fixes
  • Loading branch information
ancorgs committed Jan 7, 2015
2 parents a0e8979 + 37597c3 commit d617de1
Show file tree
Hide file tree
Showing 18 changed files with 1,124 additions and 182 deletions.
7 changes: 7 additions & 0 deletions package/yast2-security.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Dec 22 17:18:56 UTC 2014 - ancor@suse.com

- Fixed the interface to show and process correctly values from
sysctl.conf.
- Source code cleanup, including some minor fixes and new tests.

-------------------------------------------------------------------
Thu Dec 4 09:51:32 UTC 2014 - jreidinger@suse.com

Expand Down
11 changes: 8 additions & 3 deletions src/include/security/dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ def initialize_security_dialogs(include_target)

# mapping for "Enable" and "Disable" links
# current value -> new value
@link_value_mapping = { "yes" => "no", "no" => "yes" }
@link_value_mapping = {
"yes" => "no",
"no" => "yes",
"1" => "0",
"0" => "1"
}

# mapping for "Configure" links
# config name -> dialog name
Expand Down Expand Up @@ -154,9 +159,9 @@ def SecurityStatus(option, plaintext)
# handle the special cases at first
if Builtins.contains(@configurable_options, option)
ret = _("Configure")
elsif value == "yes"
elsif ["1", "yes"].include?(value)
ret = _("Enabled")
elsif value == "no"
elsif ["0", "no"].include?(value)
ret = _("Disabled")
else
return @UNKNOWN_STATUS
Expand Down

0 comments on commit d617de1

Please sign in to comment.