--- protected_node.module	2007-11-08 04:44:56.000000000 +0100
+++ protected_node.module	2008-02-20 15:29:44.000000000 +0100
@@ -42,6 +42,12 @@ function protected_node_perm() {
  */
 function protected_node_form_alter($form_id, &$form)
 {
+  // check if this node type should be protected
+  $types_to_protect = variable_get('protected_node_nodetypes');
+  if (!in_array($form['type']['#value'], $types_to_protect)) {
+	  return;
+	}
+  
 	if ($form['#id'] == 'node-form' && (user_access('edit protected content') || user_access('edit protected '.$form['type']['#value']) ))
 	{
 		drupal_add_js(drupal_get_path('module', 'protected_node') . '/js/common.js');
@@ -85,6 +91,12 @@ function protected_node_form_alter($form
 function protected_node_nodeapi(&$node, $op, $arg = 0, $page = 0) {
 	global $user, $protected_node_salt;
 	
+	$types_to_protect = variable_get('protected_node_nodetypes');
+	
+	if (!in_array($node->type, $types_to_protect)) {
+	  return;
+	}
+
 	switch ($op) {
 		case 'load':
       		$output['is_protected'] = db_result(db_query('SELECT count(*) FROM {protected_nodes} WHERE nid = %d', $node->nid)) > 0;
@@ -147,6 +159,14 @@ function protected_node_menu($may_cache)
 
   if ($may_cache){
     $items[] = array(
+      'path' => 'admin/settings/protected_node',
+      'title' => t('Protected node'),
+      'description' => t('Here you change protected node settings'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => 'protected_node_admin_settings',
+      'access' => user_access('administer site configuration'),
+      );
+    $items[] = array(
       'path' => 'protected-node',
       'title' => t('Protected node - Enter Password'),
       'description' => t('Here you can enter the password for the node'),
@@ -320,4 +340,21 @@ function protected_node_enterpassword_va
 function protected_node_enterpassword_submit($form_id, $form) {
 	$_SESSION['_protected_node']['passwords'][$form['from']] = TRUE;
 	drupal_goto('node/' . $form['from']);
+}
+
+/**
+ * Define the settings form
+ *
+ * @return $form: the settings form
+ **/
+function protected_node_admin_settings() {
+  $form['protected_node_nodetypes'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Users may protect these node types'),
+    '#options' => node_get_types('names'),
+    '#default_value' => variable_get('protected_node_nodetypes'),
+    '#description' => t('There will be the option to protect nodes by password and you can set it for these node types.')
+  );
+  $form['array_filter'] = array('#type' => 'hidden');
+  return system_settings_form($form);
 }
\ No newline at end of file
