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 'clamav-client', require: 'clamav/client'
|
||||
|
||||
gem 'carrierwave'
|
||||
|
||||
gem 'pg'
|
||||
|
|
|
@ -100,6 +100,7 @@ GEM
|
|||
chartkick (1.3.2)
|
||||
childprocess (0.5.5)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
clamav-client (3.0.0)
|
||||
cliver (0.3.2)
|
||||
coderay (1.1.0)
|
||||
coffee-rails (4.1.0)
|
||||
|
@ -489,6 +490,7 @@ DEPENDENCIES
|
|||
capybara
|
||||
carrierwave
|
||||
chartkick
|
||||
clamav-client
|
||||
coffee-rails (~> 4.1.0)
|
||||
css_splitter
|
||||
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
|
||||
errors << piece_justificative.errors.messages[:content][0]+" (#{piece_justificative.libelle})"+"<br>"
|
||||
end
|
||||
|
||||
unless ClamavService.safe_file? piece_justificative.content
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
errors
|
||||
|
|
Loading…
Reference in a new issue