works but need some cleanup
This commit is contained in:
parent
0ec83db287
commit
e40a859b7d
752 changed files with 4866 additions and 27923 deletions
63
config/application.rb
Executable file
63
config/application.rb
Executable file
|
@ -0,0 +1,63 @@
|
|||
require File.expand_path('../boot', __FILE__)
|
||||
|
||||
require 'rails/all'
|
||||
|
||||
# If you have a Gemfile, require the gems listed there, including any gems
|
||||
# you've limited to :test, :development, or :production.
|
||||
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
||||
|
||||
module Rails3
|
||||
class Application < Rails::Application
|
||||
# Settings in config/environments/* take precedence over those specified here.
|
||||
# Application configuration should go into files in config/initializers
|
||||
# -- all .rb files in that directory are automatically loaded.
|
||||
|
||||
# Custom directories with classes and modules you want to be autoloadable.
|
||||
# config.autoload_paths += %W(#{config.root}/extras)
|
||||
|
||||
config.autoload_paths << Rails.root.join("vendor/ezcrypto-0.1.1/lib")
|
||||
config.autoload_paths << Rails.root.join("lib/webmail")
|
||||
|
||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
||||
# :all can be used as a placeholder for all plugins not explicitly named.
|
||||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
||||
|
||||
# Activate observers that should always be running.
|
||||
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
||||
|
||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||
# config.time_zone = 'Central Time (US & Canada)'
|
||||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
#config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
#config.i18n.default_locale = :en
|
||||
|
||||
# JavaScript files you want as :defaults (application.js is always included).
|
||||
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
||||
|
||||
# Configure the default encoding used in templates for Ruby 1.9.
|
||||
config.encoding = "utf-8"
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
config.filter_parameters += [:password]
|
||||
|
||||
default_config_path = 'config/default_site'
|
||||
default_config = Rails.root.join(default_config_path)
|
||||
require default_config
|
||||
begin
|
||||
require Rails.root.join("config/site")
|
||||
CDF::CONFIG.update(CDF::LOCALCONFIG) if CDF::LOCALCONFIG
|
||||
rescue LoadError
|
||||
STDERR.puts 'WARNING: config/site.rb not found, using default settings from ' + default_config_path
|
||||
end
|
||||
|
||||
#if CONFIG[:locale] is nil then I18n.default_locale will be used
|
||||
config.i18n.default_locale = CDF::CONFIG[:locale]
|
||||
|
||||
require 'tmail_patch'
|
||||
$KCODE = 'u'
|
||||
require 'jcode'
|
||||
|
||||
end
|
||||
end
|
111
config/boot.rb
Normal file → Executable file
111
config/boot.rb
Normal file → Executable file
|
@ -1,109 +1,6 @@
|
|||
# Don't change this file!
|
||||
# Configure your app in config/environment.rb and config/environments/*.rb
|
||||
require 'rubygems'
|
||||
|
||||
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
||||
# Set up gems listed in the Gemfile.
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
|
||||
module Rails
|
||||
class << self
|
||||
def boot!
|
||||
unless booted?
|
||||
preinitialize
|
||||
pick_boot.run
|
||||
end
|
||||
end
|
||||
|
||||
def booted?
|
||||
defined? Rails::Initializer
|
||||
end
|
||||
|
||||
def pick_boot
|
||||
(vendor_rails? ? VendorBoot : GemBoot).new
|
||||
end
|
||||
|
||||
def vendor_rails?
|
||||
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
||||
end
|
||||
|
||||
def preinitialize
|
||||
load(preinitializer_path) if File.exist?(preinitializer_path)
|
||||
end
|
||||
|
||||
def preinitializer_path
|
||||
"#{RAILS_ROOT}/config/preinitializer.rb"
|
||||
end
|
||||
end
|
||||
|
||||
class Boot
|
||||
def run
|
||||
load_initializer
|
||||
Rails::Initializer.run(:set_load_path)
|
||||
end
|
||||
end
|
||||
|
||||
class VendorBoot < Boot
|
||||
def load_initializer
|
||||
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
||||
Rails::Initializer.run(:install_gem_spec_stubs)
|
||||
end
|
||||
end
|
||||
|
||||
class GemBoot < Boot
|
||||
def load_initializer
|
||||
self.class.load_rubygems
|
||||
load_rails_gem
|
||||
require 'initializer'
|
||||
end
|
||||
|
||||
def load_rails_gem
|
||||
if version = self.class.gem_version
|
||||
gem 'rails', version
|
||||
else
|
||||
gem 'rails'
|
||||
end
|
||||
rescue Gem::LoadError => load_error
|
||||
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
||||
exit 1
|
||||
end
|
||||
|
||||
class << self
|
||||
def rubygems_version
|
||||
Gem::RubyGemsVersion rescue nil
|
||||
end
|
||||
|
||||
def gem_version
|
||||
if defined? RAILS_GEM_VERSION
|
||||
RAILS_GEM_VERSION
|
||||
elsif ENV.include?('RAILS_GEM_VERSION')
|
||||
ENV['RAILS_GEM_VERSION']
|
||||
else
|
||||
parse_gem_version(read_environment_rb)
|
||||
end
|
||||
end
|
||||
|
||||
def load_rubygems
|
||||
require 'rubygems'
|
||||
min_version = '1.3.1'
|
||||
unless rubygems_version >= min_version
|
||||
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
||||
exit 1
|
||||
end
|
||||
|
||||
rescue LoadError
|
||||
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||
exit 1
|
||||
end
|
||||
|
||||
def parse_gem_version(text)
|
||||
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
||||
end
|
||||
|
||||
private
|
||||
def read_environment_rb
|
||||
File.read("#{RAILS_ROOT}/config/environment.rb")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# All that for this:
|
||||
Rails.boot!
|
||||
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
||||
|
|
0
config/default_site.rb
Normal file → Executable file
0
config/default_site.rb
Normal file → Executable file
84
config/environment.rb
Normal file → Executable file
84
config/environment.rb
Normal file → Executable file
|
@ -1,81 +1,5 @@
|
|||
# Be sure to restart your webserver when you modify this file.
|
||||
# Load the rails application
|
||||
require File.expand_path('../application', __FILE__)
|
||||
|
||||
# Uncomment below to force Rails into production mode
|
||||
# (Use only when you can't set environment variables through your web/app server)
|
||||
# ENV['RAILS_ENV'] = 'production'
|
||||
|
||||
#RAILS_GEM_VERSION = '2.3.3' unless defined? RAILS_GEM_VERSION
|
||||
|
||||
# Bootstrap the Rails environment, frameworks, and default configuration
|
||||
require File.join(File.dirname(__FILE__), 'boot')
|
||||
|
||||
Rails::Initializer.run do |config|
|
||||
# Skip frameworks you're not going to use
|
||||
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
||||
|
||||
# Add additional load paths for your own custom dirs
|
||||
config.load_paths += %W( #{RAILS_ROOT}/vendor/ezcrypto-0.1.1/lib )
|
||||
config.load_paths += %W( #{RAILS_ROOT}/lib/webmail )
|
||||
# Force all environments to use the same logger level
|
||||
# (by default production uses :info, the others :debug)
|
||||
# config.log_level = :debug
|
||||
|
||||
# Use the database for sessions instead of the file system
|
||||
# (create the session table with 'rake create_sessions_table')
|
||||
#config.action_controller.session_store = :active_record_store
|
||||
|
||||
# Enable page/fragment caching by setting a file-based store
|
||||
# (remember to create the caching directory and make it readable to the application)
|
||||
# config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
|
||||
|
||||
# Activate observers that should always be running
|
||||
# config.active_record.observers = :cacher, :garbage_collector
|
||||
|
||||
# Make Active Record use UTC-base instead of local time
|
||||
config.active_record.default_timezone = :utc
|
||||
|
||||
config.i18n.default_locale = "en"
|
||||
|
||||
# Use Active Record's schema dumper instead of SQL when creating the test database
|
||||
# (enables use of different database adapters for development and test environments)
|
||||
# config.active_record.schema_format = :ruby
|
||||
|
||||
# See Rails::Configuration for more options
|
||||
config.action_controller.session = { :session_key => "_mailr_session", :secret => "123456789012345678901234567890" }
|
||||
end
|
||||
|
||||
# Add new inflection rules using the following format
|
||||
# (all these examples are active by default):
|
||||
# Inflector.inflections do |inflect|
|
||||
# inflect.plural /^(ox)$/i, '\1en'
|
||||
# inflect.singular /^(ox)en/i, '\1'
|
||||
# inflect.irregular 'person', 'people'
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
|
||||
# Include your application configuration below
|
||||
|
||||
default_config_path = 'config/default_site'
|
||||
default_config = File.join(RAILS_ROOT, default_config_path)
|
||||
require default_config
|
||||
begin
|
||||
require File.join(RAILS_ROOT, 'config/site')
|
||||
CDF::CONFIG.update(CDF::LOCALCONFIG) if CDF::LOCALCONFIG
|
||||
rescue LoadError
|
||||
STDERR.puts 'WARNING: config/site.rb not found, using default settings from ' + default_config_path
|
||||
end
|
||||
|
||||
#if CONFIG[:locale] is nil then I18n.default_locale will be used
|
||||
I18n.default_locale = CDF::CONFIG[:locale]
|
||||
|
||||
require 'tmail_patch'
|
||||
$KCODE = 'u'
|
||||
require 'jcode'
|
||||
|
||||
# set UTF8 as a client interface to Database
|
||||
RAILS_DEFAULT_LOGGER.debug("Using MySQL Version #{CDF::CONFIG[:mysql_version]}")
|
||||
ActiveRecord::Base.connection.execute("SET NAMES utf8", 'Set Client encoding to UTF8') if CDF::CONFIG[:mysql_version] == '4.1'
|
||||
ActiveRecord::Base.connection.execute("set character set utf8", 'Set Connection encoding to UTF8') if CDF::CONFIG[:mysql_version] == '4.1'
|
||||
|
||||
require 'imapmailbox'
|
||||
[IMAPMailbox, IMAPFolderList, IMAPFolder].each { |mod| mod.logger ||= RAILS_DEFAULT_LOGGER }
|
||||
# Initialize the rails application
|
||||
Rails3::Application.initialize!
|
||||
|
|
34
config/environments/development.rb
Normal file → Executable file
34
config/environments/development.rb
Normal file → Executable file
|
@ -1,14 +1,26 @@
|
|||
# In the development environment your application's code is reloaded on
|
||||
# every request. This slows down response time but is perfect for development
|
||||
# since you don't have to restart the webserver when you make code changes.
|
||||
config.cache_classes = false
|
||||
Rails3::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
config.whiny_nils = true
|
||||
# In the development environment your application's code is reloaded on
|
||||
# every request. This slows down response time but is perfect for development
|
||||
# since you don't have to restart the webserver when you make code changes.
|
||||
config.cache_classes = false
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.action_controller.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
config.whiny_nils = true
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
config.action_view.debug_rjs = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Print deprecation notices to the Rails logger
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
# Only use best-standards-support built into browsers
|
||||
config.action_dispatch.best_standards_support = :builtin
|
||||
end
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
|
56
config/environments/production.rb
Normal file → Executable file
56
config/environments/production.rb
Normal file → Executable file
|
@ -1,17 +1,49 @@
|
|||
# The production environment is meant for finished, "live" apps.
|
||||
# Code is not reloaded between requests
|
||||
config.cache_classes = true
|
||||
Rails3::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# Use a different logger for distributed setups
|
||||
# config.logger = SyslogLogger.new
|
||||
# The production environment is meant for finished, "live" apps.
|
||||
# Code is not reloaded between requests
|
||||
config.cache_classes = true
|
||||
|
||||
# Full error reports are disabled and caching is turned on
|
||||
config.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Full error reports are disabled and caching is turned on
|
||||
config.action_controller.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
# Specifies the header that your server uses for sending files
|
||||
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
||||
|
||||
# Enable serving of images, stylesheets, and javascripts from an asset server
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
# For nginx:
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
||||
|
||||
# Disable delivery errors if you bad email addresses should just be ignored
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
# If you have no front-end server that supports something like X-Sendfile,
|
||||
# just comment this out and Rails will serve the files
|
||||
|
||||
# See everything in the log (default is :info)
|
||||
# config.log_level = :debug
|
||||
|
||||
# Use a different logger for distributed setups
|
||||
# config.logger = SyslogLogger.new
|
||||
|
||||
# Use a different cache store in production
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
# Disable Rails's static asset server
|
||||
# In production, Apache or nginx will already do this
|
||||
config.serve_static_assets = false
|
||||
|
||||
# Enable serving of images, stylesheets, and javascripts from an asset server
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
# Disable delivery errors, bad email addresses will be ignored
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Enable threaded mode
|
||||
# config.threadsafe!
|
||||
|
||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||
# the I18n.default_locale when a translation can not be found)
|
||||
config.i18n.fallbacks = true
|
||||
|
||||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
end
|
||||
|
|
50
config/environments/test.rb
Normal file → Executable file
50
config/environments/test.rb
Normal file → Executable file
|
@ -1,23 +1,35 @@
|
|||
# The test environment is used exclusively to run your application's
|
||||
# test suite. You never need to work with it otherwise. Remember that
|
||||
# your test database is "scratch space" for the test suite and is wiped
|
||||
# and recreated between test runs. Don't rely on the data there!
|
||||
config.cache_classes = true
|
||||
Rails3::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
config.whiny_nils = true
|
||||
# The test environment is used exclusively to run your application's
|
||||
# test suite. You never need to work with it otherwise. Remember that
|
||||
# your test database is "scratch space" for the test suite and is wiped
|
||||
# and recreated between test runs. Don't rely on the data there!
|
||||
config.cache_classes = true
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.action_controller.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
config.whiny_nils = true
|
||||
|
||||
# Tell ActionMailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Overwrite the default settings for fixtures in tests. See Fixtures
|
||||
# for more details about these settings.
|
||||
# config.transactional_fixtures = true
|
||||
# config.instantiated_fixtures = false
|
||||
# config.pre_loaded_fixtures = false
|
||||
# Raise exceptions instead of rendering exception templates
|
||||
config.action_dispatch.show_exceptions = false
|
||||
|
||||
# Disable request forgery protection in test environment
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
||||
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
||||
# like if you have constraints or database-specific column types
|
||||
# config.active_record.schema_format = :sql
|
||||
|
||||
# Print deprecation notices to the stderr
|
||||
config.active_support.deprecation = :stderr
|
||||
end
|
||||
|
|
7
config/initializers/backtrace_silencers.rb
Executable file
7
config/initializers/backtrace_silencers.rb
Executable file
|
@ -0,0 +1,7 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
||||
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
||||
|
||||
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
||||
# Rails.backtrace_cleaner.remove_silencers!
|
10
config/initializers/inflections.rb
Executable file
10
config/initializers/inflections.rb
Executable file
|
@ -0,0 +1,10 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new inflection rules using the following format
|
||||
# (all these examples are active by default):
|
||||
# ActiveSupport::Inflector.inflections do |inflect|
|
||||
# inflect.plural /^(ox)$/i, '\1en'
|
||||
# inflect.singular /^(ox)en/i, '\1'
|
||||
# inflect.irregular 'person', 'people'
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
5
config/initializers/mime_types.rb
Executable file
5
config/initializers/mime_types.rb
Executable file
|
@ -0,0 +1,5 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new mime types for use in respond_to blocks:
|
||||
# Mime::Type.register "text/richtext", :rtf
|
||||
# Mime::Type.register_alias "text/html", :iphone
|
36
config/initializers/pluralization.rb
Executable file
36
config/initializers/pluralization.rb
Executable file
|
@ -0,0 +1,36 @@
|
|||
# config/initializers/pluralization.rb
|
||||
module I18n::Backend::Pluralization
|
||||
# rules taken from : http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
|
||||
def pluralize(locale, entry, n)
|
||||
return entry unless entry.is_a?(Hash) && n
|
||||
if n == 0 && entry.has_key?(:zero)
|
||||
key = :zero
|
||||
else
|
||||
key = case locale
|
||||
when :pl # Polish
|
||||
n==1 ? :one : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? :few : :other
|
||||
when :cs, :sk # Czech, Slovak
|
||||
n==1 ? :one : (n>=2 && n<=4) ? :few : :other
|
||||
when lt # Lithuanian
|
||||
n%10==1 && n%100!=11 ? :one : n%10>=2 && (n%100<10 || n%100>=20) ? :few : :other
|
||||
when :lv # Latvian
|
||||
n%10==1 && n%100!=11 ? :one : n != 0 ? :few : :other
|
||||
when :ru, :uk, :sr, :hr # Russian, Ukrainian, Serbian, Croatian
|
||||
n%10==1 && n%100!=11 ? :one : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? :few : :other
|
||||
when :sl # Slovenian
|
||||
n%100==1 ? :one : n%100==2 ? :few : n%100==3 || n%100==4 ? :many : :other
|
||||
when :ro # Romanian
|
||||
n==1 ? :one : (n==0 || (n%100 > 0 && n%100 < 20)) ? :few : :other
|
||||
when :gd # Gaeilge
|
||||
n==1 ? :one : n==2 ? :two : :other;
|
||||
# add another language if you like...
|
||||
else
|
||||
n==1 ? :one : :other # default :en
|
||||
end
|
||||
end
|
||||
raise InvalidPluralizationData.new(entry, n) unless entry.has_key?(key)
|
||||
entry[key]
|
||||
end
|
||||
end
|
||||
|
||||
I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
|
7
config/initializers/secret_token.rb
Executable file
7
config/initializers/secret_token.rb
Executable file
|
@ -0,0 +1,7 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Your secret key for verifying the integrity of signed cookies.
|
||||
# If you change this key, all old signed cookies will become invalid!
|
||||
# Make sure the secret is at least 30 characters and all random,
|
||||
# no regular words or you'll be exposed to dictionary attacks.
|
||||
Rails3::Application.config.secret_token = 'ade84d567b0c637fd3547fd18b97d1677fd6ca3c5331e6ed1a1b13bb6a7823cc367cbe317caf102f29f8c35eb487ff3ca33e6321d037c14ebb055eb530841ff6'
|
8
config/initializers/session_store.rb
Executable file
8
config/initializers/session_store.rb
Executable file
|
@ -0,0 +1,8 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
Rails3::Application.config.session_store :cookie_store, :key => '_rails3_session'
|
||||
|
||||
# Use the database for sessions instead of the cookie-based default,
|
||||
# which shouldn't be used to store highly confidential information
|
||||
# (create the session table with "rails generate session_migration")
|
||||
# Rails3::Application.config.session_store :active_record_store
|
|
@ -1,79 +0,0 @@
|
|||
server.port = 80
|
||||
server.bind = "127.0.0.1"
|
||||
#server.event-handler = "freebsd-kqueue"
|
||||
|
||||
server.modules = ( "mod_rewrite", "mod_fastcgi", )
|
||||
server.indexfiles = ( "dispatch.fcgi" )
|
||||
server.document-root = "public/"
|
||||
server.error-handler-404 = "/dispatch.fcgi"
|
||||
server.errorlog = "log/error.log"
|
||||
|
||||
url.rewrite = ( "^/$" => "/login", "^([^.]+)$" => "$1.html" )
|
||||
|
||||
#### fastcgi module
|
||||
fastcgi.server = (
|
||||
".fcgi" => (
|
||||
"mailr" => (
|
||||
"min-procs" => 2,
|
||||
"max-procs" => 2,
|
||||
"socket" => "/tmp/mailr1.socket",
|
||||
"bin-path" => "public/dispatch.fcgi",
|
||||
"idle-timeout" => 120,
|
||||
"bin-environment" => ( "RAILS_ENV" => "production" )
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
mimetype.assign = (
|
||||
".rpm" => "application/x-rpm",
|
||||
".pdf" => "application/pdf",
|
||||
".sig" => "application/pgp-signature",
|
||||
".spl" => "application/futuresplash",
|
||||
".class" => "application/octet-stream",
|
||||
".ps" => "application/postscript",
|
||||
".torrent" => "application/x-bittorrent",
|
||||
".dvi" => "application/x-dvi",
|
||||
".gz" => "application/x-gzip",
|
||||
".pac" => "application/x-ns-proxy-autoconfig",
|
||||
".swf" => "application/x-shockwave-flash",
|
||||
".tar.gz" => "application/x-tgz",
|
||||
".tgz" => "application/x-tgz",
|
||||
".tar" => "application/x-tar",
|
||||
".zip" => "application/zip",
|
||||
".mp3" => "audio/mpeg",
|
||||
".m3u" => "audio/x-mpegurl",
|
||||
".wma" => "audio/x-ms-wma",
|
||||
".wax" => "audio/x-ms-wax",
|
||||
".ogg" => "audio/x-wav",
|
||||
".wav" => "audio/x-wav",
|
||||
".gif" => "image/gif",
|
||||
".jpg" => "image/jpeg",
|
||||
".jpeg" => "image/jpeg",
|
||||
".png" => "image/png",
|
||||
".xbm" => "image/x-xbitmap",
|
||||
".xpm" => "image/x-xpixmap",
|
||||
".xwd" => "image/x-xwindowdump",
|
||||
".css" => "text/css",
|
||||
".html" => "text/html",
|
||||
".htm" => "text/html",
|
||||
".js" => "text/javascript",
|
||||
".asc" => "text/plain",
|
||||
".c" => "text/plain",
|
||||
".conf" => "text/plain",
|
||||
".text" => "text/plain",
|
||||
".txt" => "text/plain",
|
||||
".dtd" => "text/xml",
|
||||
".xml" => "text/xml",
|
||||
".mpeg" => "video/mpeg",
|
||||
".mpg" => "video/mpeg",
|
||||
".mov" => "video/quicktime",
|
||||
".qt" => "video/quicktime",
|
||||
".avi" => "video/x-msvideo",
|
||||
".asf" => "video/x-ms-asf",
|
||||
".asx" => "video/x-ms-asf",
|
||||
".wmv" => "video/x-ms-wmv",
|
||||
".bz2" => "application/x-bzip",
|
||||
".tbz" => "application/x-bzip-compressed-tar",
|
||||
".tar.bz2" => "application/x-bzip-compressed-tar"
|
||||
)
|
7
config/locales/en.yml
Normal file → Executable file
7
config/locales/en.yml
Normal file → Executable file
|
@ -1,7 +1,7 @@
|
|||
en:
|
||||
mailr: Mailr
|
||||
email: Email
|
||||
password: Password
|
||||
password: Password
|
||||
log_in: Log In
|
||||
wrong_email_or_password: Wrong email or password specified.
|
||||
mailbox: Mailbox
|
||||
|
@ -46,7 +46,7 @@ en:
|
|||
cc: CC
|
||||
bcc: BCC
|
||||
send: Send
|
||||
choose_address: Choose addresses from contacts
|
||||
choose_address: Choose addresses from contacts
|
||||
compose_txt: Compose new mail
|
||||
attachment: Attachment
|
||||
add: Add
|
||||
|
@ -59,8 +59,9 @@ en:
|
|||
save: Save
|
||||
cancel: Cancel
|
||||
add_one_contact: Add one contact
|
||||
add_multiple: Add multiple
|
||||
add_multiple: Add multiple
|
||||
name: name
|
||||
add_folder: Add folder
|
||||
total_messages: Total messages
|
||||
unseen: Unseen
|
||||
please_login: Log in
|
||||
|
|
0
config/locales/es-ES.yml
Normal file → Executable file
0
config/locales/es-ES.yml
Normal file → Executable file
6
config/locales/pl-PL.yml → config/locales/pl.yml
Normal file → Executable file
6
config/locales/pl-PL.yml → config/locales/pl.yml
Normal file → Executable file
|
@ -1,4 +1,4 @@
|
|||
pl-PL:
|
||||
pl:
|
||||
mailr: Mailr
|
||||
email: E-mail
|
||||
password: Hasło
|
||||
|
@ -7,7 +7,7 @@ pl-PL:
|
|||
mailbox: Poczta
|
||||
folders: Foldery
|
||||
folder: Folder
|
||||
empty: Pusty
|
||||
empty: Opróżnij
|
||||
logout: Wyloguj
|
||||
compose: Nowa wiadomość
|
||||
preferences: Ustawienia
|
||||
|
@ -68,3 +68,5 @@ pl-PL:
|
|||
user_logged_out: Użytkownik został wylogowany
|
||||
please_login: Logowanie
|
||||
add_to_contacts: Dodaj do kontaktów
|
||||
want_to_empty_trash_message: Czy chcesz opróznic kosz?
|
||||
|
99
config/routes.rb
Normal file → Executable file
99
config/routes.rb
Normal file → Executable file
|
@ -1,27 +1,78 @@
|
|||
ActionController::Routing::Routes.draw do |map|
|
||||
map.resources :folders, :requirements => {:id => /[^\/]+/}
|
||||
map.resources :contacts, :member => {:add_from_mail => :get}, :collection => {:add_multiple => :get}
|
||||
map.resources :contact_groups
|
||||
Rails3::Application.routes.draw do
|
||||
resources :folders
|
||||
resources :contacts do
|
||||
collection do
|
||||
get :add_multiple
|
||||
end
|
||||
member do
|
||||
get :add_from_mail
|
||||
end
|
||||
end
|
||||
|
||||
# Add your own custom routes here.
|
||||
# The priority is based upon order of creation: first created -> highest priority.
|
||||
|
||||
# Here's a sample route:
|
||||
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
||||
# Keep in mind you can assign values other than :controller and :action
|
||||
map.root :controller=>'webmail', :action=>'index'
|
||||
resources :contact_groups
|
||||
match '/' => 'webmail#index'
|
||||
match 'webmail' => 'webmail#index'
|
||||
match 'webmail/:action' => 'webmail#index'
|
||||
match '/contact/:action' => 'contacts#index'
|
||||
match 'admin/main' => 'login#logout'
|
||||
match ':controller/service.wsdl' => '#wsdl'
|
||||
match '/:controller(/:action(/:id))'
|
||||
|
||||
map.connect 'webmail', :controller=>'webmail', :action=>'index'
|
||||
|
||||
map.connect 'webmail/:action', :controller=>'webmail'
|
||||
|
||||
map.connect '/contact/:action', :controller=>'contacts'
|
||||
|
||||
map.connect 'admin/main', :controller=> 'login', :action=>'logout'
|
||||
# Allow downloading Web Service WSDL as a file with an extension
|
||||
# instead of a file named 'wsdl'
|
||||
map.connect ':controller/service.wsdl', :action => 'wsdl'
|
||||
|
||||
# Install the default route as the lowest priority.
|
||||
map.connect ':controller/:action/:id'
|
||||
end
|
||||
|
||||
# The priority is based upon order of creation:
|
||||
# first created -> highest priority.
|
||||
|
||||
# Sample of regular route:
|
||||
# match 'products/:id' => 'catalog#view'
|
||||
# Keep in mind you can assign values other than :controller and :action
|
||||
|
||||
# Sample of named route:
|
||||
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
||||
# This route can be invoked with purchase_url(:id => product.id)
|
||||
|
||||
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
||||
# resources :products
|
||||
|
||||
# Sample resource route with options:
|
||||
# resources :products do
|
||||
# member do
|
||||
# get 'short'
|
||||
# post 'toggle'
|
||||
# end
|
||||
#
|
||||
# collection do
|
||||
# get 'sold'
|
||||
# end
|
||||
# end
|
||||
|
||||
# Sample resource route with sub-resources:
|
||||
# resources :products do
|
||||
# resources :comments, :sales
|
||||
# resource :seller
|
||||
# end
|
||||
|
||||
# Sample resource route with more complex sub-resources
|
||||
# resources :products do
|
||||
# resources :comments
|
||||
# resources :sales do
|
||||
# get 'recent', :on => :collection
|
||||
# end
|
||||
# end
|
||||
|
||||
# Sample resource route within a namespace:
|
||||
# namespace :admin do
|
||||
# # Directs /admin/products/* to Admin::ProductsController
|
||||
# # (app/controllers/admin/products_controller.rb)
|
||||
# resources :products
|
||||
# end
|
||||
|
||||
# You can have the root of your site routed with "root"
|
||||
# just remember to delete public/index.html.
|
||||
# root :to => "welcome#index"
|
||||
|
||||
# See how all your routes lay out with "rake routes"
|
||||
|
||||
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
||||
# Note: This route will make all actions in every controller accessible via GET requests.
|
||||
# match ':controller(/:action(/:id(.:format)))'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue