mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #899 from Emotyco/libresapi_wrong_password_notification
Fixed: Information about wrong password in libresapi
This commit is contained in:
commit
8c4396caf9
@ -164,9 +164,6 @@ IdentityHandler::IdentityHandler(StateTokenServer *sts, RsNotify *notify,
|
|||||||
addResourceHandler("notown_ids", this,
|
addResourceHandler("notown_ids", this,
|
||||||
&IdentityHandler::handleNotOwnIdsRequest);
|
&IdentityHandler::handleNotOwnIdsRequest);
|
||||||
|
|
||||||
addResourceHandler("create_identity", this,
|
|
||||||
&IdentityHandler::handleCreateIdentity);
|
|
||||||
|
|
||||||
addResourceHandler("export_key", this, &IdentityHandler::handleExportKey);
|
addResourceHandler("export_key", this, &IdentityHandler::handleExportKey);
|
||||||
addResourceHandler("import_key", this, &IdentityHandler::handleImportKey);
|
addResourceHandler("import_key", this, &IdentityHandler::handleImportKey);
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ RsControlModule::RsControlModule(int argc, char **argv, StateTokenServer* sts, A
|
|||||||
mAutoLoginNextTime(false),
|
mAutoLoginNextTime(false),
|
||||||
mWantPassword(false),
|
mWantPassword(false),
|
||||||
mPrevIsBad(false),
|
mPrevIsBad(false),
|
||||||
|
mCountAttempts(0),
|
||||||
mPassword("")
|
mPassword("")
|
||||||
{
|
{
|
||||||
mStateToken = sts->getNewToken();
|
mStateToken = sts->getNewToken();
|
||||||
@ -64,7 +65,14 @@ bool RsControlModule::askForPassword(const std::string &title, const std::string
|
|||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mDataMtx); // ********** LOCKED **********
|
RS_STACK_MUTEX(mDataMtx); // ********** LOCKED **********
|
||||||
|
|
||||||
|
mCountAttempts++;
|
||||||
|
if(mCountAttempts == 3)
|
||||||
|
{
|
||||||
mPrevIsBad = prev_is_bad;
|
mPrevIsBad = prev_is_bad;
|
||||||
|
mCountAttempts = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mPrevIsBad = false;
|
||||||
|
|
||||||
if(mFixedPassword != "")
|
if(mFixedPassword != "")
|
||||||
{
|
{
|
||||||
|
@ -79,6 +79,7 @@ private:
|
|||||||
// to answer the request, clear the flag and set the password
|
// to answer the request, clear the flag and set the password
|
||||||
bool mWantPassword;
|
bool mWantPassword;
|
||||||
bool mPrevIsBad;
|
bool mPrevIsBad;
|
||||||
|
int mCountAttempts;
|
||||||
std::string mTitle;
|
std::string mTitle;
|
||||||
std::string mKeyName;
|
std::string mKeyName;
|
||||||
std::string mPassword;
|
std::string mPassword;
|
||||||
|
Loading…
Reference in New Issue
Block a user