Index: simplenews.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.module,v
retrieving revision 1.220.2.30
diff -u -r1.220.2.30 simplenews.module
--- simplenews.module	19 May 2010 14:02:24 -0000	1.220.2.30
+++ simplenews.module	18 Jul 2010 12:50:53 -0000
@@ -176,7 +176,7 @@
     'title' => 'Subscriptions',
     'type' => MENU_CALLBACK,
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('simplenews_admin_users_form', 5),
+    'page arguments' => array('simplenews_subscriptions_admin_form', 5),
     'access arguments' => array('administer simplenews subscriptions'),
     'file' => 'simplenews.subscription.inc',
     );
@@ -276,7 +276,7 @@
     'title' => 'Manage newsletter subscriptions',
     'type' => MENU_CALLBACK,
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('simplenews_subscription_manager_form'),
+    'page arguments' => array('simplenews_subscriptions_public_all_form'),
     'access arguments' => array('subscribe to newsletters'),
     'file' => 'simplenews.subscription.inc',
   );
@@ -336,7 +336,7 @@
       if (!isset($node->simplenews_mail)) {
         global $language;
         $context['node'] = $node;
-        
+
         if (isset($node->body)) {
           $node->body = token_replace($node->body, 'simplenews', array('node' => $node));
         }
@@ -477,10 +477,10 @@
             }
           }
         }
-        else if (is_object($term)) {
+        elseif (is_object($term)) {
           $selected_terms[] = $term->tid;
         }
-        else if ($term) {
+        elseif ($term) {
           $selected_terms[] = $term;
         }
       }
@@ -534,14 +534,14 @@
       }
       $form['simplenews_subscription']['subscription_mail']['token_help'] = array(
         '#title' => t('Replacement patterns'),
-    	'#type' => 'fieldset',
-    	'#collapsible' => TRUE,
-    	'#collapsed' => TRUE,
+        '#type' => 'fieldset',
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
         '#weight' => -20,
         '#description' => t('These tokens can be used in all text fields and will be replaced on-screen and in the email. Note that simplenews-receiver tokens are not suitable for on-screen use.')
       );
       $form['simplenews_subscription']['subscription_mail']['token_help']['help'] = array(
-    	'#value' => theme('token_help', 'simplenews'),
+        '#value' => theme('token_help', 'simplenews'),
       );
 
       if (isset($form['#node']->simplenews)) {
@@ -575,10 +575,10 @@
         // Show newsletter sending options if newsletter has not been send yet.
         // If send a nodification is shown.
         if (!isset($simplenews_values['s_status']) || (isset($simplenews_values['s_status']) && $simplenews_values['s_status'] == SIMPLENEWS_STATUS_SEND_NOT)) {
-  
+
           // Add dynamic text for send button.
           drupal_add_js(drupal_get_path('module', 'simplenews') .'/simplenews.js', 'module');
-  
+
           if (user_access('send newsletter')) {
             $options[SIMPLENEWS_COMMAND_SEND_NONE] = t("Don't send now");
             $options[SIMPLENEWS_COMMAND_SEND_TEST] = t('Send one test newsletter to the test address');
@@ -603,7 +603,7 @@
               '#attributes' => array('class' => 'simplenews-command-send'),
             );
           }
-  
+
           $address_default = variable_get('site_mail', ini_get('sendmail_from'));
           if (variable_get('simplenews_test_address_override', 0)) {
             $form['simplenews']['test_address'] = array(
@@ -621,7 +621,7 @@
               '#value' => variable_get('simplenews_test_address', $address_default),
             );
           }
-  
+
           $form['simplenews']['advanced'] = array(
             '#type' => 'fieldset',
             '#title' => t('Email options'),
@@ -645,7 +645,7 @@
               '#value' => key($format_options),
             );
           }
-  
+
           $form['simplenews']['advanced']['priority'] = array(
             '#type' => 'select',
             '#title' => t('Email priority'),
@@ -730,7 +730,7 @@
 
       // Determine the newsletters to which a user can choose to subscribe.
       // Determine to which other newsletter a user is automatically subscribed.
-      foreach(simplenews_get_newsletters(variable_get('simplenews_vid', ''), TRUE) as $newsletter) {
+      foreach (simplenews_get_newsletters(variable_get('simplenews_vid', ''), TRUE) as $newsletter) {
         $subscribe_new_account = variable_get('simplenews_new_account_'. $newsletter->tid, 'none');
         $opt_inout_method = variable_get('simplenews_opt_inout_'. $newsletter->tid, 'double');
         if (($subscribe_new_account == 'on' || $subscribe_new_account == 'off') && ($opt_inout_method == 'single' || $opt_inout_method == 'double')) {
@@ -739,7 +739,7 @@
         }
         else {
           if ($subscribe_new_account == 'silent' || ($subscribe_new_account == 'on' && $opt_inout_method == 'hidden')) {
-            $hidden[] = $newsletter->tid;            
+            $hidden[] = $newsletter->tid;
           }
         }
       }
@@ -785,7 +785,7 @@
 
         // Process hidden (automatic) subscriptions.
         if (isset($data['simplenews_hidden'])) {
-          foreach(explode(',', $data['simplenews_hidden']) as $tid) {
+          foreach (explode(',', $data['simplenews_hidden']) as $tid) {
             simplenews_subscribe_user($account->mail, $tid, FALSE, 'automatically');
           }
           $data['simplenews_hidden'] = NULL;
@@ -794,7 +794,7 @@
 
         // Process subscription check boxes.
         if (isset($data['newsletters'])) {
-          foreach(array_keys(array_filter($data['newsletters'])) as $tid) {
+          foreach (array_keys(array_filter($data['newsletters'])) as $tid) {
             simplenews_subscribe_user($account->mail, $tid, FALSE, 'website');
             $newsletters = simplenews_get_newsletters(variable_get('simplenews_vid', ''), TRUE);
             drupal_set_message(t('You have been subscribed to %newsletter.', array('%newsletter' => $newsletters[$tid]->name)));
@@ -934,7 +934,7 @@
   if ($user->uid == $account->uid) {
     if (user_access('subscribe to newsletters', $account)) {
       return TRUE;
-    } 
+    }
   }
   // Allow administrator to edit account's subscription.
   if (user_access('administer users')) {
@@ -1132,7 +1132,7 @@
   }
   elseif (!isset($subscription->tids[$tid])) {
     // Add user to newsletter relationship if not already subscribed.
-    
+
     // Check if user is (un)subscribed to this newsletter.
     // Resubscribe or add new subscription.
     if (isset($subscription->newsletter_subscription[$tid])) {
@@ -1320,7 +1320,7 @@
 
   // Get newsletters for subscription form checkboxes.
   // Newsletters with opt-in/out method 'hidden' will not be listed.
-  foreach(simplenews_get_newsletters(variable_get('simplenews_vid', '')) as $newsletter) {
+  foreach (simplenews_get_newsletters(variable_get('simplenews_vid', '')) as $newsletter) {
     $options[$newsletter->tid] = check_plain($newsletter->name);
     $default_value[$newsletter->tid] = FALSE;
   }
@@ -1924,7 +1924,7 @@
     else {
       watchdog('simplenews', '%success emails sent, %fail failed.', array('%success' => $count_success, '%fail' => $count_fail));
     }
-    
+
     variable_set('simplenews_last_cron', time());
     variable_set('simplenews_last_sent', count($mail_sent));
   }
@@ -2164,7 +2164,7 @@
 
   // Windows based PHP systems don't accept formatted emails.
   $formatted_address = substr(PHP_OS, 0, 3) == 'WIN' ? $address : '"'. mime_header_encode($name) .'" <'. $address .'>';
-  
+
   return array(
     'address' => $address,
     'formatted' => $formatted_address,
@@ -2368,7 +2368,7 @@
         $hash = _simplenews_generate_hash($account->mail, $account->snid, $newsletter->tid);
       }
 
-      // When simplenews_token_values() is called from simplenews_nodeapi() 
+      // When simplenews_token_values() is called from simplenews_nodeapi()
       // $newsletter->name contains no value. Newsletter name is
       // reconstructed from $node->simplenews['tid'].
       $newsletter_name = isset($newsletter->name) ? $newsletter->name : '';
@@ -2381,7 +2381,7 @@
       }
 
       // Build tokens for both 'simplenews_subscription' and 'simplenews'.
-      $values['simplenews-subscribe-url']       = url('newsletter/confirm/add/'. $hash, array('absolute' => TRUE, 'language' => $language));      
+      $values['simplenews-subscribe-url']       = url('newsletter/confirm/add/'. $hash, array('absolute' => TRUE, 'language' => $language));
       $values['simplenews-unsubscribe-url']     = url('newsletter/confirm/remove/'. $hash, array('absolute' => TRUE, 'language' => $language));
       $values['simplenews-receiver-mail']       = $account->mail;
       $values['simplenews-newsletters-name']    = $newsletter_name ? check_plain($newsletter_name) : '';
@@ -2453,15 +2453,15 @@
       return $help;
     case 'admin/settings/simplenews/subscription':
       if (variable_get('language_count', 1) > 1) {
-	if (module_exists('i18nstrings')) {
+        if (module_exists('i18nstrings')) {
           global $language;
           $language_default = variable_get('language_default', $language);
-	  $help = '<p>'. t('This is a Multilingual website. Enter text for confirmation subject and body in the default site language (@language).', array('@language' => $language_default->name)) ."</p>\n";
-	}
-	else {
-	  $help = '<p>'. t('This is a Multilingual website. <a href="@url">Enable the String translation module</a> to enable translation of the confirmation subject and body.', array('@url' => url('admin/build/modules'))) ."</p>\n";
-	}
-	return $help;
+          $help = '<p>'. t('This is a Multilingual website. Enter text for confirmation subject and body in the default site language (@language).', array('@language' => $language_default->name)) ."</p>\n";
+        }
+        else {
+          $help = '<p>'. t('This is a Multilingual website. <a href="@url">Enable the String translation module</a> to enable translation of the confirmation subject and body.', array('@url' => url('admin/build/modules'))) ."</p>\n";
+        }
+      return $help;
       }
       break;
     case 'admin/content/simplenews/types/add':
@@ -2619,7 +2619,7 @@
   if (!function_exists('getrusage')) {
     return 0;
   }
-  
+
   static $start_time;
   $usage = getrusage();
   $now = (float)($dat["ru_stime.tv_sec"] .'.'. $dat["ru_stime.tv_usec"]) + (float)($usage["ru_utime.tv_sec"] .'.'. $usage["ru_utime.tv_usec"]);
Index: simplenews.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.install,v
retrieving revision 1.36.2.3
diff -u -r1.36.2.3 simplenews.install
--- simplenews.install	30 Mar 2010 12:24:03 -0000	1.36.2.3
+++ simplenews.install	18 Jul 2010 12:50:50 -0000
@@ -574,7 +574,7 @@
  */
 function simplenews_update_6006() {
   $ret = array();
-  
+
   // Convert existing node type or re-create it.
   // If _node_types_build() if called before update, the simplenews
   // node type gets deleted because simplenews_node_info() no longer exists.
@@ -588,7 +588,7 @@
   else {
     _simplenews_install_nodetype();
   }
-  
+
   return $ret;
 }
 
@@ -600,7 +600,7 @@
   $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
   while ($role = db_fetch_object($result)) {
     $patterns = array('/create newsletter/', '/edit own newsletter/', '/edit any newsletter/', '/delete own newsletter/', '/delete any newsletter/');
-    $replacements = array('create simplenews content', 'edit own simplenews content', 'edit any simplenews content' ,'delete own simplenews content', 'delete any simplenews content');
+    $replacements = array('create simplenews content', 'edit own simplenews content', 'edit any simplenews content', 'delete own simplenews content', 'delete any simplenews content');
     $renamed_permission = preg_replace($patterns, $replacements, $role->perm);
     if ($renamed_permission != $role->perm) {
       $ret[] = update_sql("UPDATE {permission} SET perm = '$renamed_permission' WHERE rid = $role->rid");
@@ -656,7 +656,7 @@
  */
 function simplenews_update_6101() {
   $ret = array();
-  
+
   $old = array(
     '!site',
     '!mailto',
Index: simplenews.subscription.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.subscription.inc,v
retrieving revision 1.13.2.3
diff -u -r1.13.2.3 simplenews.subscription.inc
--- simplenews.subscription.inc	19 Apr 2010 08:49:34 -0000	1.13.2.3
+++ simplenews.subscription.inc	18 Jul 2010 12:50:53 -0000
@@ -11,10 +11,10 @@
 /**
  * Menu callback: Generates the subscription form for users.
  *
- * @see simplenews_subscription_manager_form_validate()
- * @see simplenews_subscription_manager_form_submit()
+ * @see simplenews_subscriptions_public_all_form_validate()
+ * @see simplenews_subscriptions_public_all_form_submit()
  */
-function simplenews_subscription_manager_form(&$form_state, $snid = NULL) {
+function simplenews_subscriptions_public_all_form(&$form_state, $snid = NULL) {
   global $user;
 
   if (isset($snid)) {
@@ -26,8 +26,9 @@
     $subscription = simplenews_get_subscription($user);
   }
 
-  // If non-admin is trying to edit someone else's subscription, access denied.
-  if ($user->uid && $user->uid != $subscription->uid && !user_access('administer simplenews subscriptions')) {
+  // If admin trying to edit someone else's subscriptions redirect to admin_all_subscriptions page
+  if (user_access('administer simplenews subscriptions') && $user->uid != $subscription->uid) {
+    drupal_goto('admin/content/simplenews/users/edit/' . $snid);
     drupal_access_denied();
     return;
   }
