diff options
Diffstat (limited to 'app/controllers/wiki_controller.rb')
-rw-r--r-- | app/controllers/wiki_controller.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 9e750b3a6..f68b71ecc 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -18,7 +18,10 @@ class WikiController < ApplicationController layout 'base' before_filter :find_wiki, :check_project_privacy, :except => [:preview] - + before_filter :authorize, :only => :destroy + + verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :index } + # display a page (in editing mode if it doesn't exist) def index page_title = params[:page] @@ -72,6 +75,13 @@ class WikiController < ApplicationController :select => "id, author_id, comments, updated_on, version", :order => 'version DESC' end + + # remove a wiki page and its history + def destroy + @page = @wiki.find_page(params[:page]) + @page.destroy if @page + redirect_to :action => 'special', :id => @project, :page => 'Page_index' + end # display special pages def special |