1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Display user logins on profiles (#26127).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@17721 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2018-12-12 00:10:09 +00:00
parent fe28726253
commit 039580b73d
3 changed files with 5 additions and 13 deletions

View File

@ -1,6 +1,6 @@
api.user do
api.id @user.id
api.login @user.login if User.current.admin? || (User.current == @user)
api.login @user.login
api.admin @user.admin? if User.current.admin? || (User.current == @user)
api.firstname @user.firstname
api.lastname @user.lastname

View File

@ -6,9 +6,7 @@
<div class="splitcontentleft">
<ul>
<% if User.current.admin? %>
<li><%=l(:field_login)%>: <%= @user.login %></li>
<% end %>
<li><%=l(:field_login)%>: <%= @user.login %></li>
<% unless @user.pref.hide_mail %>
<li><%=l(:field_mail)%>: <%= mail_to(@user.mail, nil, :encode => 'javascript') %></li>
<% end %>

View File

@ -89,16 +89,10 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
assert_select 'user id', :text => '2'
end
test "GET /users/:id should not return login for other user" do
test "GET /users/:id should return login for visible user" do
get '/users/3.xml', :headers => credentials('jsmith')
assert_response :success
assert_select 'user login', 0
end
test "GET /users/:id should return login for current user" do
get '/users/2.xml', :headers => credentials('jsmith')
assert_response :success
assert_select 'user login', :text => 'jsmith'
assert_select 'user login', :text => 'dlopper'
end
test "GET /users/:id should not return api_key for other user" do