liquid_feedback_frontend
view config/example.lua @ 338:79d8e2d35021
Fixed broken html titles
| author | bsw | 
|---|---|
| date | Tue Feb 28 18:58:29 2012 +0100 (2012-02-28) | 
| parents | 75ce92899049 | 
| children | 63d6549cc00b 9447ea555398 | 
 line source
     1 request.set_absolute_baseurl(request.get_relative_baseurl())
     2 -- request.set_absolute_baseurl("http://www.example.com/lf/")
     4 config.app_name = "LiquidFeedback"
     5 config.app_version = "2.beta1"
     7 config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
     9 config.app_logo = nil
    11 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
    13 --config.footer_html = '<a href="somewhere">some link</a>'
    15 config.use_terms = "=== Terms of Use ===\nNothing is allowed."
    16 --config.use_terms_html = ""
    18 config.use_terms_checkboxes = {
    19   {
    20     name = "terms_of_use_v1",
    21     html = "I accept the terms of use.",
    22     not_accepted_error = "You have to accept the terms of use to be able to register."
    23   }
    24 }
    26 config.locked_profile_fields = {
    27   login               = false,
    28   notify_email        = false,
    29   name                = false,
    30   organizational_unit = false,
    31   internal_posts      = false,
    32   realname            = false,
    33   birthday            = false,
    34   address             = false,
    35   email               = false
    36 }
    38 config.member_image_content_type = "image/jpeg"
    39 config.member_image_convert_func = {
    40   avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail",   "48x48", "jpeg:-") end,
    41   photo =  function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
    42 }
    44 config.member_image_default_file = {
    45   avatar = "avatar.jpg",
    46   photo = nil
    47 }
    49 config.default_lang = "en"
    51 -- after how long is a user considered inactive and the trustee will see warning
    52 -- notation is according to postgresql intervals
    53 config.delegation_warning_time = '6 months'
    55 config.mail_subject_prefix = "[LiquidFeedback] "
    57 config.fastpath_url_func = nil
    59 config.download_dir = nil
    61 config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten"
    63 config.public_access = false  -- Available options: "anonymous", "pseudonym"
    65 config.api_enabled = true
    67 config.feature_rss_enabled = false -- feature is broken
    69 config.single_unit_id = false
    71 -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
    72 config.auth_openid_enabled = false
    73 config.auth_openid_https_as_default = true
    74 config.auth_openid_identifier_check_func = function(uri) return false end
    76 request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" }
    78 if request.get_json_request_slots() then
    79   request.force_absolute_baseurl()
    80 end
    82 request.set_404_route{ module = 'index', view = '404' }
    84 -- uncomment the following two lines to use C implementations of chosen
    85 -- functions and to disable garbage collection during the request, to
    86 -- increase speed:
    87 --
    88 -- require 'webmcp_accelerator'
    89 -- collectgarbage("stop")
    91 -- open and set default database handle
    92 db = assert(mondelefant.connect{
    93   engine='postgresql',
    94   dbname='liquid_feedback_p'
    95 })
    96 at_exit(function() 
    97   db:close()
    98 end)
    99 function mondelefant.class_prototype:get_db_conn() return db end
   101 -- enable output of SQL commands in trace system
   102 function db:sql_tracer(command)
   103   return function(error_info)
   104     local error_info = error_info or {}
   105     trace.sql{ command = command, error_position = error_info.position }
   106   end
   107 end
   110 -- TODO abstraction
   111 -- get record by id
   112 function mondelefant.class_prototype:by_id(id)
   113   local selector = self:new_selector()
   114   selector:add_where{ 'id = ?', id }
   115   selector:optional_object_mode()
   116   return selector:exec()
   117 end
   119 config.formatting_engine_executeables = {
   120   rocketwiki= "/opt/rocketwiki-lqfb/rocketwiki-lqfb",
   121   compat = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat"
   122 }
   124 config.fastpath_url_func = function(member_id, image_type)
   125   return request.get_absolute_baseurl() .. "fastpath/getpic?" .. tostring(member_id) .. "+" .. tostring(image_type)
   126 end
