liquid_feedback_frontend
view config/default.lua @ 287:ee477a136fd4
Moved notification functions to model
author | bsw |
---|---|
date | Sat Feb 25 12:04:36 2012 +0100 (2012-02-25) |
parents | c587d8762e62 |
children | 07dc88da30cb |
line source
1 config.app_name = "LiquidFeedback"
2 config.app_version = "beta33"
4 config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
6 config.app_logo = nil
8 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
10 --config.footer_html = '<a href="somewhere">some link</a>'
12 config.use_terms = "=== Terms of Use ===\nNothing is allowed."
13 --config.use_terms_html = ""
15 config.use_terms_checkboxes = {
16 {
17 name = "terms_of_use_v1",
18 html = "I accept the terms of use.",
19 not_accepted_error = "You have to accept the terms of use to be able to register."
20 }
21 }
23 config.locked_profile_fields = {
24 field_name = true,
25 notify_email = true
26 }
28 config.member_image_content_type = "image/jpeg"
29 config.member_image_convert_func = {
30 avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
31 photo = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
32 }
34 config.member_image_default_file = {
35 avatar = "avatar.jpg",
36 photo = nil
37 }
39 config.default_lang = "de"
41 -- after how long is a user considered inactive and the trustee will see warning
42 -- notation is according to postgresql intervals
43 config.delegation_warning_time = '6 months'
45 config.mail_subject_prefix = "[LiquidFeedback] "
47 config.fastpath_url_func = nil
49 config.download_dir = nil
51 config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten"
53 config.public_access = false -- Available options: "anonymous", "pseudonym"
55 config.api_enabled = true
57 config.feature_rss_enabled = false -- feature is broken
59 config.single_unit_id = false
61 -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
62 config.auth_openid_enabled = false
63 config.auth_openid_https_as_default = true
64 config.auth_openid_identifier_check_func = function(uri) return false end
66 request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" }
69 if request.get_json_request_slots() then
70 request.force_absolute_baseurl()
71 end
73 request.set_404_route{ module = 'index', view = '404' }
75 -- uncomment the following two lines to use C implementations of chosen
76 -- functions and to disable garbage collection during the request, to
77 -- increase speed:
78 --
79 -- require 'webmcp_accelerator'
80 -- collectgarbage("stop")
82 -- open and set default database handle
83 db = assert(mondelefant.connect{
84 engine='postgresql',
85 dbname='liquid_feedback_p'
86 })
87 at_exit(function()
88 db:close()
89 end)
90 function mondelefant.class_prototype:get_db_conn() return db end
92 -- enable output of SQL commands in trace system
93 function db:sql_tracer(command)
94 return function(error_info)
95 local error_info = error_info or {}
96 trace.sql{ command = command, error_position = error_info.position }
97 end
98 end
100 request.set_absolute_baseurl(config.absolute_base_url)
104 -- TODO abstraction
105 -- get record by id
106 function mondelefant.class_prototype:by_id(id)
107 local selector = self:new_selector()
108 selector:add_where{ 'id = ?', id }
109 selector:optional_object_mode()
110 return selector:exec()
111 end