bsw@525: -- forward compatibility for webmcp 1.2
bsw@525: if not os.pfilter then
bsw@525: os.pfilter = extos.pfilter
bsw@525: end
bsw@525: if not os.listdir then
bsw@525: os.listdir = extos.listdir
bsw@525: end
bsw@525: if not os.crypt then
bsw@525: os.crypt = extos.crypt
bsw@525: end
bsw@525:
bsw/jbe@0: config.app_name = "LiquidFeedback"
bsw@510: config.app_version = "2.beta4"
bsw/jbe@0:
bsw@525: config.instance_name = request.get_config_name()
bsw@525:
bsw@525: config.app_title = config.app_name .. " " .. config.instance_name
bsw/jbe@0:
bsw/jbe@4: config.app_logo = nil
bsw/jbe@4:
bsw/jbe@0: config.app_service_provider = "Snake Oil
10000 Berlin
Germany"
bsw/jbe@0:
bsw@88: --config.footer_html = 'some link'
bsw@88:
jbe@232: config.use_terms = "=== Terms of Use ===\nNothing is allowed."
bsw@79: --config.use_terms_html = ""
bsw@79:
bsw@79: config.use_terms_checkboxes = {
bsw@79: {
jbe@232: name = "terms_of_use_v1",
jbe@232: html = "I accept the terms of use.",
jbe@232: not_accepted_error = "You have to accept the terms of use to be able to register."
bsw@79: }
bsw@79: }
bsw@79:
bsw@286: config.locked_profile_fields = {
bsw@286: field_name = true,
bsw@286: }
bsw/jbe@6:
bsw/jbe@52: config.member_image_content_type = "image/jpeg"
bsw/jbe@4: config.member_image_convert_func = {
bsw/jbe@4: avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
bsw/jbe@4: photo = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
bsw@2: }
bsw@2:
bsw/jbe@4: config.member_image_default_file = {
bsw/jbe@4: avatar = "avatar.jpg",
bsw/jbe@4: photo = nil
bsw/jbe@4: }
bsw/jbe@4:
poelzi@163: config.default_lang = "de"
poelzi@163:
bsw@203: -- after how long is a user considered inactive and the trustee will see warning
bsw@204: -- notation is according to postgresql intervals
bsw@203: config.delegation_warning_time = '6 months'
poelzi@152:
bsw/jbe@6: config.mail_subject_prefix = "[LiquidFeedback] "
bsw/jbe@6:
bsw/jbe@4: config.fastpath_url_func = nil
bsw/jbe@4:
bsw/jbe@6: config.download_dir = nil
bsw/jbe@6:
bsw/jbe@6: config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten"
bsw/jbe@4:
bsw@51: config.public_access = false -- Available options: "anonymous", "pseudonym"
bsw@51:
bsw@186: config.api_enabled = true
bsw@51:
bsw@75: config.feature_rss_enabled = false -- feature is broken
bsw/jbe@52:
bsw@271: config.single_unit_id = false
bsw@261:
bsw@51: -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
bsw@51: config.auth_openid_enabled = false
bsw@51: config.auth_openid_https_as_default = true
bsw@51: config.auth_openid_identifier_check_func = function(uri) return false end
bsw@51:
bsw/jbe@19: request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" }
bsw/jbe@19:
bsw@51:
bsw/jbe@19: if request.get_json_request_slots() then
bsw/jbe@19: request.force_absolute_baseurl()
bsw/jbe@19: end
bsw@8:
bsw@8: request.set_404_route{ module = 'index', view = '404' }
bsw@8:
bsw/jbe@0: -- uncomment the following two lines to use C implementations of chosen
bsw/jbe@0: -- functions and to disable garbage collection during the request, to
bsw/jbe@0: -- increase speed:
bsw/jbe@0: --
bsw@525: require 'webmcp_accelerator'
bsw@525: collectgarbage("stop")
bsw/jbe@0:
bsw/jbe@0: -- open and set default database handle
bsw/jbe@0: db = assert(mondelefant.connect{
bsw/jbe@0: engine='postgresql',
bsw/jbe@0: dbname='liquid_feedback'
bsw/jbe@0: })
bsw/jbe@0: at_exit(function()
bsw/jbe@0: db:close()
bsw/jbe@0: end)
bsw/jbe@0: function mondelefant.class_prototype:get_db_conn() return db end
bsw/jbe@0:
bsw/jbe@0: -- enable output of SQL commands in trace system
bsw/jbe@0: function db:sql_tracer(command)
bsw/jbe@0: return function(error_info)
bsw/jbe@0: local error_info = error_info or {}
bsw/jbe@0: trace.sql{ command = command, error_position = error_info.position }
bsw/jbe@0: end
bsw/jbe@0: end
bsw/jbe@0:
bsw/jbe@6: request.set_absolute_baseurl(config.absolute_base_url)
bsw/jbe@0:
bsw/jbe@0:
bsw/jbe@0:
bsw@2: -- TODO abstraction
bsw/jbe@0: -- get record by id
bsw/jbe@0: function mondelefant.class_prototype:by_id(id)
bsw/jbe@0: local selector = self:new_selector()
bsw/jbe@0: selector:add_where{ 'id = ?', id }
bsw/jbe@0: selector:optional_object_mode()
bsw/jbe@0: return selector:exec()
bsw/jbe@0: end