liquid_feedback_frontend
view config/default.lua @ 51:0849be391140
Public read access; Read-only API for initiatives; Prepared integration of OpenID
| author | bsw | 
|---|---|
| date | Sun Apr 04 22:05:11 2010 +0200 (2010-04-04) | 
| parents | a4e6f30fa84d | 
| children | 88ac7798b562 | 
 line source
     1 config.app_name = "LiquidFeedback"
     2 config.app_version = "beta15"
     4 config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
     6 config.app_logo = nil
     8 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
    10 config.use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten"
    12 config.member_image_convert_func = {
    13   avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail",   "48x48", "jpeg:-") end,
    14   photo =  function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
    15 }
    17 config.member_image_default_file = {
    18   avatar = "avatar.jpg",
    19   photo = nil
    20 }
    22 config.mail_subject_prefix = "[LiquidFeedback] "
    24 config.fastpath_url_func = nil
    26 config.download_dir = nil
    28 config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten"
    30 config.public_access = false  -- Available options: "anonymous", "pseudonym"
    32 config.api_enabled = false
    34 -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
    35 config.auth_openid_enabled = false
    36 config.auth_openid_https_as_default = true
    37 config.auth_openid_identifier_check_func = function(uri) return false end
    39 request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" }
    42 if request.get_json_request_slots() then
    43   request.force_absolute_baseurl()
    44 end
    46 request.set_404_route{ module = 'index', view = '404' }
    48 -- uncomment the following two lines to use C implementations of chosen
    49 -- functions and to disable garbage collection during the request, to
    50 -- increase speed:
    51 --
    52 -- require 'webmcp_accelerator'
    53 -- collectgarbage("stop")
    55 -- open and set default database handle
    56 db = assert(mondelefant.connect{
    57   engine='postgresql',
    58   dbname='liquid_feedback'
    59 })
    60 at_exit(function() 
    61   db:close()
    62 end)
    63 function mondelefant.class_prototype:get_db_conn() return db end
    65 -- enable output of SQL commands in trace system
    66 function db:sql_tracer(command)
    67   return function(error_info)
    68     local error_info = error_info or {}
    69     trace.sql{ command = command, error_position = error_info.position }
    70   end
    71 end
    73 request.set_absolute_baseurl(config.absolute_base_url)
    77 -- TODO abstraction
    78 -- get record by id
    79 function mondelefant.class_prototype:by_id(id)
    80   local selector = self:new_selector()
    81   selector:add_where{ 'id = ?', id }
    82   selector:optional_object_mode()
    83   return selector:exec()
    84 end
