Fix a bug with passwords
Fix a bug in search (wildcards) Fix a bug in wxUI (tooltips not translated) Update translation Update TODO
This commit is contained in:
@@ -173,7 +173,7 @@ wxString Database::HashPassword(const wxString& password)
|
||||
wxString wxSHA;
|
||||
|
||||
blk_SHA1_Init(&sha_ctx);
|
||||
blk_SHA1_Update(&sha_ctx, password.c_str(), password.Length());
|
||||
blk_SHA1_Update(&sha_ctx, password.mb_str(), password.Length());
|
||||
blk_SHA1_Final(sha, &sha_ctx);
|
||||
|
||||
for(int i=0; i<20; i++)
|
||||
@@ -1039,7 +1039,7 @@ void Database::UpdatePreference(User* user, const wxString& preference)
|
||||
|
||||
std::vector<Operation>* Database::Search(User* user, wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo,
|
||||
wxString* amountFrom, wxString* amountTo,
|
||||
std::vector<wxString> categories, std::vector<wxString> accounts)
|
||||
std::vector<wxString> categories, std::vector<wxString> accounts, bool wildcards)
|
||||
{
|
||||
wxSQLite3ResultSet set;
|
||||
wxString req;
|
||||
@@ -1069,7 +1069,10 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
|
||||
|
||||
if (description)
|
||||
{
|
||||
req += wxT("description='") + *description + wxT("'");
|
||||
if (wildcards)
|
||||
req += wxT("description LIKE '%") + *description + wxT("%'");
|
||||
else
|
||||
req += wxT("description='") + *description + wxT("'");
|
||||
firstCond = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
std::vector<Operation>* Search(User* user, wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo,
|
||||
wxString* amountFrom, wxString* amountTo,
|
||||
std::vector<wxString> categories, std::vector<wxString> accounts);
|
||||
std::vector<wxString> categories, std::vector<wxString> accounts, bool wildcards);
|
||||
|
||||
void GetStats(User* user, const wxString& monthFrom, const wxString& yearFrom, const wxString& monthTo,
|
||||
const wxString& yearTo, std::map<wxString, std::map<int, std::map<int, double> > >* accountAmounts,
|
||||
|
||||
Reference in New Issue
Block a user