liquid_feedback_frontend
view config/example.lua @ 614:c4e11c003b0c
Going to v2.beta11
author | bsw |
---|---|
date | Sun Jun 24 23:36:50 2012 +0200 (2012-06-24) |
parents | 9f8aa189cac4 |
children | f49cdfb72567 |
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.beta6"
7 config.instance_name = request.get_config_name()
9 config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
11 config.app_logo = nil
13 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
15 --config.footer_html = '<a href="somewhere">some link</a>'
17 config.use_terms = "=== Terms of Use ===\nNothing is allowed."
18 --config.use_terms_html = ""
20 config.use_terms_checkboxes = {
21 {
22 name = "terms_of_use_v1",
23 html = "I accept the terms of use.",
24 not_accepted_error = "You have to accept the terms of use to be able to register."
25 }
26 }
28 config.locked_profile_fields = {
29 login = false,
30 notify_email = false,
31 name = false,
32 organizational_unit = false,
33 internal_posts = false,
34 realname = false,
35 birthday = false,
36 address = false,
37 email = false
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.default_lang = "en"
53 -- after how long is a user considered inactive and the trustee will see warning
54 -- notation is according to postgresql intervals
55 config.delegation_warning_time = '6 months'
57 config.mail_subject_prefix = "[LiquidFeedback] "
59 config.fastpath_url_func = nil
61 config.download_dir = nil
63 config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten"
65 config.public_access = false -- Available options: "anonymous", "pseudonym"
67 config.api_enabled = true
69 config.feature_rss_enabled = false -- feature is broken
71 config.single_unit_id = false
73 -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
74 config.auth_openid_enabled = false
75 config.auth_openid_https_as_default = true
76 config.auth_openid_identifier_check_func = function(uri) return false end
78 request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" }
80 if request.get_json_request_slots() then
81 request.force_absolute_baseurl()
82 end
84 request.set_404_route{ module = 'index', view = '404' }
86 -- uncomment the following two lines to use C implementations of chosen
87 -- functions and to disable garbage collection during the request, to
88 -- increase speed:
89 --
90 -- require 'webmcp_accelerator'
91 -- collectgarbage("stop")
93 -- open and set default database handle
94 db = assert(mondelefant.connect{
95 engine='postgresql',
96 dbname='liquid_feedback_p'
97 })
98 at_exit(function()
99 db:close()
100 end)
101 function mondelefant.class_prototype:get_db_conn() return db end
103 -- enable output of SQL commands in trace system
104 function db:sql_tracer(command)
105 return function(error_info)
106 local error_info = error_info or {}
107 trace.sql{ command = command, error_position = error_info.position }
108 end
109 end
112 -- TODO abstraction
113 -- get record by id
114 function mondelefant.class_prototype:by_id(id)
115 local selector = self:new_selector()
116 selector:add_where{ 'id = ?', id }
117 selector:optional_object_mode()
118 return selector:exec()
119 end
121 config.formatting_engine_executeables = {
122 rocketwiki= "/opt/rocketwiki-lqfb/rocketwiki-lqfb",
123 compat = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat"
124 }
126 config.fastpath_url_func = function(member_id, image_type)
127 return request.get_absolute_baseurl() .. "fastpath/getpic?" .. tostring(member_id) .. "+" .. tostring(image_type)
128 end