function private_node_mark_private in Private 6
Same name and namespace in other branches
- 7 private.module \private_node_mark_private()
Callback for 'Mark as private' node operation
1 call to private_node_mark_private()
- private_set_private_action in ./
private.module - Implementation of a Drupal action.
1 string reference to 'private_node_mark_private'
- private_node_operations in ./
private.module - Implementation of hook_node_operations().
File
- ./
private.module, line 300 - A tremendously simple access control module -- it allows users to mark individual nodes as private; users with 'access private content' perms can read these nodes, while others cannot.
Code
function private_node_mark_private($nids) {
foreach ($nids as $nid) {
db_query('UPDATE {private} SET private = %d WHERE nid = %d', 1, $nid);
if (!db_affected_rows()) {
db_query('INSERT INTO {private} (nid, private) VALUES (%d, %d)', $nid, 1);
}
}
}