/usr/lib/Wt/examples/hangman/Session.h is in witty-examples 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2011 Emweb bvba, Heverlee, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef SESSION_H_
#define SESSION_H_
#include <vector>
#include <Wt/Auth/Login>
#include <Wt/Dbo/Session>
#include <Wt/Dbo/ptr>
#include <Wt/Dbo/backend/Sqlite3>
#include "User.h"
typedef Wt::Auth::Dbo::UserDatabase<AuthInfo> UserDatabase;
class Session
{
public:
static void configureAuth();
Session();
~Session();
Wt::Auth::AbstractUserDatabase& users();
Wt::Auth::Login& login() { return login_; }
std::vector<User> topUsers(int limit);
/*
* These methods deal with the currently logged in user
*/
std::string userName() const;
int findRanking();
void addToScore(int s);
static const Wt::Auth::AuthService& auth();
static const Wt::Auth::AbstractPasswordService& passwordAuth();
static const std::vector<const Wt::Auth::OAuthService *>& oAuth();
private:
Wt::Dbo::backend::Sqlite3 sqlite3_;
mutable Wt::Dbo::Session session_;
UserDatabase *users_;
Wt::Auth::Login login_;
Wt::Dbo::ptr<User> user() const;
};
#endif //SESSION_H_
|