| 1 |
<?php |
<?php |
| 2 |
// $Id: masquerade.module,v 1.16.2.21 2009/08/31 17:27:21 deviantintegral Exp $ |
// $Id: masquerade.module,v 1.16.2.22 2009/08/31 17:28:39 deviantintegral Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file masquerade.module |
* @file masquerade.module |
| 553 |
$uid = db_result(db_query("SELECT m.uid_from FROM {masquerade} m WHERE m.sid = '%s' AND m.uid_as = %d ", session_id(), $user->uid)); |
$uid = db_result(db_query("SELECT m.uid_from FROM {masquerade} m WHERE m.sid = '%s' AND m.uid_as = %d ", session_id(), $user->uid)); |
| 554 |
// erase record |
// erase record |
| 555 |
db_query("DELETE FROM {masquerade} WHERE sid = '%s' AND uid_as = %d ", session_id(), $user->uid); |
db_query("DELETE FROM {masquerade} WHERE sid = '%s' AND uid_as = %d ", session_id(), $user->uid); |
| 556 |
$oldname = $user->name; |
$oldname = ($user->uid == 0 ? variable_get('anonymous', 'Anonymous') : $user->name); |
| 557 |
$user = user_load(array('uid' => $uid)); |
$user = user_load(array('uid' => $uid)); |
| 558 |
watchdog('masquerade', 'User %user no longer masquerading as %masq_as.', array('%user' => $user->name, '%masq_as' => $new_user->name ? $new_user->name : variable_get('anonymous', 'Anonymous')), WATCHDOG_INFO); |
watchdog('masquerade', 'User %user no longer masquerading as %masq_as.', array('%user' => $user->name, '%masq_as' => $oldname), WATCHDOG_INFO); |
| 559 |
drupal_set_message(t('You are no longer masquerading as %masq_as and are now logged in as %user.', array('%user' => $user->name, '%masq_as' => $new_user->name ? $new_user->name : variable_get('anonymous', 'Anonymous')))); |
drupal_set_message(t('You are no longer masquerading as %masq_as and are now logged in as %user.', array('%user' => $user->name, '%masq_as' => $oldname))); |
| 560 |
drupal_goto(referer_uri()); |
drupal_goto(referer_uri()); |
| 561 |
} |
} |