##// END OF EJS Templates
Resourcified documents....
Resourcified documents. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8010 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r6779:43eb8c3455f9
r7890:c3c2a4afe008
Show More
auth_sources_controller.rb
87 lines | 2.5 KiB | text/x-ruby | RubyLexer
/ app / controllers / auth_sources_controller.rb
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/auth_sources_controller.rb....
r6779 # Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
Jean-Philippe Lang
0.3 unstable...
r10 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/auth_sources_controller.rb....
r6779 #
Jean-Philippe Lang
0.3 unstable...
r10 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/auth_sources_controller.rb....
r6779 #
Jean-Philippe Lang
0.3 unstable...
r10 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class AuthSourcesController < ApplicationController
Jean-Philippe Lang
Adds an admin layout that displays the admin menu in the sidebar....
r3062 layout 'admin'
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/auth_sources_controller.rb....
r6779
Jean-Philippe Lang
0.3 unstable...
r10 before_filter :require_admin
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630 :redirect_to => { :template => :index }
Jean-Philippe Lang
0.3 unstable...
r10
Eric Davis
Refactor: Merged AuthSourcesController#list and #index...
r3322 def index
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630 @auth_source_pages, @auth_sources = paginate auth_source_class.name.tableize, :per_page => 10
render "auth_sources/index"
Jean-Philippe Lang
0.3 unstable...
r10 end
def new
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630 @auth_source = auth_source_class.new
render 'auth_sources/new'
Jean-Philippe Lang
0.3 unstable...
r10 end
def create
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630 @auth_source = auth_source_class.new(params[:auth_source])
Jean-Philippe Lang
0.3 unstable...
r10 if @auth_source.save
flash[:notice] = l(:notice_successful_create)
Eric Davis
Refactor: Merged AuthSourcesController#list and #index...
r3322 redirect_to :action => 'index'
Jean-Philippe Lang
0.3 unstable...
r10 else
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630 render 'auth_sources/new'
Jean-Philippe Lang
0.3 unstable...
r10 end
end
def edit
@auth_source = AuthSource.find(params[:id])
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630 render 'auth_sources/edit'
Jean-Philippe Lang
0.3 unstable...
r10 end
def update
@auth_source = AuthSource.find(params[:id])
if @auth_source.update_attributes(params[:auth_source])
flash[:notice] = l(:notice_successful_update)
Eric Davis
Refactor: Merged AuthSourcesController#list and #index...
r3322 redirect_to :action => 'index'
Jean-Philippe Lang
0.3 unstable...
r10 else
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630 render 'auth_sources/edit'
Jean-Philippe Lang
0.3 unstable...
r10 end
end
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/auth_sources_controller.rb....
r6779
Jean-Philippe Lang
0.3 unstable...
r10 def test_connection
@auth_method = AuthSource.find(params[:id])
begin
@auth_method.test_connection
Jean-Philippe Lang
Added LDAPS support migration and fixed connection test flash messages....
r832 flash[:notice] = l(:notice_successful_connection)
Jean-Philippe Lang
0.3 unstable...
r10 rescue => text
Azamat Hackimov
New strings to localization (#5225)...
r3513 flash[:error] = l(:error_unable_to_connect, text.message)
Jean-Philippe Lang
0.3 unstable...
r10 end
Eric Davis
Refactor: Merged AuthSourcesController#list and #index...
r3322 redirect_to :action => 'index'
Jean-Philippe Lang
0.3 unstable...
r10 end
def destroy
@auth_source = AuthSource.find(params[:id])
unless @auth_source.users.find(:first)
@auth_source.destroy
flash[:notice] = l(:notice_successful_delete)
end
Eric Davis
Refactor: Merged AuthSourcesController#list and #index...
r3322 redirect_to :action => 'index'
Jean-Philippe Lang
0.3 unstable...
r10 end
Eric Davis
Refactor AuthSourcesController to support non-LDAP sources. #1131...
r3630
protected
def auth_source_class
AuthSource
end
Jean-Philippe Lang
0.3 unstable...
r10 end