liquid_feedback_frontend

view config/default.lua @ 665:df92aebce0f6

Going to version v2.beta12
author bsw
date Tue Jun 26 15:19:04 2012 +0200 (2012-06-26)
parents dcb2949b9b8e
children f49cdfb72567
line source
1 -- forward compatibility for webmcp 1.2
2 if not os.pfilter then
3 os.pfilter = extos.pfilter
4 end
5 if not os.listdir then
6 os.listdir = extos.listdir
7 end
8 if not os.crypt then
9 os.crypt = extos.crypt
10 end
12 config.app_name = "LiquidFeedback"
13 config.app_version = "2.beta12"
15 config.instance_name = request.get_config_name()
17 config.app_title = config.app_name .. " " .. config.instance_name
19 config.app_logo = nil
21 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
23 --config.footer_html = '<a href="somewhere">some link</a>'
25 config.use_terms = "=== Terms of Use ===\nNothing is allowed."
26 --config.use_terms_html = ""
28 config.use_terms_checkboxes = {
29 {
30 name = "terms_of_use_v1",
31 html = "I accept the terms of use.",
32 not_accepted_error = "You have to accept the terms of use to be able to register."
33 }
34 }
36 config.locked_profile_fields = {
37 field_name = true,
38 }
40 config.member_image_content_type = "image/jpeg"
41 config.member_image_convert_func = {
42 avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
43 photo = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
44 }
46 config.member_image_default_file = {
47 avatar = "avatar.jpg",
48 photo = nil
49 }
51 config.available_languages = { 'en', 'de', 'eo', 'el', 'hu' }
53 config.default_lang = "de"
55 -- after how long is a user considered inactive and the trustee will see warning
56 -- notation is according to postgresql intervals
57 config.delegation_warning_time = '6 months'
59 config.mail_subject_prefix = "[LiquidFeedback] "
61 config.fastpath_url_func = nil
63 config.download_dir = nil
65 config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten"
67 config.public_access = false -- Available options: "anonymous", "pseudonym"
69 config.api_enabled = true
71 config.feature_rss_enabled = false -- feature is broken
73 config.single_unit_id = false
75 -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
76 config.auth_openid_enabled = false
77 config.auth_openid_https_as_default = true
78 config.auth_openid_identifier_check_func = function(uri) return false end
80 request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" }
83 if request.get_json_request_slots() then
84 request.force_absolute_baseurl()
85 end
87 request.set_404_route{ module = 'index', view = '404' }
89 -- uncomment the following two lines to use C implementations of chosen
90 -- functions and to disable garbage collection during the request, to
91 -- increase speed:
92 --
93 require 'webmcp_accelerator'
94 collectgarbage("stop")
96 -- open and set default database handle
97 db = assert(mondelefant.connect{
98 engine='postgresql',
99 dbname='liquid_feedback'
100 })
101 at_exit(function()
102 db:close()
103 end)
104 function mondelefant.class_prototype:get_db_conn() return db end
106 -- enable output of SQL commands in trace system
107 function db:sql_tracer(command)
108 return function(error_info)
109 local error_info = error_info or {}
110 trace.sql{ command = command, error_position = error_info.position }
111 end
112 end
114 request.set_absolute_baseurl(config.absolute_base_url)
118 -- TODO abstraction
119 -- get record by id
120 function mondelefant.class_prototype:by_id(id)
121 local selector = self:new_selector()
122 selector:add_where{ 'id = ?', id }
123 selector:optional_object_mode()
124 return selector:exec()
125 end

Impressum / About Us