Commit 163d7b83b547e725c0cda92ffb9125844a8c1a28

Authored by Francisco Marcelo de Araújo Lima Júnior
1 parent 4e9672e7

change default return value

app/controllers/embed_controller.rb
@@ -4,7 +4,7 @@ class EmbedController < ApplicationController @@ -4,7 +4,7 @@ class EmbedController < ApplicationController
4 block = Block.find(params[:id]) 4 block = Block.find(params[:id])
5 source = params[:source] 5 source = params[:source]
6 6
7 - if !block.visible? 7 + if !block.embedable? || !block.visible?
8 render :template => 'shared/embed_denied.rhtml', :status => 403, :layout => "embed" 8 render :template => 'shared/embed_denied.rhtml', :status => 403, :layout => "embed"
9 else 9 else
10 locals = {:source => source, :block => block} 10 locals = {:source => source, :block => block}
app/models/block.rb
@@ -17,7 +17,7 @@ class Block < ActiveRecord::Base @@ -17,7 +17,7 @@ class Block < ActiveRecord::Base
17 named_scope :enabled, :conditions => { :enabled => true } 17 named_scope :enabled, :conditions => { :enabled => true }
18 18
19 def embedable? 19 def embedable?
20 - true 20 + false
21 end 21 end
22 22
23 def embed_code(url) 23 def embed_code(url)
app/views/shared/embed_denied.rhtml
1 <div id='not-found'> 1 <div id='not-found'>
2 - <p><%= _('Embed denied. The requested embed is disable.') %></p> 2 + <p><%= _('Embed denied.') %></p>
3 </div> 3 </div>