Docs doesn't say how templates are called?
Posted by tobefound
|
Re: Docs doesn't say how templates are called? February 03, 2010 08:51AM |
Registered: 15 years ago Posts: 24 |
@Maurice:
Thx, I have the user_restore_session hook working now! I'm sending some encrypted cookie data from my website to the module code for determining what user id to put in the session variable. A cleaner/safer solution would of course be to access the userid from the database but I haven't yet figured out how to externally access my Codeigniter session code. And I don't want to hard code a connection to the website's session table. Just seems ugly...
Another problem:
If there's no website user logged in for the moment then I simply set all the defined in the session array to NULL, but how can I tell phorum to redirect to my front page? I can probably do a redirect right in the user_session_restore function hook, but I'm thinking it's the wrong way as the incoming data should be returned (possibly modified). How to do this appropriately?
/T
Thx, I have the user_restore_session hook working now! I'm sending some encrypted cookie data from my website to the module code for determining what user id to put in the session variable. A cleaner/safer solution would of course be to access the userid from the database but I haven't yet figured out how to externally access my Codeigniter session code. And I don't want to hard code a connection to the website's session table. Just seems ugly...
Another problem:
If there's no website user logged in for the moment then I simply set all the defined in the session array to NULL, but how can I tell phorum to redirect to my front page? I can probably do a redirect right in the user_session_restore function hook, but I'm thinking it's the wrong way as the incoming data should be returned (possibly modified). How to do this appropriately?
/T
|
February 03, 2010 08:59AM |
Admin Registered: 21 years ago Posts: 8,532 |
So you want users to never access your forum when they are not logged in? You could use something like the common hook for that I guess. There you can do a redirect to your site and exit when no user is logged in.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Docs doesn't say how templates are called? February 03, 2010 09:13AM |
Registered: 15 years ago Posts: 24 |
|
February 03, 2010 09:15AM |
Admin Registered: 21 years ago Posts: 8,532 |
Nope, that should work fine. Call exit after the redirect and it's optimized. It is not the most appropriate spot for it, but it certainly won't make some secret part of Phorum complain.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Docs doesn't say how templates are called? February 04, 2010 04:28AM |
Registered: 15 years ago Posts: 24 |
|
February 04, 2010 04:42AM |
Admin Registered: 21 years ago Posts: 8,532 |
Not somebody, maybe something. The hook system has called your hook, but will never get its return data. If you call exit in PHP, then PHP will exit. I don't see an issue with that.
Like I said, you can use a common hook for the task of redirecting, to keep your session restore hook cleaner. Whether or not to do this is up to the programmer's gut.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Like I said, you can use a common hook for the task of redirecting, to keep your session restore hook cleaner. Whether or not to do this is up to the programmer's gut.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Sorry, only registered users may post in this forum.
