44 lines
660 B
C++
Executable File
44 lines
660 B
C++
Executable File
/*
|
|
* 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()
|
|
{
|
|
fun.url = L"login";
|
|
}
|
|
|
|
|
|
|
|
void Login::MakePost()
|
|
{
|
|
const std::wstring & login = request->PostVar(L"login");
|
|
const std::wstring & pass = request->PostVar(L"password");
|
|
const std::wstring & remem = request->PostVar(L"rememberme");
|
|
long user_id;
|
|
|
|
if( db->CheckUser(login, pass, user_id) )
|
|
system->users.LoginUser(user_id, !remem.empty());
|
|
|
|
// !! moze zglosic komunikat o nie poprawnym logowaniu
|
|
|
|
system->RedirectToLastItem();
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|