2010-08-10 18:12:50 +02:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "login.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Fun
|
|
|
|
{
|
|
|
|
|
|
|
|
Login::Login()
|
|
|
|
{
|
2010-11-21 01:19:17 +01:00
|
|
|
fun.url = L"login";
|
2010-08-10 18:12:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Login::MakePost()
|
|
|
|
{
|
2010-11-21 01:19:17 +01:00
|
|
|
const std::wstring & login = request->PostVar(L"login");
|
|
|
|
const std::wstring & pass = request->PostVar(L"password");
|
|
|
|
const std::wstring & remem = request->PostVar(L"rememberme");
|
2010-08-10 18:12:50 +02:00
|
|
|
long user_id;
|
|
|
|
|
2010-08-12 21:10:12 +02:00
|
|
|
if( db->CheckUser(login, pass, user_id) )
|
|
|
|
system->users.LoginUser(user_id, !remem.empty());
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
// !! moze zglosic komunikat o nie poprawnym logowaniu
|
|
|
|
|
|
|
|
system->RedirectToLastItem();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|