/* * This file is a part of Winix * and is not publicly distributed * * Copyright (c) 2010-2012, Tomasz Sowa * All rights reserved. * */ #ifndef headerfile_winix_functions_login #define headerfile_winix_functions_login #include "functionbase.h" #include "core/user.h" namespace Fun { class Login : public FunctionBase { public: Login(); void MakePost(); void MakeGet(); bool ShouldUseCaptchaForCurrentIP(); bool ShouldUseCaptchaFor(const IPBan & ipban); bool CannotLoginFromCurrentIP(); bool CannotLoginFrom(const IPBan & ipban); 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); private: void ClearTmpStruct(); bool CheckPasswords(const std::wstring & password); void AddBanInfo(); bool CheckAbuse(); UserPass up, up2; std::string pass_decrypted; std::wstring pass_hashed; std::wstring salt; }; } // namespace #endif