Commit 74a7982ad133cdd7fddd437077c5239a228649af

Authored by gtaaas
1 parent 3c628436
Exists in master and in 1 other branch devel

M1.0 - Inclusão do FLV no filtro de vídeos / Aplicado verificação de usuário em …

…todos os passos da interface
app/assets/javascripts/site/videos.js
... ... @@ -8,7 +8,7 @@ function check_subtitle(file) {
8 8 };
9 9  
10 10 function check_video(file) {
11   - var accepted_file_types = ["ts", "avi", "mp4", "mov", "webm", "wmv", "mkv",];
  11 + var accepted_file_types = ["flv", "ts", "avi", "mp4", "mov", "webm", "wmv", "mkv",];
12 12 return check_type(file, accepted_file_types)
13 13 };
14 14  
... ...
app/controllers/static_controller.rb
1 1 # Author - Igor Portela - igorportela.com | Copyright(c) 2013. All rights reserved.
2 2 class StaticController < ApplicationController
3   - #before_filter :authenticate_user!
  3 + before_filter :authenticate_user!
4 4  
5 5 def choice
6 6 end
... ... @@ -9,7 +9,7 @@ class StaticController &lt; ApplicationController
9 9 end
10 10  
11 11 def upload
12   - @presenter = Static::IndexPresenter.new if authenticate_user!
  12 + @presenter = Static::IndexPresenter.new #if authenticate_user!
13 13  
14 14 end
15 15  
... ... @@ -25,6 +25,8 @@ class StaticController &lt; ApplicationController
25 25 @presenter = Static::IndexPresenter.new(params[:id])
26 26 if !@presenter.subtitle.window_size.present?
27 27  
  28 + #raise current_user.inspect
  29 +
28 30 @presenter.subtitle.update_attributes(:window_size => params[:window_size], :window_position => params[:window_position], :closed_caption => params[:closed_caption], :user_id => current_user.id)
29 31 end
30 32  
... ...
config/initializers/devise.rb
... ... @@ -116,7 +116,7 @@ Devise.setup do |config|
116 116 # ==> Configuration for :timeoutable
117 117 # The time you want to timeout the user session without activity. After this
118 118 # time the user will be asked for credentials again. Default is 30 minutes.
119   - # config.timeout_in = 30.minutes
  119 + config.timeout_in = 2.weeks
120 120  
121 121 # ==> Configuration for :lockable
122 122 # Defines which strategy will be used to lock an account.
... ...
config/libras@150.165.204.30 0 → 100644
... ... @@ -0,0 +1,40 @@
  1 +# Author - Igor Portela - igorportela.com | Copyright(c) 2013. All rights reserved.
  2 +#
  3 +# Author Igor Amorim - www.igoramorim.com
  4 +#
  5 +worker_processes 2
  6 +APP_PATH = "/home/gtaaas/gtaaas_web/"
  7 +working_directory APP_PATH
  8 +
  9 +# This loads the application in the master process before forking
  10 +# worker processes
  11 +# Read more about it here:
  12 +# http://unicorn.bogomips.org/Unicorn/Configurator.html
  13 +preload_app true
  14 +
  15 +timeout 30
  16 +
  17 +# This is where we specify the socket.
  18 +# We will point the upstream Nginx module to this socket later on
  19 +listen "unix:#{APP_PATH}tmp/sockets/unicorn.sock", :backlog => 64
  20 +
  21 +pid "#{APP_PATH}tmp/pids/unicorn.pid"
  22 +
  23 +# Set the path of the log files inside the log folder of the testapp
  24 +stderr_path "#{APP_PATH}log/unicorn.stderr.log"
  25 +stdout_path "#{APP_PATH}log/unicorn.stdout.log"
  26 +
  27 +before_fork do |server, worker|
  28 +# This option works in together with preload_app true setting
  29 +# What is does is prevent the master process from holding
  30 +# the database connection
  31 + defined?(ActiveRecord::Base) and
  32 + ActiveRecord::Base.connection.disconnect!
  33 +end
  34 +
  35 +after_fork do |server, worker|
  36 +# Here we are establishing the connection after forking worker
  37 +# processes
  38 + defined?(ActiveRecord::Base) and
  39 + ActiveRecord::Base.establish_connection
  40 +end
... ...