liquid_feedback_frontend

view config/init.lua @ 1071:58f48a8a202a

Imported and merged LDAP patch
author bsw
date Fri Jul 18 21:42:59 2014 +0200 (2014-07-18)
parents e96d63b7a5e2
children 78b6dc244ef2
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 = "3.0.2+ldap"
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 config.ldap == nil then
52 config.ldap = {}
53 end
55 if not config.database then
56 config.database = { engine='postgresql', dbname='liquid_feedback' }
57 end
59 if not config.enable_debug_trace then
60 trace.disable()
61 else
62 slot.put_into('trace_button', '<div id="trace_show" onclick="document.getElementById(\'trace_content\').style.display=\'block\';this.style.display=\'none\';">TRACE</div>')
63 end
66 request.set_404_route{ module = 'index', view = '404' }
68 -- open and set default database handle
69 db = assert(mondelefant.connect(config.database))
70 at_exit(function()
71 db:close()
72 end)
73 function mondelefant.class_prototype:get_db_conn() return db end
75 -- enable output of SQL commands in trace system
76 function db:sql_tracer(command)
77 return function(error_info)
78 local error_info = error_info or {}
79 trace.sql{ command = command, error_position = error_info.position }
80 end
81 end
83 request.set_absolute_baseurl(config.absolute_base_url)
86 -- TODO abstraction
87 -- get record by id
88 function mondelefant.class_prototype:by_id(id)
89 local selector = self:new_selector()
90 selector:add_where{ 'id = ?', id }
91 selector:optional_object_mode()
92 return selector:exec()
93 end

Impressum / About Us