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 19 of file mythsession.h.
|
default |
|
inline |
Definition at line 23 of file mythsession.h.
|
default |
|
default |
Check if the user has the given permission in a context.
This function is currently unimplemented.
context | |
permission |
Definition at line 52 of file mythsession.cpp.
|
inline |
Definition at line 46 of file mythsession.h.
|
inline |
Definition at line 48 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 50 of file mythsession.h.
Referenced by HTTPRequest::BasicAuthentication(), HTTPRequest::DigestAuthentication(), and ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 49 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 45 of file mythsession.h.
Referenced by HTTPRequest::BasicAuthentication(), HTTPRequest::DigestAuthentication(), and V2Myth::LoginUser().
|
inline |
Definition at line 43 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage().
|
inline |
Definition at line 42 of file mythsession.h.
Referenced by ServerSideScripting::EvaluatePage(), V2Myth::ManageDigestUser(), and V2Myth::PutSetting().
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 17 of file mythsession.cpp.
Referenced by HTTPRequest::Authenticated(), HTTPRequest::BasicAuthentication(), HTTPRequest::DigestAuthentication(), MythSessionManager::IsValidSession(), MythSessionManager::LoginUser(), and HTTPRequest::ParseRequest().
|
default |
|
default |
|
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 65 of file mythsession.cpp.
Referenced by MythSessionManager::CreateUserSession(), and Update().
|
protected |
Update session expiry and access times.
Definition at line 110 of file mythsession.cpp.
Referenced by CheckPermission(), MythSessionManager::GetSession(), and MythSessionManager::UpdateSession().
|
friend |
Definition at line 88 of file mythsession.h.
|
protected |
Definition at line 78 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), and MythSessionManager::LoadSessions().
|
protected |
Definition at line 86 of file mythsession.h.
|
protected |
Definition at line 84 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), MythSessionManager::LoadSessions(), and Save().
|
protected |
Definition at line 81 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), IsValid(), MythSessionManager::LoadSessions(), and Save().
|
protected |
Definition at line 83 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), IsValid(), MythSessionManager::LoadSessions(), Save(), and Update().
|
protected |
Definition at line 82 of file mythsession.h.
Referenced by MythSessionManager::CreateUserSession(), MythSessionManager::LoadSessions(), Save(), and Update().
|
protected |
Definition at line 80 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(), IsValid(), MythSessionManager::LoadSessions(), and Save().