commit 9d66d3f8c7d6a8e688e738335d9218fa1ad0b291
Author: root <mail@aaron-mueller.de>
Date:   Thu Jun 10 21:35:18 2010 +0200

    User can request an invitation for any public project
    
    New button in each project will sent an email
    to every member which manage_members permission with
    links for adding the user.

diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb
index 3bfa606..54a8d6d 100644
--- a/app/controllers/members_controller.rb
+++ b/app/controllers/members_controller.rb
@@ -16,10 +16,16 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 class MembersController < ApplicationController
-  before_filter :find_member, :except => [:new, :autocomplete_for_member]
-  before_filter :find_project, :only => [:new, :autocomplete_for_member]
+  before_filter :find_member, :except => [:new, :autocomplete_for_member, :invite]
+  before_filter :find_project, :only => [:new, :autocomplete_for_member, :invite]
   before_filter :authorize
 
+  def invite
+    @project.members << Member.new(:user_id => params[:user], :role_ids => params[:role])
+    flash[:notice] = l(:user_added_to_project)
+    redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project
+  end
+
   def new
     members = []
     if params[:member] && request.post?
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index c126314..6085da4 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -60,6 +60,14 @@ class ProjectsController < ApplicationController
       }
     end
   end
+
+  def request_invitation
+    (@project.principals.select {|user| user.allowed_to?(:manage_members, @project)}).each do |u|
+      Mailer.deliver_request_invitation(User.current, @project, u)
+    end
+    flash[:notice] = l(:request_was_sucessfully_sent)
+    redirect_to :controller => 'projects', :action => 'show', :id => @project
+  end
   
   # Add a new project
   def add
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 8de1aa3..3189930 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -329,6 +329,16 @@ class Mailer < ActionMailer::Base
     render_multipart('inactive_reminder', body)
   end
 
+  def request_invitation user, project, receiver
+    set_language_if_valid(receiver.language)
+    recipients receiver.mail
+    subject "[#{Setting.app_title.to_s} - #{l(:authorisation_request)}] #{project.name}"
+    body :project => project,
+       :url => url_for(:controller => 'members', :action => 'invite', :id => project),
+       :user => user
+    render_multipart('request_invitation', body)
+  end
+
   private
   def initialize_defaults(method_name)
     super
diff --git a/app/views/mailer/request_invitation.text.html.rhtml b/app/views/mailer/request_invitation.text.html.rhtml
new file mode 100644
index 0000000..a8ded4a
--- /dev/null
+++ b/app/views/mailer/request_invitation.text.html.rhtml
@@ -0,0 +1,7 @@
+<%= t(:mail_body_project_invation_request, :user => @user, :project => @project.name) %>
+
+<% Role.find(:all, :conditions => {:builtin => 0}).each do |role| %>
+<a href="<%= @url %>?user=<%= @user.id %>&role=<%= role.id %>"><%= t(:add_as_role, :role => role.name) %></a>
+
+<% end %>
+
diff --git a/app/views/mailer/request_invitation.text.plain.rhtml b/app/views/mailer/request_invitation.text.plain.rhtml
new file mode 100644
index 0000000..efde24e
--- /dev/null
+++ b/app/views/mailer/request_invitation.text.plain.rhtml
@@ -0,0 +1,8 @@
+<%= t(:mail_body_project_invation_request, :user => @user, :project => @project.name) %>
+
+<% Role.find(:all, :conditions => {:builtin => 0}).each do |role| %>
+<%= t(:add_as_role, :role => role.name) %>
+<%= @url %>?user=<%= @user.id %>&role=<%= role.id %>
+
+<% end %>
+
diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml
index e98c350..e517c75 100644
--- a/app/views/projects/show.rhtml
+++ b/app/views/projects/show.rhtml
@@ -1,4 +1,7 @@
 <div class="contextual">
+  <% unless User.current.member_of? @project %>
+    <%= link_to t(:send_authorisation_request), {:controller => 'projects', :action => 'request_invitation', :id => @project}, :class => 'icon icon-lock' %>
+  <% end %>
 	<% if User.current.allowed_to?(:add_subprojects, @project) %>
 		<%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'add', :parent_id => @project}, :class => 'icon icon-add' %>
 	<% end %>
diff --git a/config/locales/bg.yml b/config/locales/bg.yml
index 1c3d9b7..c795203 100644
--- a/config/locales/bg.yml
+++ b/config/locales/bg.yml
@@ -887,3 +887,9 @@ bg:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/bs.yml b/config/locales/bs.yml
index cc24f91..d885c70 100644
--- a/config/locales/bs.yml
+++ b/config/locales/bs.yml
@@ -911,3 +911,9 @@ bs:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/ca.yml b/config/locales/ca.yml
index f8550d5..409496f 100644
--- a/config/locales/ca.yml
+++ b/config/locales/ca.yml
@@ -890,3 +890,9 @@ ca:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/cs.yml b/config/locales/cs.yml
index 0d72764..7b5403a 100644
--- a/config/locales/cs.yml
+++ b/config/locales/cs.yml
@@ -893,3 +893,9 @@ cs:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/da.yml b/config/locales/da.yml
index 0c3842c..2b8191f 100644
--- a/config/locales/da.yml
+++ b/config/locales/da.yml
@@ -913,3 +913,9 @@ da:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 2240e00..8cbf79f 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -917,3 +917,9 @@ de:
     archiviert. Falls Sie das Projekt "{{project}}" noch benötigen, klicken sie auf folgenden Link,
     um es wieder zu aktivieren.
   permission_reactivate_project: Projekt reaktivieren.
+  request_was_sucessfully_sent: "Die Anfrage wurde verschickt. Warten sie auf die Freischaltung"
+  authorisation_request: Beitrittsanfrage
+  add_as_role: "Hinzufügen als {{role}}"
+  send_authorisation_request: "Beitrittsanfrage senden"
+  user_added_to_project: "Benutzer wurde dem Projekt hinzugefügt"
+  mail_body_project_invation_request: "{{user}} stelld eine Anfrage auf Freischaltung für das Projekt {{project}}"
diff --git a/config/locales/el.yml b/config/locales/el.yml
index 285e7c9..7b6fa83 100644
--- a/config/locales/el.yml
+++ b/config/locales/el.yml
@@ -893,3 +893,9 @@ el:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6b9de44..a29f2b3 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -892,3 +892,10 @@ en:
   enumeration_activities: Activities (time tracking)
   enumeration_system_activity: System Activity
 
+  user_added_to_project: User added to project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  send_authorisation_request: Send authorisation request 
+  add_as_role: "Add as {{role}}:"
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}."
+
diff --git a/config/locales/es.yml b/config/locales/es.yml
index de40dcb..bb8829f 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -937,3 +937,9 @@ es:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/fi.yml b/config/locales/fi.yml
index 1fef68a..0fd7d26 100644
--- a/config/locales/fi.yml
+++ b/config/locales/fi.yml
@@ -923,3 +923,9 @@ fi:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index af14ed3..11d2986 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -914,3 +914,9 @@ fr:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/gl.yml b/config/locales/gl.yml
index 8f6f0e6..37f9372 100644
--- a/config/locales/gl.yml
+++ b/config/locales/gl.yml
@@ -913,3 +913,9 @@ gl:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/he.yml b/config/locales/he.yml
index 92c5cc9..0841dcf 100644
--- a/config/locales/he.yml
+++ b/config/locales/he.yml
@@ -897,3 +897,9 @@ he:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/hr.yml b/config/locales/hr.yml
index 973c19a..c893404 100644
--- a/config/locales/hr.yml
+++ b/config/locales/hr.yml
@@ -900,3 +900,9 @@ hr:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/hu.yml b/config/locales/hu.yml
index ce4ca0f..3a9b83a 100644
--- a/config/locales/hu.yml
+++ b/config/locales/hu.yml
@@ -918,3 +918,9 @@
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/id.yml b/config/locales/id.yml
index d083657..10c79d5 100644
--- a/config/locales/id.yml
+++ b/config/locales/id.yml
@@ -905,3 +905,9 @@ id:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/it.yml b/config/locales/it.yml
index cbe2985..f2101cb 100644
--- a/config/locales/it.yml
+++ b/config/locales/it.yml
@@ -900,3 +900,9 @@ it:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
index 5a636f6..d0b46f5 100644
--- a/config/locales/ja.yml
+++ b/config/locales/ja.yml
@@ -922,3 +922,9 @@ ja:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/ko.yml b/config/locales/ko.yml
index 3cf448d..6dae153 100644
--- a/config/locales/ko.yml
+++ b/config/locales/ko.yml
@@ -953,3 +953,9 @@ ko:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/lt.yml b/config/locales/lt.yml
index 433f54e..4359728 100644
--- a/config/locales/lt.yml
+++ b/config/locales/lt.yml
@@ -961,3 +961,9 @@ lt:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/nl.yml b/config/locales/nl.yml
index ce9ba41..c68710d 100644
--- a/config/locales/nl.yml
+++ b/config/locales/nl.yml
@@ -875,3 +875,9 @@ nl:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/no.yml b/config/locales/no.yml
index 530e0f0..01024b7 100644
--- a/config/locales/no.yml
+++ b/config/locales/no.yml
@@ -888,3 +888,9 @@
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/pl.yml b/config/locales/pl.yml
index 4ad3ed5..e33f5ef 100644
--- a/config/locales/pl.yml
+++ b/config/locales/pl.yml
@@ -918,3 +918,9 @@ pl:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml
index ce299f1..0060aa7 100644
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -921,3 +921,9 @@ pt-BR:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
index 5a0313d..1828312 100644
--- a/config/locales/pt.yml
+++ b/config/locales/pt.yml
@@ -905,3 +905,9 @@ pt:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/ro.yml b/config/locales/ro.yml
index a74d84b..73fc121 100644
--- a/config/locales/ro.yml
+++ b/config/locales/ro.yml
@@ -890,3 +890,9 @@ ro:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
index bb79d50..1d7198f 100644
--- a/config/locales/ru.yml
+++ b/config/locales/ru.yml
@@ -1001,3 +1001,9 @@ ru:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/sk.yml b/config/locales/sk.yml
index 5b83122..a6be653 100644
--- a/config/locales/sk.yml
+++ b/config/locales/sk.yml
@@ -892,3 +892,9 @@ sk:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/sl.yml b/config/locales/sl.yml
index bc05427..a4a0146 100644
--- a/config/locales/sl.yml
+++ b/config/locales/sl.yml
@@ -889,3 +889,9 @@ sl:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/sr.yml b/config/locales/sr.yml
index a1bbb22..31a33e9 100644
--- a/config/locales/sr.yml
+++ b/config/locales/sr.yml
@@ -908,3 +908,9 @@
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/sv.yml b/config/locales/sv.yml
index 9735d2e..e16605d 100644
--- a/config/locales/sv.yml
+++ b/config/locales/sv.yml
@@ -942,3 +942,9 @@ sv:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/th.yml b/config/locales/th.yml
index dbcaaa4..0aa2e70 100644
--- a/config/locales/th.yml
+++ b/config/locales/th.yml
@@ -890,3 +890,9 @@ th:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/tr.yml b/config/locales/tr.yml
index 49a188c..5cad07d 100644
--- a/config/locales/tr.yml
+++ b/config/locales/tr.yml
@@ -920,3 +920,9 @@ tr:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/uk.yml b/config/locales/uk.yml
index c648bd6..09c53c8 100644
--- a/config/locales/uk.yml
+++ b/config/locales/uk.yml
@@ -889,3 +889,9 @@ uk:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/vi.yml b/config/locales/vi.yml
index 4f81575..b21031f 100644
--- a/config/locales/vi.yml
+++ b/config/locales/vi.yml
@@ -952,3 +952,9 @@ vi:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml
index f2ff1ce..2e1e7d3 100644
--- a/config/locales/zh-TW.yml
+++ b/config/locales/zh-TW.yml
@@ -984,3 +984,9 @@
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index bf211e3..51e2bfc 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -915,3 +915,9 @@ zh:
   mail_subject_project_activity_warning: Activity reminder
   mail_body_project_activity_warning: Your project '{{project}}' has no activity for a month. If you still need the project, click the following link, otherwise the project will be archived in 14 days.
   permission_reactivate_project: Reactivate Project
+  request_was_sucessfully_sent: Your request was successfully sent. Please wait for authorization
+  authorisation_request: Authorisation request
+  add_as_role: "Add as {{role}}:"
+  send_authorisation_request: Send authorisation request
+  user_added_to_project: User added to project
+  mail_body_project_invation_request: "{{user}} requested authorisation for project {{project}}"
diff --git a/config/routes.rb b/config/routes.rb
index ca41df7..f876048 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -154,6 +154,7 @@ ActionController::Routing::Routes.draw do |map|
   end
   
   map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
+  map.connect 'projects/:id/members/invite', :controller => 'members', :action => 'invite'
   
   map.with_options :controller => 'users' do |users|
     users.with_options :conditions => {:method => :get} do |user_views|
@@ -185,6 +186,7 @@ ActionController::Routing::Routes.draw do |map|
       project_views.connect 'projects/:id/categories/new', :action => 'add_issue_category'
       project_views.connect 'projects/:id/settings/:tab', :action => 'settings'
       project_views.connect 'projects/:id/reactivate', :action => 'reactivate'
+      project_views.connect 'projects/:id/request_invitation', :action => 'request_invitation'
     end
 
     projects.with_options :action => 'activity', :conditions => {:method => :get} do |activity|
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 9aff2e7..646e5b6 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -25,12 +25,12 @@ REDMINE_SUPPORTED_SCM = %w( Subversion Darcs Mercurial Cvs Bazaar Git Filesystem
 
 # Permissions
 Redmine::AccessControl.map do |map|
-  map.permission :view_project, {:projects => [:show, :activity]}, :public => true
+  map.permission :view_project, {:projects => [:show, :activity, :request_invitation]}, :public => true
   map.permission :search_project, {:search => :index}, :public => true
   map.permission :add_project, {:projects => :add}, :require => :loggedin
   map.permission :edit_project, {:projects => [:settings, :edit]}, :require => :member
   map.permission :select_project_modules, {:projects => :modules}, :require => :member
-  map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy, :autocomplete_for_member]}, :require => :member
+  map.permission :manage_members, {:projects => :settings, :members => [:new, :invite, :edit, :destroy, :autocomplete_for_member]}, :require => :member
   map.permission :manage_versions, {:projects => [:settings, :add_version], :versions => [:edit, :close_completed, :destroy]}, :require => :member
   map.permission :add_subprojects, {:projects => :add}, :require => :member
   map.permission :reactivate_project, {:projects => :reactivate}, :require => :member
