Index: masquerade.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/masquerade/masquerade.module,v
retrieving revision 1.16.2.14
diff -u -p -r1.16.2.14 masquerade.module
--- masquerade.module	20 Jun 2009 04:56:14 -0000	1.16.2.14
+++ masquerade.module	21 Jul 2009 16:31:17 -0000
@@ -13,7 +13,7 @@
 function masquerade_help($path, $arg) {
   switch ($path) {
     case 'admin/help#masquerade':
-      return t('<p>The masquerade module adds a link on a user\'s profile page that allows permitted users to masquerade as that user. Upon masquerading, the link to "switch back" to the original user will appear in the menu. While masquerading, the option to masquerade as another user will not appear. All masquerading transactions are logged, and $user->masquerading will be set; this could be displayed via theme.</p><p>In the masquerade settings a list of roles are presented; any checked role is considered an "administrator" and requires the second level "masquerade as admin" permission to masquerade as. User #1 is automatically considered an administrator, regardless of roles.</p>');
+      return t('<p>The masquerade module adds a link on a user\'s profile page that allows permitted users to masquerade as that user. Upon masquerading, a link to "switch back" to the original user will appear in the menu. While masquerading, the option to masquerade as another user will not appear. All masquerading transactions are logged, and $user->masquerading will be set; this could be displayed via theme.</p><p>In the masquerade settings a list of roles are presented; any checked role is considered an "administrator" and requires the second level "masquerade as admin" permission to masquerade as. User #1 is automatically considered an administrator, regardless of roles.</p>');
     case 'admin/settings/masquerade':
       return t('Only the users with <strong>masquerade as admin</strong> permission, will be able to masquerade as the users who belong to the roles selected below. User #1 is automatically considered an administrator, regardless of roles.');
   }
@@ -157,7 +157,7 @@ function masquerade_admin_settings() {
 
   $form['masquerade_quick_switches'] = array(
     '#type' => 'textfield',
-    '#title' => t('Block <em>Quick Switch</em> users'),
+    '#title' => t('Masquerade Block <em>Quick Switch</em> users'),
     '#autocomplete_path' => 'masquerade/autocomplete/multiple',
     '#default_value' => variable_get('masquerade_quick_switches', ''),
     '#description' => t('Enter the usernames, separated by commas, of accounts to show as quick switch links in the Masquerade block.')
@@ -263,7 +263,7 @@ function masquerade_block_1($record) {
   if ($GLOBALS['masquerading']) {
     global $user;
     $quick_switch_link[] = l(t('Switch back'), 'masquerade/unswitch', array());
-    $markup_value = t('You are masquerading as:<br />%masq_as', array('%masq_as' => $user->name)) . theme('item_list', $quick_switch_link);
+    $markup_value = t('You are masquerading as <a href="@user-url">%masq_as</a>.', array('@user-url' => url('user/' . $user->uid), '%masq_as' => $user->name)) . theme('item_list', $quick_switch_link);
   }
   else {
 	// A comma-separated list of users.
@@ -277,7 +277,7 @@ function masquerade_block_1($record) {
       }
     }
 
-	$markup_value .= t('Enter username to masquerade as.') . '<br /><br />';
+	$markup_value .= t('Enter a username to masquerade as.') . '<br /><br />';
     $form['masquerade_user_field'] = array(
       '#prefix' => '<div class="container-inline">',
       '#type' => 'textfield',
@@ -310,10 +310,10 @@ function masquerade_block_1($record) {
 function masquerade_block_1_validate($form, &$form_state) {
   unset($form);
   if ($form_state['values']['masquerade_user_field'] == 's') {
-    form_set_error('masquerade_user_field', t('You cannot masquerade as %anonymous!', array('%anonymous' => variable_get('anonymous', 'Anonymous'))));
+    form_set_error('masquerade_user_field', t('You cannot masquerade as %anonymous. Please choose a different user to masquerade as.', array('%anonymous' => variable_get('anonymous', 'Anonymous'))));
   }
   if ($GLOBALS['masquerading']) {
-    form_set_error('masquerade_user_field', t('You are already masquerading!'));
+    form_set_error('masquerade_user_field', t('You are already masquerading. Please <a href="@unswitch">switch back</a> to your account to masquerade as another user.', array('@unswitch' => url('masquerade/unswitch'))));
   }
   global $user;
   $masq_user = user_load(array('name' => $form_state['values']['masquerade_user_field']));
@@ -321,10 +321,10 @@ function masquerade_block_1_validate($fo
     form_set_error('masquerade_user_field', t('User %masq_as does not exist. Please enter a valid username.', array('%masq_as' => $form_state['values']['masquerade_user_field'])));
   }
   if ($masq_user->uid == $user->uid) {
-    form_set_error('masquerade_user_field', t('You cannot masquerade on yourself!'));
+    form_set_error('masquerade_user_field', t('You cannot masquerade as yourself. Please choose a different user to masquerade as.'));
   }
   if (variable_get('site_offline', 0)) {
-    form_set_error('masquerade_user_field', t('It is not possible to masquerade in off-line mode!'));
+    form_set_error('masquerade_user_field', t('It is not possible to masquerade in off-line mode. Please <a href="@site-maintenance">set the site status</a> to "online" to switch to masquerade.', array('@site-maintenance' => url('admin/settings/site-maintenance'))));
   }
 }
 
@@ -399,7 +399,7 @@ function masquerade_switch_user($uid) {
   }
 
   if (variable_get('site_offline', 0) && !user_access('administer site configuration', $new_user)) {
-    drupal_set_message(t('The user is not allowed to access site in off-line mode!'), 'error');
+    drupal_set_message(t('This user is not allowed to access the site while the site is in off-line mode. Please <a href="@site-maintenance">set the site status</a> to "online" to switch to this user.', array('@site-maintenance' => url('admin/settings/site-maintenance'))), 'error');
     return drupal_access_denied();
   }
 
@@ -408,7 +408,7 @@ function masquerade_switch_user($uid) {
   // switch user
 
   watchdog('masquerade', 'User %user now masquerading as %masq_as.', array('%user' => $user->name, '%masq_as' => $new_user->name ? $new_user->name : variable_get('anonymous', 'Anonymous')), WATCHDOG_INFO);
-  drupal_set_message(t('Now masquerading as %masq_as.', array('%masq_as' => $new_user->name ? $new_user->name : variable_get('anonymous', 'Anonymous'))));
+  drupal_set_message(t('You are now masquerading as %masq_as.', array('%masq_as' => $new_user->name ? $new_user->name : variable_get('anonymous', 'Anonymous'))));
   $user->masquerading = $new_user->uid;
   $user = $new_user;
   drupal_goto(referer_uri());
@@ -428,6 +428,6 @@ function masquerade_switch_back() {
   $oldname = $user->name;
   $user = user_load(array('uid' => $uid));
   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);
-  drupal_set_message(t('No longer masquerading as %masq_as.', array('%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' => $new_user->name ? $new_user->name : variable_get('anonymous', 'Anonymous'))));
   drupal_goto(referer_uri());
 }
