Make sure to use the user profile name whenever it is possible.

This commit is contained in:
2017-02-08 18:41:17 +01:00
parent bb3e2abf55
commit a1e8cc5128
6 changed files with 16 additions and 12 deletions

View File

@@ -335,7 +335,7 @@ feature {NONE} -- Trash:Restore
b.append ("</a>")
if attached n.author as l_author then
b.append (" by ")
b.append (r.link (l_author.name, "user/" + l_author.id.out, Void))
b.append (r.link (r.user_profile_name (l_author), "user/" + l_author.id.out, Void))
end
if node_api.has_permission_for_action_on_node ("edit revisions", l_node, api.user) then
b.append (" (<a href=%"")

View File

@@ -123,7 +123,7 @@ feature -- HTTP Methods
s.append (" | ")
end
if attached l_response.user as u and then l_response.has_permission ("view own trash") then
s.append (l_response.link ("Your-trash", "trash?user=" + l_response.url_encoded (u.name), Void))
s.append (l_response.link ("Your-trash", "trash?user=" + u.id.out, Void))
s.append (" | ")
end

View File

@@ -51,7 +51,11 @@ feature -- HTTP Methods
create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, api)
if attached {WSF_STRING} req.query_parameter ("user") as p_username then
l_username := p_username.value
l_trash_owner := api.user_api.user_by_name (l_username)
if l_username.is_integer_64 then
l_trash_owner := api.user_api.user_by_id (l_username.to_integer_64)
else
l_trash_owner := api.user_api.user_by_name (l_username)
end
end
if
(l_trash_owner /= Void and then l_page.has_permissions (<<"view any trash", "view own trash">>))
@@ -59,7 +63,7 @@ feature -- HTTP Methods
then
-- NOTE: for development purposes we have the following hardcode output.
if l_trash_owner /= Void then
create s.make_from_string ("<p>Trash for user " + l_page.html_encoded (l_trash_owner.name) + "</p>")
create s.make_from_string ("<p>Trash for user " + l_page.html_encoded (l_page.user_profile_name (l_trash_owner)) + "</p>")
else
create s.make_from_string ("<p>Trash</p>")
end