First test
This commit is contained in:
parent
8812ba2507
commit
1a3c19f48c
4 changed files with 14 additions and 0 deletions
2
Gemfile
2
Gemfile
|
@ -53,6 +53,8 @@ gem 'openid_connect'
|
||||||
|
|
||||||
gem 'rest-client'
|
gem 'rest-client'
|
||||||
|
|
||||||
|
gem 'clamav-client', require: 'clamav/client'
|
||||||
|
|
||||||
gem 'carrierwave'
|
gem 'carrierwave'
|
||||||
|
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
|
|
|
@ -100,6 +100,7 @@ GEM
|
||||||
chartkick (1.3.2)
|
chartkick (1.3.2)
|
||||||
childprocess (0.5.5)
|
childprocess (0.5.5)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
|
clamav-client (3.0.0)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
coderay (1.1.0)
|
coderay (1.1.0)
|
||||||
coffee-rails (4.1.0)
|
coffee-rails (4.1.0)
|
||||||
|
@ -489,6 +490,7 @@ DEPENDENCIES
|
||||||
capybara
|
capybara
|
||||||
carrierwave
|
carrierwave
|
||||||
chartkick
|
chartkick
|
||||||
|
clamav-client
|
||||||
coffee-rails (~> 4.1.0)
|
coffee-rails (~> 4.1.0)
|
||||||
css_splitter
|
css_splitter
|
||||||
database_cleaner
|
database_cleaner
|
||||||
|
|
6
app/services/clamav_service.rb
Normal file
6
app/services/clamav_service.rb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
class ClamavService
|
||||||
|
def self.safe_file? path
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
|
@ -13,6 +13,10 @@ class PiecesJustificativesService
|
||||||
unless piece_justificative.save
|
unless piece_justificative.save
|
||||||
errors << piece_justificative.errors.messages[:content][0]+" (#{piece_justificative.libelle})"+"<br>"
|
errors << piece_justificative.errors.messages[:content][0]+" (#{piece_justificative.libelle})"+"<br>"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless ClamavService.safe_file? piece_justificative.content
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
errors
|
errors
|
||||||
|
|
Loading…
Add table
Reference in a new issue