Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed KeePassHttp.plgx
Binary file not shown.
6 changes: 6 additions & 0 deletions KeePassHttp/ConfigOpt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class ConfigOpt
const string AlwaysAllowAccessKey = "KeePassHttp_AlwaysAllowAccess";
const string AlwaysAllowUpdatesKey = "KeePassHttp_AlwaysAllowUpdates";
const string SearchInAllOpenedDatabasesKey = "KeePassHttp_SearchInAllOpenedDatabases";
const string HideExpiredKey = "KeePassHttp_HideExpired";
const string MatchSchemesKey = "KeePassHttp_MatchSchemes";
const string ReturnStringFieldsKey = "KeePassHttp_ReturnStringFields";
const string ReturnStringFieldsWithKphOnlyKey = "KeePassHttp_ReturnStringFieldsWithKphOnly";
Expand Down Expand Up @@ -59,6 +60,11 @@ public bool SearchInAllOpenedDatabases
set { _config.SetBool(SearchInAllOpenedDatabasesKey, value); }
}

public bool HideExpired
{
get { return _config.GetBool(HideExpiredKey, false); }
set { _config.SetBool(HideExpiredKey, value); }
}
public bool MatchSchemes
{
get { return _config.GetBool(MatchSchemesKey, false); }
Expand Down
17 changes: 17 additions & 0 deletions KeePassHttp/Handlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,23 @@ private IEnumerable<PwEntryDatabase> FindMatchingEntries(Request r, Aes aes)
result = from e in result where filterSchemes(e.entry) select e;
}

Func<PwEntry, bool> hideExpired = delegate(PwEntry e)
{
DateTime dtNow = DateTime.UtcNow;

if(e.Expires && (e.ExpiryTime <= dtNow))
{
return false;
}

return true;
};

if (configOpt.HideExpired)
{
result = from e in result where hideExpired(e.entry) select e;
}

return result;
}

Expand Down
27 changes: 20 additions & 7 deletions KeePassHttp/OptionsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions KeePassHttp/OptionsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private void OptionsForm_Load(object sender, EventArgs e)
credAllowAccessCheckbox.Checked = _config.AlwaysAllowAccess;
credAllowUpdatesCheckbox.Checked = _config.AlwaysAllowUpdates;
credSearchInAllOpenedDatabases.Checked = _config.SearchInAllOpenedDatabases;
hideExpiredCheckbox.Checked = _config.HideExpired;
matchSchemesCheckbox.Checked = _config.MatchSchemes;
returnStringFieldsCheckbox.Checked = _config.ReturnStringFields;
returnStringFieldsWithKphOnlyCheckBox.Checked = _config.ReturnStringFieldsWithKphOnly;
Expand All @@ -60,6 +61,7 @@ private void okButton_Click(object sender, EventArgs e)
_config.AlwaysAllowAccess = credAllowAccessCheckbox.Checked;
_config.AlwaysAllowUpdates = credAllowUpdatesCheckbox.Checked;
_config.SearchInAllOpenedDatabases = credSearchInAllOpenedDatabases.Checked;
_config.HideExpired = hideExpiredCheckbox.Checked;
_config.MatchSchemes = matchSchemesCheckbox.Checked;
_config.ReturnStringFields = returnStringFieldsCheckbox.Checked;
_config.ReturnStringFieldsWithKphOnly = returnStringFieldsWithKphOnlyCheckBox.Checked;
Expand Down