示例#1
0
class CmsSessionLogData(sql.SQLTable):
    """Log of web user logins (underlying data)."""
    name = 'cms_session_log_data'
    schemas = cms_schemas.value(globals())
    fields = (
        sql.PrimaryColumn('log_id', pytis.data.Serial()),
        sql.Column('session_id',
                   pytis.data.Integer(not_null=False),
                   references=sql.gA('cms_session', ondelete='SET NULL')),
        sql.Column('uid',
                   pytis.data.Integer(not_null=False),
                   references=sql.gA(cms_users_table.value(globals()),
                                     ondelete='CASCADE')),
        sql.Column('login', pytis.data.String(not_null=True)),
        sql.Column('success', pytis.data.Boolean(not_null=True),
                   default=False),
        sql.Column('start_time', pytis.data.DateTime(not_null=True)),
        sql.Column('end_time', pytis.data.DateTime(not_null=False)),
        sql.Column('ip_address', pytis.data.String(not_null=True)),
        sql.Column('user_agent', pytis.data.String(not_null=False)),
        sql.Column('referer', pytis.data.String(not_null=False)),
    )
    with_oids = True
    depends_on = ()
    access_rights = cms_rights_rw.value(globals())
示例#2
0
class CmsSession(sql.SQLTable):
    """Web user session information for authentication and login history."""
    name = 'cms_session'
    schemas = cms_schemas.value(globals())
    fields = (
        sql.PrimaryColumn('session_id', pytis.data.Serial()),
        sql.Column('uid',
                   pytis.data.Integer(not_null=True),
                   references=sql.gA(cms_users_table.value(globals()),
                                     ondelete='CASCADE')),
        sql.Column('session_key', pytis.data.String(not_null=True)),
        sql.Column('last_access', pytis.data.DateTime(not_null=True)),
    )
    unique = ((
        'uid',
        'session_key',
    ), )
    depends_on = ()
    access_rights = cms_rights_rw.value(globals())
示例#3
0
class CmsAccessLogData(sql.SQLTable):
    """Log of cms page access."""
    name = 'cms_access_log_data'
    schemas = cms_schemas.value(globals())
    fields = (
        sql.PrimaryColumn('log_id', pytis.data.Serial()),
        sql.Column('timestamp', pytis.data.DateTime(not_null=True)),
        sql.Column('uri', pytis.data.String(not_null=True)),
        sql.Column('uid',
                   pytis.data.Integer(not_null=False),
                   references=sql.gA(cms_users_table.value(globals()),
                                     ondelete='CASCADE')),
        sql.Column('modname', pytis.data.String(not_null=False)),
        sql.Column('action', pytis.data.String(not_null=False)),
        sql.Column('ip_address', pytis.data.String(not_null=True)),
        sql.Column('user_agent', pytis.data.String(not_null=False)),
        sql.Column('referer', pytis.data.String(not_null=False)),
    )
    with_oids = True
    depends_on = ()
    access_rights = cms_rights_rw.value(globals())