changed: added 'check_abuse' parameter to Login::LoginUser
bool Login::LoginUser(const std::wstring & login, const std::wstring & password, bool remember_me, bool use_ses_log, bool check_abuse) default 'false' -- it test the time between GET and POST and the rebus (if exists) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@905 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
8033ac66c4
commit
6e2ba65524
|
@ -210,7 +210,10 @@ return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Login::LoginUser(const std::wstring & login, const std::wstring & password, bool remember_me, bool use_ses_log)
|
// if you are logging not from a webbrowser but from an application
|
||||||
|
// then probably you need check_abuse to be false
|
||||||
|
bool Login::LoginUser(const std::wstring & login, const std::wstring & password, bool remember_me,
|
||||||
|
bool use_ses_log, bool check_abuse)
|
||||||
{
|
{
|
||||||
long user_id;
|
long user_id;
|
||||||
|
|
||||||
|
@ -232,7 +235,7 @@ long user_id;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !CheckAbuse() )
|
if( check_abuse && !CheckAbuse() )
|
||||||
{
|
{
|
||||||
AddBanInfo();
|
AddBanInfo();
|
||||||
return false;
|
return false;
|
||||||
|
@ -264,7 +267,7 @@ void Login::MakePost()
|
||||||
const std::wstring & pass = cur->request->PostVar(L"password");
|
const std::wstring & pass = cur->request->PostVar(L"password");
|
||||||
const std::wstring & remem = cur->request->PostVar(L"rememberme");
|
const std::wstring & remem = cur->request->PostVar(L"rememberme");
|
||||||
|
|
||||||
if( LoginUser(login, pass, !remem.empty(), true) )
|
if( LoginUser(login, pass, !remem.empty(), true, true) )
|
||||||
system->RedirectToLastItem();
|
system->RedirectToLastItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,8 @@ public:
|
||||||
bool CannotLoginFrom(const IPBan & ipban);
|
bool CannotLoginFrom(const IPBan & ipban);
|
||||||
|
|
||||||
bool CheckUserPass(const std::wstring & login, const std::wstring & password, long & user_id);
|
bool CheckUserPass(const std::wstring & login, const std::wstring & password, long & user_id);
|
||||||
bool LoginUser(const std::wstring & login, const std::wstring & password, bool remember_me, bool use_ses_log = false);
|
bool LoginUser(const std::wstring & login, const std::wstring & password, bool remember_me,
|
||||||
|
bool use_ses_log = false, bool check_abuse = false);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue