diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2010-02-18 18:18:57 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2010-02-18 18:18:57 +0000 |
commit | e282ddff61ec992533630f6940d3da73f940c962 (patch) | |
tree | af59bea608c619ab8d112e1f757a68677961199b | |
parent | 0f5d1a24a1f40b570af89d29b1f44c7d2f224779 (diff) | |
download | msec-e282ddff61ec992533630f6940d3da73f940c962.tar msec-e282ddff61ec992533630f6940d3da73f940c962.tar.gz msec-e282ddff61ec992533630f6940d3da73f940c962.tar.bz2 msec-e282ddff61ec992533630f6940d3da73f940c962.tar.xz msec-e282ddff61ec992533630f6940d3da73f940c962.zip |
properly sort levels
-rwxr-xr-x | src/msec/msecgui.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/msec/msecgui.py b/src/msec/msecgui.py index 150614d..7870e29 100755 --- a/src/msec/msecgui.py +++ b/src/msec/msecgui.py @@ -63,6 +63,9 @@ level_descriptions = { "webserver": _("""This profile is similar to the 'Fileserver', but it assumes that the server receives connection from Internet users. Therefore, this profile increases the log retention period and performs file-intensive operations more frequently, in order to detect possible server compromise and unauthorized operations quickly."""), } +# level order. Levels will appear in this order, the unspecified levels will appear last +level_order = ["standard", "fileserver", "webserver", "secure"] + # description for level without description DEFAULT_LEVEL_DESCRIPTION="\n".join(wrap(_("""Custom security level."""), 80)) @@ -576,7 +579,18 @@ class MsecGui: sw.add(treeview) + # first, add levels from level_order + levels = [] + for level in level_order: + if level in self.msec_defaults: + levels.append(level) + # then, add all other levels for level in self.msec_defaults: + if level not in levels: + levels.append(level) + + # now build the gui + for level in levels: # skip NONE level, as it disables msec if level == "none": continue |