/[drupal]/contributions/modules/masquerade/masquerade.module
ViewVC logotype

Diff of /contributions/modules/masquerade/masquerade.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.16.2.22, Mon Aug 31 17:28:39 2009 UTC revision 1.16.2.23, Mon Aug 31 17:51:28 2009 UTC
# Line 1  Line 1 
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
# Line 553  function masquerade_switch_back() { Line 553  function masquerade_switch_back() {
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  }  }

Legend:
Removed from v.1.16.2.22  
changed lines
  Added in v.1.16.2.23

  ViewVC Help
Powered by ViewVC 1.1.2