liquid_feedback_frontend

annotate config/default.lua @ 533:c92e2f2dcc2e

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

Impressum / About Us