You are here

function protected_node_enterpassword in Protected Node 5

Same name and namespace in other branches
  1. 6 protected_node.redirect.inc \protected_node_enterpassword()
  2. 7 protected_node.redirect.inc \protected_node_enterpassword()
  3. 1.0.x protected_node.redirect.inc \protected_node_enterpassword()
1 string reference to 'protected_node_enterpassword'
protected_node_menu in ./protected_node.module
Implementation of hook_menu(). @link http://api.drupal.org/api/function/hook_menu/5

File

./protected_node.module, line 259

Code

function protected_node_enterpassword() {
  if (!isset($_GET['destination'])) {

    // Illegal call
    watchdog('protected_node', t('Illegal call to /protected-node'), WATCHDOG_WARN);
    drupal_access_denied();
  }
  $info = variable_get('protected_node_info', '');
  if (module_exists('token')) {
    $info = token_replace($info, 'node', node_load($_SESSION['_protected_node']['current']));
  }
  $form['protected_node'] = array(
    '#value' => check_plain($info),
  );
  $form['protected_node_enterpassword'] = array(
    '#type' => 'fieldset',
    '#description' => t('The node you are trying to view is password protected. Please enter password below to proceed.'),
    '#collapsible' => FALSE,
  );
  $form['protected_node_enterpassword']['password'] = array(
    '#type' => 'password',
    '#title' => t('Node password'),
    '#size' => 20,
  );
  $form['protected_node_enterpassword']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('OK'),
  );
  return $form;
}