Index: includes/handlers.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/includes/Attic/handlers.inc,v
retrieving revision 1.2.2.4
diff -u -p -F '^f' -r1.2.2.4 handlers.inc
--- includes/handlers.inc	22 Oct 2010 04:02:34 -0000	1.2.2.4
+++ includes/handlers.inc	22 Oct 2010 04:07:34 -0000
@@ -75,7 +75,8 @@ function skinr_submit_handler(&$form, $f
         $hook  = $module;
         $key   = skinr_handler('form_index_handler', 'submit', $form_settings['index_handler'], $form, $form_state);
         $value = array();
-  
+        $saved = skinr_get($theme_name, $hook , $key);
+
         if (!empty($theme['widgets']) && is_array($theme['widgets'])) {
           foreach ($theme['widgets'] as $skin_id => $skin_value) {
             $skin_value = is_array($skin_value) ? _skinr_array_strip_empty($skin_value) : $skin_value;
@@ -84,26 +85,41 @@ function skinr_submit_handler(&$form, $f
             }
           }
         }
-  
+
         if (isset($theme['advanced']['_additional'])) {
           $theme['advanced']['_additional'] = trim($theme['advanced']['_additional']);
           if (!empty($theme['advanced']['_additional'])) {
             $value['_additional'] = $theme['advanced']['_additional'];
           }
         }
-  
+        else {
+          if (!user_access('access skinr classes') && isset($saved['_additional'])) {
+            // The user didn't have access to change this. Ensure the existing
+            // custom classes remain by populating the element with the
+            // previously saved values.
+            $value['_additional'] = $saved['_additional'];
+          }
+        }
         if (isset($theme['advanced']['_template'])) {
           $theme['advanced']['_template'] = trim($theme['advanced']['_template']);
           if (!empty($theme['advanced']['_template'])) {
             $value['_template'] = $theme['advanced']['_template'];
           }
         }
-  
+        else {
+          if (!user_access('access skinr classes') && isset($saved['_template'])) {
+            // The user didn't have access to change this. Ensure the existing
+            // template selection remains by populating the element with the
+            // previously saved values.
+            $value['_template'] = $saved['_template'];
+          }
+        }
+
         if (empty($key)) {
           // We didn't receive a valid key, so raise an error
           drupal_set_message(t("Skinr settings weren't saved due to an error."), 'error');
         }
-  
+
         skinr_set($theme_name, $hook, $key, $value);
       }
     }
