liquid_feedback_frontend

annotate config/default.lua @ 728:f49cdfb72567

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

Impressum / About Us