Skip to content

Commit

Permalink
Add global trackback disable setting. Closes #860
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.typosphere.org/typo/trunk@1142 820eb932-12ee-0310-9ca8-eeb645f39767
  • Loading branch information
scott committed Jul 19, 2006
1 parent 5688ae2 commit 9119818
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/blog.rb
Expand Up @@ -54,6 +54,7 @@ def before(date = Time.now)
setting :show_extended_on_rss, :boolean, true
setting :theme, :string, 'azure'
setting :use_gravatar, :boolean, false
setting :global_pings_disable, :boolean, false
setting :ping_urls, :string, "http://rpc.technorati.com/rpc/ping\nhttp://ping.blo.gs/\nhttp://rpc.weblogs.com/RPC2"
setting :send_outbound_pings, :boolean, true
setting :email_from, :string, 'typo@example.com'
Expand Down
3 changes: 3 additions & 0 deletions app/models/trackback.rb
Expand Up @@ -43,6 +43,9 @@ def process_trackback

def article_is_pingable
return if article.nil?
if blog.global_pings_disable
errors.add(:article, "Pings are disabled")
end
unless article.allow_pings?
errors.add(:article, "Article is not pingable")
end
Expand Down
16 changes: 16 additions & 0 deletions app/views/admin/general/index.rhtml
Expand Up @@ -78,6 +78,22 @@

<hr/>

<p>This setting allows you to disable trackbacks for every article in
your blog. It won't remove existing trackbacks, but it will prevent
any further attempt to add a trackback anywhere on your blog. You can
enable or disable trackbacks per-article using the article's extended
settings. See also the
<a href="#gensettings" onclick="new Effect.ScrollTo('gensettings'); return false">"Enable Trackbacks by default" setting</a> above.
</p>
<p>
<input name="setting[global_pings_disable]" id="global_pings_disable" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.global_pings_disable%> />
<input name="setting[global_pings_disable]" type="hidden" value="0"/>
<label for="global_pings_disable">Disable trackbacks site-wide</label>

</p>

<hr />

<p>Should Typo send trackbacks to websites that you link to? This should be disabled
for private blogs, as it will leak non-public information to sites that you're discussing.
For public blogs, there's no real point in disabling this.</p>
Expand Down

0 comments on commit 9119818

Please sign in to comment.