bsw/jbe@0: config.app_name = "LiquidFeedback" bsw@175: config.app_version = "beta29" bsw/jbe@0: bsw/jbe@0: config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" 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: bsw/jbe@6: config.use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten" bsw@79: --config.use_terms_html = "" bsw@79: bsw@79: config.use_terms_checkboxes = { bsw@79: { bsw@79: name = "nutzungsbedingungen_v1", bsw@79: html = "Ich akzeptiere die Bedingungen.", bsw@79: not_accepted_error = "Du musst die Bedingungen akzeptieren, um dich zu registrieren." bsw@79: } bsw@79: } bsw@79: 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: poelzi@148: config.auto_support = true poelzi@148: bsw@174: -- after how long is a user considered inactive and the trustee will see warning\ bsw@174: -- will not work unless config.last_login_enabled is set to true bsw@174: -- notation is according to postgresql intervals, nil turns off feature poelzi@152: config.delegation_warning_time = '6 weeks' 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@51: config.api_enabled = false bsw@51: bsw@75: config.feature_rss_enabled = false -- feature is broken bsw/jbe@52: bsw@174: -- Saving last login of user in database bsw@174: config.last_login_enabled = true bsw@174: 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/jbe@0: -- require 'webmcp_accelerator' bsw/jbe@0: -- 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 bsw/jbe@0: bsw@2: