Eltom Posted May 21, 2013 Share Posted May 21, 2013 Hi all, right now I'm thinking about a system to manage users and their pages from within the backend. Every user needs a different page. I came up with the idea using a field within a template called "username" and use it in the users page template. On page /login there's a login with username and password and /login/userpage1 /login/userpage2 /login/userpage3 .... are the subpages (name of pages). Those are given a special role which is applied to my users. The advantage I see: I can easily redirect after login with $mypage = $page->children->get("username=".$user->name)->name; $session->redirect("/login/$mypage"); and I can easily check if the page is the users page with if ($page->username != $user->name) { $session->redirect("/login/"); } So this is a typical newbie approach, but it seems logical. Are there any side effects I'm not seeing right now? Or is there a better way to manage something like this? Regards, Thomas Link to comment Share on other sites More sharing options...
ryan Posted May 23, 2013 Share Posted May 23, 2013 If I understand it correctly, it looks alright to me. We've done things like this before, connecting the user name with another page though rather than having a saperate "username" field, we just used the existing page "name" field to connect with the username. So that's the only thing I'd say, is to double check that you really need an extra "username" field, or if you can make use of the built-in name field to do all this. Link to comment Share on other sites More sharing options...
Eltom Posted May 24, 2013 Author Share Posted May 24, 2013 Thank you. It's working fine and I'll stick with the username field, because I need the name field for other purposes. Regards, Thomas Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now