You are here

function protected_node_enterpassword_validate in Protected Node 5

Same name and namespace in other branches
  1. 6 protected_node.redirect.inc \protected_node_enterpassword_validate()
  2. 7 protected_node.redirect.inc \protected_node_enterpassword_validate()
  3. 1.0.x protected_node.redirect.inc \protected_node_enterpassword_validate()

File

./protected_node.module, line 296

Code

function protected_node_enterpassword_validate($form_id, $form) {
  global $_protected_node_salt;
  $cnt = db_result(db_query('SELECT COUNT(*) FROM {protected_nodes} WHERE passwd = \'%s\' AND nid = %d', sha1($_protected_node_salt . $form['password']), $_SESSION['_protected_node']['current']));
  if ($cnt < 1) {
    form_set_error('password', t('Incorrect password!'));
  }
}