liquid_feedback_frontend
view model/session.lua @ 157:24e47baf5f9b
strip html from fallback title
if the slot is used for title, make sure the html is stripped from it
if the slot is used for title, make sure the html is stripped from it
| author | Daniel Poelzleithner <poelzi@poelzi.org> | 
|---|---|
| date | Fri Oct 08 20:31:09 2010 +0200 (2010-10-08) | 
| parents | 3bfb2fcf7ab9 | 
| children | ea2449916c12 | 
 line source
     1 Session = mondelefant.new_class()
     2 Session.table = 'session'
     3 Session.primary_key = { 'ident' } 
     5 Session:add_reference{
     6   mode          = 'm1',
     7   to            = "Member",
     8   this_key      = 'member_id',
     9   that_key      = 'id',
    10   ref           = 'member',
    11 }
    13 local function random_string()
    14   return multirand.string(
    15     32,
    16     '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
    17   )
    18 end
    20 function Session:new()
    21   local session = self.prototype.new(self)  -- super call
    22   session.ident             = random_string()
    23   session.additional_secret = random_string()
    24   session:save() 
    25   return session
    26 end
    28 function Session:by_ident(ident)
    29   local selector = self:new_selector()
    30   selector:add_where{ 'ident = ?', ident }
    31   selector:optional_object_mode()
    32   return selector:exec()
    33 end
