1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-23 15:36:52 +00:00

#8856 fix profile button rendering for guest users (#8865)

This commit is contained in:
webplusai 2024-12-24 12:02:10 +00:00 committed by GitHub
parent b8f2800dab
commit 6d448499c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,7 @@ exports.handler = function(request,response,state) {
"first-guest-user": state.firstGuestUser ? "yes" : "no",
"show-anon-config": state.showAnonConfig ? "yes" : "no",
"user": JSON.stringify(state.authenticatedUser),
"has-profile-access": !!state.authenticatedUser ? "yes" : "no"
}});
response.write(html);
response.end();

View File

@ -91,6 +91,7 @@ exports.handler = function(request,response,state) {
"username": state.authenticatedUser ? state.authenticatedUser.username : state.firstGuestUser ? "Anonymous User" : "Guest",
"user-is-admin": state.authenticatedUser && state.authenticatedUser.isAdmin ? "yes" : "no",
"user-id": user_id,
"has-profile-access": !!state.authenticatedUser ? "yes" : "no"
}
});
response.write(html);

View File

@ -27,7 +27,7 @@ title: $:/plugins/tiddlywiki/multiwikiserver/templates/mws-header
</form>
</div>
</div>
<% elseif [<username>!match[Guest]]+[<first-guest-user>match[no]] %>
<% elseif [<has-profile-access>match[yes]] %>
<$set name="userId" value={{{ [<user>jsonget[user_id]] }}}>
<a href={{{ [<userId>addprefix[/admin/users/]] }}}>
<button class="mws-profile-btn">Profile</button>