Simple question, difficult execution? In short, I’d want to create a form where a authenticated user (without panel access, the client) can upload a file, in which a page gets made where only the currently authenticated user has access to. Whenever the user uploads a new file, this file gets added to the list. The admin should be able to view every client user’s uploaded files from the front-end.
I know how to make most of the parts, but miss the golden recipe sauce to connect the uploading from the form to creating a new page. Any tips & tricks to make this work?
Check out this post: Allow guests to create pages from Panel or frontend
Hope this is what you are looking for, because I am not quite sure I understand correctly what you want to achieve.
Okay, I’m getting there. Follow-up question for something I can’t even seem to find a clue in the Toolkit APIs. I’m using a page hook on panel.user.create
. Is it possible to get the username from the user that gets created in a variable I can use in a hook? I was looking on how Kirby saves the username and other profile information when it’s doing it’s job, but I think it’s protected to not let outside code interfere with it.
The panel.user.create hook provides the user object, so you should be able to access the username within that hook:
kirby()->hook('panel.user.create', function($user) {
$username = $user->username();
});
Oops, that did the trick. Thanks!