プロジェクト

全般

プロフィール

Vote #68317

完了

Wrong file list link in email notification on new file upload

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
Email notifications_9
対象バージョン:
開始日:
2010/10/06
期日:
進捗率:

0%

予定工数:
category_id:
9
version_id:
34
issue_org_id:
6590
author_id:
12931
assigned_to_id:
0
comments:
9
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
24
ステータス-->[Closed]

説明

The link in the email pointing to the file list leads to a 403 error (You are not authorized to access this page.).

E.g. the file list link in the email is: http://host/redmine/projects/list_files/projectXY

(instead of http://host/redmine/projects/projectXY/files)

BR, Christian

Redmine version         1.0.2 stable
Ruby version            1.8.7 (i386-mingw32)
RubyGems version        1.3.7
Rack version            1.0
Rails version           2.3.5
Active Record version   2.3.5
Active Resource version 2.3.5
Action Mailer version   2.3.5
Active Support version  2.3.5
Action Pack version     2.3.5
Environment:            production
Database adapter        mysql
Database version        MySQL 5.1.41
Database schema version 20100819172912
Windows 2003 X64 SP2
mongrel                 1.1.5
mongrel_service         0.3.4
gem_plugin              0.2.3
cgi_multipart_eof_fix   2.5.0
win32-service           0.5.2

Plugins:
Redmine Newissuealerts  0.0.2
Issue Resources         0.2.0
Redmine Graphs          0.1.0
Default columns         0.0.2

journals

Same problem!

Redmine version 1.0.4 stable
Ruby version 1.8.7 (i386-mingw32)
Environment: production
Database adapter mysql
Database version MySQL 5.0.90

--------------------------------------------------------------------------------
In version 1.1 the error still persists.
PS: Windows 2003 Server
--------------------------------------------------------------------------------
Is there any chances that this problem will be fixed soon? It's really annoying.
--------------------------------------------------------------------------------
In app/models/mailer.rb

<pre>
def attachments_added(attachments)
container = attachments.first.container
added_to = ''
added_to_url = ''
case container.class.name
when 'Project'
- added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
+ added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
added_to = "#{l(:label_project)}: #{container}"
recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Version'
- added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
+ added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
added_to = "#{l(:label_version)}: #{container.name}"
recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Document'
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}"
recipients container.recipients
end
redmine_headers 'Project' => container.project.identifier
subject "[#{container.project.name}] #{l(:label_attachment_new)}"
body :attachments => attachments,
:added_to => added_to,
:added_to_url => added_to_url
render_multipart('attachments_added', body)
end
</pre>
--------------------------------------------------------------------------------
In case of Version there should be container.project_id

<pre>
when 'Version'
- added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
+ added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project_id)
added_to = "#{l(:label_version)}: #{container.name}"
recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Document'
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Here is a patch
--------------------------------------------------------------------------------
Fixed in r5230, thanks.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリEmail notifications_9 にセット
  • 対象バージョン1.1.3_34 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0