MythTV
master
|
#include <libmythbase/mythsession.h>
Public Member Functions | |
MythUserSession ()=default | |
~MythUserSession () | |
MythUserSession (const MythUserSession &)=default | |
MythUserSession (MythUserSession &&other)=default | |
MythUserSession & | operator= (const MythUserSession &)=default |
MythUserSession & | operator= (MythUserSession &&other)=default |
bool | IsValid (void) const |
Check if this session object appears properly constructed, it DOES NOT validate whether it is a valid session with the SessionManager. More... | |
QString | GetUserName (void) const |
uint | GetUserId (void) const |
QString | GetSessionToken (void) const |
QString | GetSessionClient (void) const |
QDateTime | GetSessionCreated () const |
QDateTime | GetSessionLastActive () const |
QDateTime | GetSessionExpires () const |
bool | CheckPermission (const QString &context, uint permission) |
Check if the user has the given permission in a context. More... | |
Protected Member Functions | |
bool | Save (void) |
Save the session to the database. More... | |
bool | Update (void) |
Update session expiry and access times. More... | |
Protected Attributes | |
uint | m_userId {0} |
QString | m_name |
QString | m_sessionToken |
QDateTime | m_sessionCreated |
QDateTime | m_sessionLastActive |
QDateTime | m_sessionExpires |
QString | m_sessionClient |
QMap< QString, uint > | m_permissionsList |
Friends | |
class | MythSessionManager |
Definition at line 18 of file mythsession.h.
|
default |
|
inline |
Definition at line 22 of file mythsession.h.
|
default |
|
default |
|
default |
|
default |
bool MythUserSession::IsValid | ( | void | ) | const |
Check if this session object appears properly constructed, it DOES NOT validate whether it is a valid session with the SessionManager.
A valid session object includes a user id, a session token of the correct length, a created date in the past and an expiry date in the future.
It may also require that the 'client' string is present and formatted as expected.
Definition at line 15 of file mythsession.cpp.
Referenced by HTTPRequest::Authenticated(), HTTPRequest::BasicAuthentication(), HTTPRequest::DigestAuthentication(), MythSessionManager::IsValidSession(), MythSessionManager::LoginUser(), and HTTPRequest::ParseRequest().
|
inline |
Definition at line 41 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 42 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 44 of file mythsession.h.
Referenced by HTTPRequest::BasicAuthentication(), and HTTPRequest::DigestAuthentication().
|
inline |
Definition at line 45 of file mythsession.h.
|
inline |
Definition at line 47 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 48 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 49 of file mythsession.h.
Referenced by HTTPRequest::BasicAuthentication(), HTTPRequest::DigestAuthentication(), and ServerSideScripting::EvaluatePage().
Check if the user has the given permission in a context.
This function is currently unimplemented.
context | |
permission |
Definition at line 37 of file mythsession.cpp.
|
protected |
Save the session to the database.
This is intended only to be used by the SessionManager, everything except for checking perms is done in the session manager, and perms checking is only done through the MythUserSession object to
Definition at line 56 of file mythsession.cpp.
Referenced by MythSessionManager::CreateUserSession(), and Update().
|
protected |
Update session expiry and access times.
Definition at line 101 of file mythsession.cpp.
Referenced by CheckPermission(), MythSessionManager::GetSession(), and MythSessionManager::UpdateSession().
|
friend |
Definition at line 87 of file mythsession.h.
|
protected |
Definition at line 76 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), IsValid(), MythSessionManager::LoadSessions(), and Save().
|
protected |
Definition at line 77 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), and MythSessionManager::LoadSessions().
|
protected |
Definition at line 79 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), IsValid(), MythSessionManager::LoadSessions(), and Save().
|
protected |
Definition at line 80 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), IsValid(), MythSessionManager::LoadSessions(), and Save().
|
protected |
Definition at line 81 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), MythSessionManager::LoadSessions(), Save(), and Update().
|
protected |
Definition at line 82 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), IsValid(), MythSessionManager::LoadSessions(), Save(), and Update().
|
protected |
Definition at line 83 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), MythSessionManager::LoadSessions(), and Save().
|
protected |
Definition at line 85 of file mythsession.h.