Closed (fixed)
Project:
Protected Node
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Feb 2008 at 15:24 UTC
Updated:
25 Apr 2008 at 07:51 UTC
At the moment we can not select for which node types (content types) we want to offer node protection.
There are guys they are realizing that by a cck filed. For that see: http://drupal.org/project/password and this feature request: http://drupal.org/node/126129
I've solved this problem by adding a settings page where you can select the node types. And then I changed the hook_form_alter:
// check if this node type should be protected
$types_to_protect = variable_get('protected_node_nodetypes');
if (!in_array($form['type']['#value'], $types_to_protect)) {
return;
}
and
hook_nodeapi
$types_to_protect = variable_get('protected_node_nodetypes');
if (!in_array($node->type, $types_to_protect)) {
return;
}
I hope that's all. :)
| Comment | File | Size | Author |
|---|---|---|---|
| protected_node.module.5.x-1.x-dev.patch | 2.56 KB | osopolar |
Comments
Comment #1
osopolarI was reviewing it and saw that it was not working for anonymos. The reason was the missing 2nd parameter in variable_get
should be 0 or an empty array
I hope it's ok now.
Comment #2
mtolmacs commentedI think it's ready for HEAD, so I merged it. Please report any problems you find.
Comment #3
mtolmacs commentedComment #4
mtolmacs commentedComment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.