Home · Links · Contact Us
Home arrow Forums
Home
Features
FAQ
Screen Shots
Modules
Themes
Demos
Documentation
Forums
Contact Us
Download
Purchase
Quotes

" ... I want to tell you that your thyme product is functional and valuable beyond words. I cannot imagine why any portal would be without it. It is the cornerstone of our new project ..."

" ... Thanks for such a complete project, its making my job much easier. ..."

" ... I have now deployed 4 different calendars and our users love them ... "

" ... Easy to install and use and a great look/design. ..."

" ... This has to be the easiest to use program I think I've had to deal with at all this year. ..."


  FAQFAQ    SearchSearch  RegisterRegister   Log inLog in 
integration and session variables

 
Post new topic   Reply to topic     Forum Index -> Web site integration
View previous topic :: View next topic  
Author Message
mlovelock



Joined: 26 Feb 2008
Posts: 4

PostPosted: Tue Feb 26, 2008 5:10 pm    Post subject: integration and session variables Reply with quote

I am looking to integrate Thyme into a pre-existing user authentication system.

With the Generic MySQL Authentication module I can obviously use the same user details, but I also wish to log users into the diary system at the same time as they log in to the rest of the site.

I thought perhaps the easiest way to do this would be to manually register the required session variables for Thyme - would this work, and what would those Session variables be? Also, I presume on logout I would just need to destroy those session values?

Many thanks,
Michael.
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5268

PostPosted: Tue Feb 26, 2008 5:19 pm    Post subject: Reply with quote

Hi,

Please see this. Let me know if you have any questions or trouble at all.
Back to top
View user's profile Send private message Visit poster's website
mlovelock



Joined: 26 Feb 2008
Posts: 4

PostPosted: Tue Mar 11, 2008 1:09 am    Post subject: integration and session variables Reply with quote

Hi,

Thanks for your reply, I've just now had the chance to try implementing this.

What I'm finding at present is that I'm getting the desired result on login, but not on logout.

At present, I've added the following code to the generic mysql auth file (auth.php) as suggested in the post:

Code:
session_start();
if($_SESSION['kt_login_id']) {
   $_SESSION['uid'] = $_SESSION['kt_login_id'];
   define("_CAL_REUSE_SESSION_", 1);
}


This logs me in fine, but I'm a little confused as to what I need to do in terms of logout. My site logout unsets the session variables and logs the user out. However, when I go back to the calendar and refresh the page, the user is then logged back in, and my site session variables are reinstated.

Is the calendar re-using the session in some way? Do I need to unset / destroy a session var that I'm not at present?

Many thanks,
Michael
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5268

PostPosted: Tue Mar 11, 2008 2:48 pm    Post subject: Reply with quote

Hi,

This is because Thyme instantiates its own session. To make it so that a user can only be logged into Thyme when also logged into your main app or intranet, change the code to:

Code:
session_start();
if($_SESSION['kt_login_id']) {
   $_SESSION['uid'] = $_SESSION['kt_login_id'];
} else {
   $_SESSION['uid'] = 0;
}
define("_CAL_REUSE_SESSION_", 1);
Back to top
View user's profile Send private message Visit poster's website
mlovelock



Joined: 26 Feb 2008
Posts: 4

PostPosted: Tue Mar 11, 2008 4:05 pm    Post subject: Reply with quote

Hi,

This seems to provide a partial answer, though I can't quite figure out why. Here's what's happening:

1. User logs out - all my session vars are unset (confirmed)
2. User returns to calendar index - at this point, 'UID' is set to '0', but calendar also reinstates (or still holds) 'kt_login_id' and other vars to their previous states / values (confirmed)
3. If user then refreshes the calendar page, they are effectively logged in again, to the whole site and the calendar.

Is this because thyme is reusing my session and so still holds its own copies of the session vars? How do I ensure we don't end up being logged back in again - do I need to unset/destroy the thyme session?

Many thanks for your help and speedy responses,
Michael
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5268

PostPosted: Tue Mar 11, 2008 4:10 pm    Post subject: Reply with quote

Hi,

You don't want to destroy the whole session. Do this instead actually:

Code:
session_start();
if($_SESSION['kt_login_id']) {
   $_SESSION['uid'] = $_SESSION['kt_login_id'];
} else {
   unset($_SESSION['kt_login_id']);
   $_SESSION['uid'] = 0;
}
define("_CAL_REUSE_SESSION_", 1);


Let me know if this does not work.
Back to top
View user's profile Send private message Visit poster's website
mlovelock



Joined: 26 Feb 2008
Posts: 4

PostPosted: Tue Mar 11, 2008 4:44 pm    Post subject: Reply with quote

Hi, no luck there I'm afraid. Still the same outcome. Sorry to be so awkward!
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5268

PostPosted: Wed Mar 12, 2008 4:59 pm    Post subject: Reply with quote

Would it be at all possible for you to send me a private message (click on the "PM" icon under this post) containing the FTP login and site login info please?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Web site integration All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2005 eXtrovert software unless otherwise noted. All rights reserved.
Portions © 2004 Ben Brown. All rights reserved.
Trademarks are property of their respective owners.