diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 2dc3ab1ca..8012b86d5 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -15,6 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +require 'rake' +require 'rails/info' class AdminController < ApplicationController layout 'admin' @@ -75,12 +77,39 @@ class AdminController < ApplicationController end def info - @db_adapter_name = ActiveRecord::Base.connection.adapter_name @checklist = [ [:text_default_administrator_account_changed, User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?], [:text_file_repository_writable, File.writable?(Attachment.storage_path)], [:text_plugin_assets_writable, File.writable?(Engines.public_directory)], [:text_rmagick_available, Object.const_defined?(:Magick)] ] + + app_servers = { + 'Mongrel' => {:name => 'Mongrel', :version => Proc.new{Mongrel::Const::MONGREL_VERSION}}, + 'Thin' => {:name => 'Thin', :version => Proc.new{Thin::VERSION::STRING}}, + 'Unicorn' => {:name => 'Unicorn', :version =>Proc.new{Unicorn::Const::UNICORN_VERSION}}, + 'PhusionPassenger' => {:name => 'Phusion Passenger', :version => Proc.new{PhusionPassenger::VERSION_STRING}}, + 'RailsFCGIHandler' => {:name => 'FastCGI'} + # TOOD: find a way to test for CGI + } + app_server = (Object.constants & app_servers.keys).collect do |server| + name = app_servers[server][:name].underscore.humanize + version = app_servers[server][:version].call if app_servers[server][:version] + [name, version].compact.join(" ") + end.join(",") + app_server = l(:label_unknown) unless app_server.present? + + + + @infolist = Rails::Info.properties.dup + @infolist.insert(3, ['Rake version', RAKEVERSION]) + @infolist.insert(11, [:text_log_file, Rails.configuration.log_path]) + + @infolist += [ + [:text_app_server, app_server], + [:text_redmine_username, Etc.getlogin] + ] + + @pluginlist = Redmine::Plugin.all end end diff --git a/app/views/admin/_plugins.rhtml b/app/views/admin/_plugins.rhtml new file mode 100644 index 000000000..53ae74568 --- /dev/null +++ b/app/views/admin/_plugins.rhtml @@ -0,0 +1,13 @@ +
| <%=h plugin.name %> + <%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %> + <%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %> + | +<%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %> | +<%=h plugin.version %> | +<%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %> | +
<%= Redmine::Info.versioned_name %> (<%= @db_adapter_name %>)
+<%= Redmine::Info.versioned_name %>
| <%= label.is_a?(Symbol) ? l(label) : h(label) %> | +<%= h(info) %> | +
| <%=h plugin.name %> - <%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %> - <%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %> - | -<%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %> | -<%=h plugin.version %> | -<%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %> | -
<%= l(:label_no_data) %>
<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index b3d87515d..0ef7255ae 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -763,6 +763,9 @@ en: label_profile: Profile label_subtask_plural: Subtasks label_project_copy_notifications: Send email notifications during the project copy + label_unknown: Unknown + label_plugin_name: Plugin name + label_plugin_version: Plugin version button_login: Login button_submit: Submit @@ -857,6 +860,9 @@ en: text_file_repository_writable: Attachments directory writable text_plugin_assets_writable: Plugin assets directory writable text_rmagick_available: RMagick available (optional) + text_app_server: Application server + text_redmine_username: System user + text_log_file: Log file text_destroy_time_entries_question: "{{hours}} hours were reported on the issues you are about to delete. What do you want to do ?" text_destroy_time_entries: Delete reported hours text_assign_time_entries_to_project: Assign reported hours to the project