Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
217d8fa1
Commit
217d8fa1
authored
Jul 11, 2015
by
woogerboy21
Browse files
Multi Server Session Functionality
Fix #1130 Adds the server id in the SQL query for userSessionExists function.
parent
f733daf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
servatrice/src/servatrice_database_interface.cpp
View file @
217d8fa1
...
@@ -532,7 +532,8 @@ bool Servatrice_DatabaseInterface::userSessionExists(const QString &userName)
...
@@ -532,7 +532,8 @@ bool Servatrice_DatabaseInterface::userSessionExists(const QString &userName)
{
{
// Call only after lockSessionTables().
// Call only after lockSessionTables().
QSqlQuery
*
query
=
prepareQuery
(
"select 1 from {prefix}_sessions where user_name = :user_name and end_time is null"
);
QSqlQuery
*
query
=
prepareQuery
(
"select 1 from {prefix}_sessions where user_name = :user_name and id_server = :id_server and end_time is null"
);
query
->
bindValue
(
":id_server"
,
server
->
getServerId
());
query
->
bindValue
(
":user_name"
,
userName
);
query
->
bindValue
(
":user_name"
,
userName
);
execSqlQuery
(
query
);
execSqlQuery
(
query
);
return
query
->
next
();
return
query
->
next
();
...
@@ -803,4 +804,4 @@ bool Servatrice_DatabaseInterface::changeUserPassword(const QString &user, const
...
@@ -803,4 +804,4 @@ bool Servatrice_DatabaseInterface::changeUserPassword(const QString &user, const
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment