diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb
index 50c319328..9cd376c60 100644
--- a/app/views/layouts/_join_exit_project.html.erb
+++ b/app/views/layouts/_join_exit_project.html.erb
@@ -1,10 +1,10 @@
-
- <% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %>
+
+ <% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<%= watcher_link_for_project(@project, User.current) %>
<% end %>
- <% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %>
+ <% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<%= join_in_project_link(@project, User.current) %>
<% end %>
@@ -12,12 +12,13 @@
<%= link_to "#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
<% end %>
- <% if Member.where(:project_id => @project.id).first.roles.first.to_s.include?("Manager") || User.current.admin? %>
+ <% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager")) || User.current.admin? %>
<%= link_to "#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<% end %>
<% if (User.current.member_of? @project) && User.current.login? &&
- Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s != "Manager" %>
+ Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s != "Manager" %>
<%= exit_project_link(@project) %>
<% end %>
+