| View previous topic :: View next topic |
| Author |
Message |
maxhorizon
Joined: 28 Aug 2007 Posts: 7
|
Posted: Tue Aug 28, 2007 8:41 am Post subject: Singel Signon MYSQL Authentication |
|
|
| I used the MySQL Module .. i can login to Thyme using my user table.. but i want to be able to login to thyme using my own login page .. can I do that ? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Tue Aug 28, 2007 12:36 pm Post subject: |
|
|
Hi,
It depends on how you are storing their user information. When they log into your site, how does it keep track of who has logged in? |
|
| Back to top |
|
 |
maxhorizon
Joined: 28 Aug 2007 Posts: 7
|
Posted: Thu Aug 30, 2007 6:00 am Post subject: |
|
|
| I have a session variable called $_SESSION['kt_login_id'] that I always validate to make sure it's alive and not empty. |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Thu Aug 30, 2007 12:18 pm Post subject: |
|
|
Hi,
Is that the numeric id or the userid? |
|
| Back to top |
|
 |
maxhorizon
Joined: 28 Aug 2007 Posts: 7
|
Posted: Thu Aug 30, 2007 1:31 pm Post subject: |
|
|
| $_SESSION['kt_login_id'] is numeric value while the user name text value is stored in $_SESSION['kt_login_user'] |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Thu Aug 30, 2007 2:19 pm Post subject: |
|
|
Hi,
You'll want to place this in your MySQL authentication module below line 83:
| Code: |
session_start();
if($_SESSION['kt_login_id']) {
$_SESSION['uid'] = $_SESSION['kt_login_id'];
define("_CAL_REUSE_SESSION_", 1);
}
|
|
|
| Back to top |
|
 |
maxhorizon
Joined: 28 Aug 2007 Posts: 7
|
Posted: Thu Aug 30, 2007 4:10 pm Post subject: |
|
|
Thanks for the fast reply
This works perfectly .. I think to logout the thyme system I need to make the $_SESSION['uid'] null in my own logout mechanism .. right?
Thanks again .. wonderful software |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Thu Aug 30, 2007 4:29 pm Post subject: |
|
|
| It really depends. Can you explain your site's logout mechanism a little please? |
|
| Back to top |
|
 |
maxhorizon
Joined: 28 Aug 2007 Posts: 7
|
Posted: Thu Aug 30, 2007 4:34 pm Post subject: |
|
|
It's simple actually. I use the following logic to check the login status
if (!isset($_SESSION['kt_login_user'])) then {NOT_LOGGED} else {LOGGED}
So I basically make the variables $_SESSION['kt_login_user'] and $_SESSION['kt_login_id'] null at the logout to make sure I don't go through the LOGGED code block. |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Thu Aug 30, 2007 4:41 pm Post subject: |
|
|
Then yes, you could probably do something more simple actually:
| Code: |
session_start();
$_SESSION['uid'] = $_SESSION['kt_login_id'];
define("_CAL_REUSE_SESSION_", 1); |
|
|
| Back to top |
|
 |
|