| 1 |
<?php |
<?php |
| 2 |
// $Id: singlesignon.module,v 1.29 2008/05/05 11:02:29 wayland76 Exp $ |
// $Id: singlesignon.module,v 1.31 2008/05/05 13:38:20 wayland76 Exp $ |
| 3 |
|
|
| 4 |
|
|
| 5 |
/** |
/** |
| 50 |
* @link http://drupal.org/project/singlesignon |
* @link http://drupal.org/project/singlesignon |
| 51 |
* @author Primary Author: Daniel Convissor <danielc@analysisandsolutions.com> |
* @author Primary Author: Daniel Convissor <danielc@analysisandsolutions.com> |
| 52 |
* @author Maintainer: Tim Nelson <wayland@wayland.id.au> |
* @author Maintainer: Tim Nelson <wayland@wayland.id.au> |
| 53 |
* @version $Revision: 1.29 $ |
* @version $Revision: 1.31 $ |
| 54 |
*/ |
*/ |
| 55 |
|
|
| 56 |
// {{{ core functions |
// {{{ core functions |
| 107 |
// Then go to the master site to see if they are logged in over there. |
// Then go to the master site to see if they are logged in over there. |
| 108 |
$_SESSION['singlesignon_prior_sid'] = session_id(); |
$_SESSION['singlesignon_prior_sid'] = session_id(); |
| 109 |
|
|
| 110 |
_singlesignon_goto_url('singlesignon/initial_check'); |
_singlesignon_goto_url($master_url, 'singlesignon/initial_check'); |
| 111 |
} |
} |
| 112 |
} |
} |
| 113 |
|
|
| 155 |
} |
} |
| 156 |
else if ($user->uid) { |
else if ($user->uid) { |
| 157 |
// Tell the master site the user just logged in. |
// Tell the master site the user just logged in. |
| 158 |
_singlesignon_goto_url('singlesignon/login'); |
_singlesignon_goto_url($master_url, 'singlesignon/login'); |
| 159 |
} |
} |
| 160 |
} |
} |
| 161 |
} |
} |
| 204 |
/** |
/** |
| 205 |
* Sets up the URL and goes to it |
* Sets up the URL and goes to it |
| 206 |
*/ |
*/ |
| 207 |
function _singlesignon_goto_url($url) { |
function _singlesignon_goto_url($master_url, $url) { |
| 208 |
// url() only available if bootstrap has reached FULL. |
// url() only available if bootstrap has reached FULL. |
| 209 |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
| 210 |
|
|