You are here

function protected_node_action_protect_nodes_with_password in Protected Node 6

Same name and namespace in other branches
  1. 7 protected_node.settings.inc \protected_node_action_protect_nodes_with_password()
  2. 1.0.x protected_node.settings.inc \protected_node_action_protect_nodes_with_password()

Make sure all nodes with a password are protected.

It is possible to unprotect a node and still have a password on it. This function restores those nodes protection (i.e. sets the is_protected to 1).

1 string reference to 'protected_node_action_protect_nodes_with_password'
protected_node_admin_settings in ./protected_node.settings.inc
Define the settings form

File

./protected_node.settings.inc, line 659
Configuration file for the protected_node module.

Code

function protected_node_action_protect_nodes_with_password($form, &$form_state) {
  $sql = "UPDATE {protected_nodes} SET protected_node_is_protected = 1 WHERE protected_node_is_protected = 0 AND protected_node_passwd <> ''";
  db_query($sql);
  drupal_set_message(t('All nodes with an existing password (excluding the global password) are now protected.'));
}