dateModified is working fine for panel and frontend users, since it uses only the time() function. but for the user name i am having problems. panel users get logged via the hook, but kirby()->user()->name() seems to not be working for frontend users. any idea on how to reach my goal?
hi sonja, yes, let me clarify. the frontend users dont have panel access. with ‘logged in users’ you mean if they appear in the users view in the panel? yes I manage them from there.
i tried a workaround, but with no success because it overrides the value:
after i save the page from the frontend, logged in as a frontend user, i save also the username (modifiedByUser) directly via the $page->update() function (along with other fields). but since the hook gets called after the page is saved, the value i save gets overriden by kirby()->user()->name() in the hook. if i remove
'modifiedByUser' => kirby()->user()->name()
from of the hook everything works from the frontend and the value is saved (because the hook does not overwrite the update() value), but then the panel users dont get logged, because the $page->update() happens obviously only in the frontend. I hope i explained it clear enough
hm yes probably, but in our case the chance that they change are really small. it is more of a quick overview and if I use IDs then the editors would have to check who that was in their team.