liquid_feedback_frontend

view config/default.lua @ 537:346eb72a2a6a

merge
author jbe
date Tue May 22 03:07:14 2012 +0200 (2012-05-22)
parents c92e2f2dcc2e 62923420b7f8
children 9f8aa189cac4
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.beta5"
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.default_lang = "de"
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" }
81 if request.get_json_request_slots() then
82 request.force_absolute_baseurl()
83 end
85 request.set_404_route{ module = 'index', view = '404' }
87 -- uncomment the following two lines to use C implementations of chosen
88 -- functions and to disable garbage collection during the request, to
89 -- increase speed:
90 --
91 require 'webmcp_accelerator'
92 collectgarbage("stop")
94 -- open and set default database handle
95 db = assert(mondelefant.connect{
96 engine='postgresql',
97 dbname='liquid_feedback'
98 })
99 at_exit(function()
100 db:close()
101 end)
102 function mondelefant.class_prototype:get_db_conn() return db end
104 -- enable output of SQL commands in trace system
105 function db:sql_tracer(command)
106 return function(error_info)
107 local error_info = error_info or {}
108 trace.sql{ command = command, error_position = error_info.position }
109 end
110 end
112 request.set_absolute_baseurl(config.absolute_base_url)
116 -- TODO abstraction
117 -- get record by id
118 function mondelefant.class_prototype:by_id(id)
119 local selector = self:new_selector()
120 selector:add_where{ 'id = ?', id }
121 selector:optional_object_mode()
122 return selector:exec()
123 end

Impressum / About Us