| 19 |
* (except of course the current one, which is needed for Drupal's regular |
* (except of course the current one, which is needed for Drupal's regular |
| 20 |
* logout process which takes place after this). |
* logout process which takes place after this). |
| 21 |
*/ |
*/ |
| 22 |
functions _singlesignon_session_logout($uid) { |
function _singlesignon_session_logout($uid) { |
| 23 |
db_query("DELETE FROM {sessions} WHERE uid = %d AND sid <> '%s'", $uid, session_id()); |
db_query("DELETE FROM {sessions} WHERE uid = %d AND sid <> '%s'", $uid, session_id()); |
| 24 |
} |
} |
| 25 |
|
|
| 28 |
* update the slave session's user ID to be the user ID they have on the |
* update the slave session's user ID to be the user ID they have on the |
| 29 |
* master server |
* master server |
| 30 |
*/ |
*/ |
| 31 |
functions _singlesignon_session_update_user() { |
function _singlesignon_session_update_user() { |
| 32 |
// The line below doesn't work in Postgres: http://drupal.org/node/254752 -- the guy in that bug recommended the change |
// The line below doesn't work in Postgres: http://drupal.org/node/254752 -- the guy in that bug recommended the change |
| 33 |
// db_query("UPDATE {sessions} AS sess_slave LEFT JOIN {sessions} AS sess_master ON (sess_master.sid = '%s' AND sess_slave.sid = '%s') SET sess_slave.uid = sess_master.uid WHERE sess_slave.sid = '%s'", session_id(), $_GET['slave_session'], $_GET['slave_session']); |
// db_query("UPDATE {sessions} AS sess_slave LEFT JOIN {sessions} AS sess_master ON (sess_master.sid = '%s' AND sess_slave.sid = '%s') SET sess_slave.uid = sess_master.uid WHERE sess_slave.sid = '%s'", session_id(), $_GET['slave_session'], $_GET['slave_session']); |
| 34 |
$result = db_query("SELECT uid FROM {sessions} WHERE sid = '%s'", session_id()); |
$result = db_query("SELECT uid FROM {sessions} WHERE sid = '%s'", session_id()); |