| 1 |
<?php |
<?php |
| 2 |
// $Id: notify.module,v 2.71 2008/08/30 04:02:23 matt2000 Exp $ |
// $Id: notify.module,v 2.72 2008/08/30 14:44:49 matt2000 Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_help(). |
* Implementation of hook_help(). |
| 557 |
static $orig_user = array(); |
static $orig_user = array(); |
| 558 |
|
|
| 559 |
if (isset($uid)) { |
if (isset($uid)) { |
| 560 |
|
// Should a user visit cron.php, or should this module be invoked via |
| 561 |
|
// poormanscron and _notify_send() does not complete, |
| 562 |
|
// the visitor will end up logged in as the "switched to user" for |
| 563 |
|
// subsequent requests unless we disable saving the session |
| 564 |
|
// until we are sure we're the invoking user again. |
| 565 |
|
session_save_session(FALSE); |
| 566 |
$user = user_load(array('uid' => $uid)); |
$user = user_load(array('uid' => $uid)); |
| 567 |
} |
} |
| 568 |
// Retrieve the initial user, can be called multiple times. |
// Retrieve the initial user, can be called multiple times. |
| 569 |
else if (count($orig_user)) { |
else if (count($orig_user)) { |
| 570 |
$user = array_shift($orig_user); |
$user = array_shift($orig_user); |
| 571 |
array_unshift($orig_user, $user); |
array_unshift($orig_user, $user); |
| 572 |
|
session_save_session(TRUE); |
| 573 |
} |
} |
| 574 |
// Store the initial user. |
// Store the initial user. |
| 575 |
else { |
else { |