--- securepages.module	(revision 3292)
+++ securepages.module	(working copy)
@@ -92,6 +92,18 @@
     '#rows' => 5,
     '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '<em>blog</em>' for the blog page and '<em>blog/*</em>' for every personal blog. '<em>&lt;front&gt;</em>' is the front page."),
   );
+
+  $contenttypes=array();
+  foreach(node_get_types() as $k=>$v)
+    $contenttypes[$k]=$v->name;
+  $form['securepages_contenttypes'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Content Types'),
+    '#default_value' => variable_get('securepages_contenttypes',array()),
+    '#options' => $contenttypes,
+    '#description' => t('Viewing and editing selected content types will be made secure (unless listed in the "Ignore pages" list below).'),
+  );
+
   $form['securepages_ignore'] = array(
     '#type' => 'textarea',
     '#title' => t('Ignore pages'),
@@ -268,6 +280,16 @@
   }
   if ($pages) {
     $regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($pages, '/')) .')$/';
+
+    // if this path refers to a node or node-operation, check the content type against our securepages_contenttypes list.
+    $pathsplit = explode('/',$path);
+    if( isset($pathsplit[1]) && $pathsplit[0]==='node' && is_numeric($pathsplit[1]) ) {
+      $node=node_load($pathsplit[1]);
+      $securecontenttypes = variable_get('securepages_contenttypes',array());
+      if( isset($securecontenttypes[$node->type]) && $securecontenttypes[$node->type] )
+        return 1;
+    }
+
     return !($secure xor preg_match($regexp, $path)) ? 1 : 0;
   }
   else {
