changed: added Cur structure
we have there two pointers: Request * request; Session * session; these are the current request and the current session the session GC was moved to SessionManager (was in SessionContainer) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -25,25 +25,25 @@ bool AddUser::CheckAddUserVars(const std::wstring & login, const std::wstring &
|
||||
{
|
||||
if( login.empty() )
|
||||
{
|
||||
request->status = WINIX_ERR_LOGIN_EMPTY;
|
||||
cur->request->status = WINIX_ERR_LOGIN_EMPTY;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( pass != conf_pass )
|
||||
{
|
||||
request->status = WINIX_ERR_PASSWORDS_DIFFERENT;
|
||||
cur->request->status = WINIX_ERR_PASSWORDS_DIFFERENT;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( pass.size() < config->password_min_size )
|
||||
{
|
||||
request->status = WINIX_ERR_PASSWORD_TOO_SHORT;
|
||||
cur->request->status = WINIX_ERR_PASSWORD_TOO_SHORT;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( system->users.IsUser(login) )
|
||||
{
|
||||
request->status = WINIX_ERR_USER_EXISTS;
|
||||
cur->request->status = WINIX_ERR_USER_EXISTS;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,23 +59,23 @@ void AddUser::MakePost()
|
||||
{
|
||||
User user;
|
||||
|
||||
const std::wstring & login = request->PostVar(L"login");
|
||||
const std::wstring & pass = request->PostVar(L"password");
|
||||
const std::wstring & conf_pass = request->PostVar(L"confirmpassword");
|
||||
const std::wstring & login = cur->request->PostVar(L"login");
|
||||
const std::wstring & pass = cur->request->PostVar(L"password");
|
||||
const std::wstring & conf_pass = cur->request->PostVar(L"confirmpassword");
|
||||
|
||||
if( !CheckAddUserVars(login, pass, conf_pass) )
|
||||
return;
|
||||
|
||||
user.name = login;
|
||||
user.email = request->PostVar(L"email");
|
||||
user.email = cur->request->PostVar(L"email");
|
||||
|
||||
request->status = db->AddUser(user, pass);
|
||||
cur->request->status = db->AddUser(user, pass);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
if( system->users.AddUser(user) )
|
||||
{
|
||||
if( !request->session->puser )
|
||||
if( !cur->session->puser )
|
||||
system->users.LoginUser(user.id, false);
|
||||
|
||||
log << log2 << "Adduser: added a new user: " << user.name << logend;
|
||||
|
||||
Reference in New Issue
Block a user