You are here

function protected_node_unset_protected in Protected Node 6

Same name and namespace in other branches
  1. 5 protected_node.module \protected_node_unset_protected()
  2. 7 protected_node.module \protected_node_unset_protected()
  3. 1.0.x protected_node.module \protected_node_unset_protected()

This method marks the specified node as unprotected.

@param[in] int $nid The node identifier.

Return value

TRUE if the node was protected before the call, FALSE otherwise.

File

./protected_node.module, line 934

Code

function protected_node_unset_protected($nid) {
  $r = db_result(db_query("SELECT protected_node_is_protected FROM {protected_nodes} WHERE nid = %d", $nid)) == 1;
  db_query("UPDATE {protected_nodes} SET protected_node_is_protected = 0 WHERE nid = %d", $nid);
  return $r;
}