##// END OF EJS Templates
added some diagnostic information on admin/info...
Jean-Philippe Lang -
r356:f3f75f557a34
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -1,56 +1,58
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class AdminController < ApplicationController
18 class AdminController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :require_admin
20 before_filter :require_admin
21
21
22 helper :sort
22 helper :sort
23 include SortHelper
23 include SortHelper
24
24
25 def index
25 def index
26 end
26 end
27
27
28 def projects
28 def projects
29 sort_init 'name', 'asc'
29 sort_init 'name', 'asc'
30 sort_update
30 sort_update
31 @project_count = Project.count
31 @project_count = Project.count
32 @project_pages = Paginator.new self, @project_count,
32 @project_pages = Paginator.new self, @project_count,
33 15,
33 15,
34 params['page']
34 params['page']
35 @projects = Project.find :all, :order => sort_clause,
35 @projects = Project.find :all, :order => sort_clause,
36 :limit => @project_pages.items_per_page,
36 :limit => @project_pages.items_per_page,
37 :offset => @project_pages.current.offset
37 :offset => @project_pages.current.offset
38
38
39 render :action => "projects", :layout => false if request.xhr?
39 render :action => "projects", :layout => false if request.xhr?
40 end
40 end
41
41
42 def mail_options
42 def mail_options
43 @actions = Permission.find(:all, :conditions => ["mail_option=?", true]) || []
43 @actions = Permission.find(:all, :conditions => ["mail_option=?", true]) || []
44 if request.post?
44 if request.post?
45 @actions.each { |a|
45 @actions.each { |a|
46 a.mail_enabled = (params[:action_ids] || []).include? a.id.to_s
46 a.mail_enabled = (params[:action_ids] || []).include? a.id.to_s
47 a.save
47 a.save
48 }
48 }
49 flash.now[:notice] = l(:notice_successful_update)
49 flash.now[:notice] = l(:notice_successful_update)
50 end
50 end
51 end
51 end
52
52
53 def info
53 def info
54 @db_adapter_name = ActiveRecord::Base.connection.adapter_name
54 @db_adapter_name = ActiveRecord::Base.connection.adapter_name
55 @default_admin_changed = User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?
56 @file_repository_writable = File.writable?(Attachment.storage_path)
55 end
57 end
56 end
58 end
@@ -1,3 +1,8
1 <h2><%=l(:label_information_plural)%></h2>
1 <h2><%=l(:label_information_plural)%></h2>
2
2
3 <p><%=l(:field_version)%>: <strong>redMine <%= Redmine::VERSION %></strong> (<%= @db_adapter_name %>)</p> No newline at end of file
3 <p><%=l(:field_version)%>: <strong>redMine <%= Redmine::VERSION %></strong> (<%= @db_adapter_name %>)</p>
4
5 <table class="list">
6 <tr class="odd"><td>File repository writable</td><td><%= image_tag (@file_repository_writable ? 'true' : 'false'), :style => "vertical-align:bottom;" %></td></tr>
7 <tr class="even"><td>Default administrator account changed</td><td><%= image_tag (@default_admin_changed ? 'true' : 'false'), :style => "vertical-align:bottom;" %></td></tr>
8 </table>
General Comments 0
You need to be logged in to leave comments. Login now