#include <Session.h>
Detailed Description
Definition at line 23 of file Session.h.
Constructor & Destructor Documentation
Definition at line 95 of file Session.C.
:
sqlite3_(WApplication::instance()->appRoot() +
"hangman.db")
{
sqlite3_.setProperty(
"show-queries",
"true");
try {
guestUser.
addIdentity(Auth::Identity::LoginName,
"guest");
myPasswordService.updatePassword(guestUser, "guest");
Wt::log("info") << "Database created";
} catch (...) {
Wt::log("info") << "Using existing database";
}
transaction.commit();
}
Member Function Documentation
void Session::addToScore |
( |
int |
s | ) |
|
Definition at line 156 of file Session.C.
{
if (u) {
}
transaction.commit();
}
Definition at line 213 of file Session.C.
{
return myAuthService;
}
void Session::configureAuth |
( |
| ) |
|
|
static |
Definition at line 73 of file Session.C.
{
myAuthService.setAuthTokensEnabled(true, "hangmancookie");
myAuthService.setEmailVerificationEnabled(true);
#ifdef HAVE_CRYPT
#endif
myPasswordService.setVerifier(verifier);
myPasswordService.setAttemptThrottlingEnabled(true);
if (Auth::GoogleService::configured())
}
int Session::findRanking |
( |
| ) |
|
Definition at line 192 of file Session.C.
{
int ranking = -1;
if (u)
ranking =
session_.
query<
int>(
"select distinct count(score) from user")
.where(
"score > ?").bind(u->
score);
transaction.commit();
return ranking + 1;
}
Definition at line 223 of file Session.C.
{
return myOAuthServices;
}
Definition at line 218 of file Session.C.
{
return myPasswordService;
}
std::vector< User > Session::topUsers |
( |
int |
limit | ) |
|
Definition at line 170 of file Session.C.
{
std::vector<User> result;
result.push_back(*user);
std::string name = auth->
identity(Auth::Identity::LoginName).
toUTF8();
result.back().name = name;
}
transaction.commit();
return result;
}
Definition at line 132 of file Session.C.
{
if (!user) {
}
} else
}
std::string Session::userName |
( |
| ) |
const |
Definition at line 148 of file Session.C.
{
else
return std::string();
}
Member Data Documentation
Wt::Dbo::backend::Sqlite3 Session::sqlite3_ |
|
private |
The documentation for this class was generated from the following files:
- /build/witty-NTchrX/witty-3.2.1/examples/hangman/Session.h
- /build/witty-NTchrX/witty-3.2.1/examples/hangman/Session.C