liquid_feedback_frontend
view config/init.lua @ 1001:5832d2f5be96
German translation updated
| author | bsw | 
|---|---|
| date | Sat Apr 20 20:54:31 2013 +0200 (2013-04-20) | 
| parents | c4de4ef33da6 | 
| children | 489cb972466c | 
 line source
     1 -- ========================================================================
     2 -- DO NOT CHANGE ANYTHING IN THIS FILE
     3 -- (except when you really know what you are doing!)
     4 -- ========================================================================
     6 config.app_version = "2.2.3"
     8 if not config.password_hash_algorithm then
     9   config.password_hash_algorithm = "crypt_sha512"
    10 end
    12 if not config.password_hash_min_rounds then
    13  config.password_hash_min_rounds = 10000
    14 end
    16 if not config.password_hash_max_rounds then
    17   config.password_hash_max_rounds = 20000
    18 end
    20 if config.enabled_languages == nil then
    21   config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-Hans', 'zh-TW' }
    22 end
    24 if config.default_lang == nil then
    25   config.default_lang = "en"
    26 end
    28 if config.mail_subject_prefix == nil then
    29   config.mail_subject_prefix = "[LiquidFeedback] "
    30 end
    32 if config.member_image_content_type == nil then
    33   config.member_image_content_type = "image/jpeg"
    34 end
    36 if config.member_image_convert_func == nil then
    37   config.member_image_convert_func = {
    38     avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail",   "48x48", "jpeg:-") end,
    39     photo =  function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
    40   }
    41 end
    43 if config.locked_profile_fields == nil then
    44   config.locked_profile_fields = {}
    45 end
    47 if config.check_delegations_default == nil then
    48   config.check_delegations_default = "confirm"
    49 end
    51 if not config.database then
    52   config.database = { engine='postgresql', dbname='liquid_feedback' }
    53 end
    55 if not config.enable_debug_trace then
    56   trace.disable()
    57 else
    58   slot.put_into('trace_button', '<div id="trace_show" onclick="document.getElementById(\'trace_content\').style.display=\'block\';this.style.display=\'none\';">TRACE</div>')
    59 end
    62 request.set_404_route{ module = 'index', view = '404' }
    64 -- open and set default database handle
    65 db = assert(mondelefant.connect(config.database))
    66 at_exit(function() 
    67   db:close()
    68 end)
    69 function mondelefant.class_prototype:get_db_conn() return db end
    71 -- enable output of SQL commands in trace system
    72 function db:sql_tracer(command)
    73   return function(error_info)
    74     local error_info = error_info or {}
    75     trace.sql{ command = command, error_position = error_info.position }
    76   end
    77 end
    79 request.set_absolute_baseurl(config.absolute_base_url)
    82 -- TODO abstraction
    83 -- get record by id
    84 function mondelefant.class_prototype:by_id(id)
    85   local selector = self:new_selector()
    86   selector:add_where{ 'id = ?', id }
    87   selector:optional_object_mode()
    88   return selector:exec()
    89 end
