You are here

API.txt in Protected Node 5

Same filename and directory in other branches
  1. 6 API.txt
There is now a simple API with three functions ready to be used by 3rd party modules:

bool protected_node_set_protected(int $nid, string $password)
=============================================================
With this method you can set a node (identified by the provided nid) to protected with the given password.
If the node was already protected, it will update its password to provided one.

This method returns TRUE if the action performed was successful. It will return FALSE not only when the
database action was unsuccessful, but when you provide a $nid with not a numeric type or an empty password.

bool protected_node_unset_protected(int $nid)
=============================================
This method removes protection from the node identified by the provided nid. It will return TRUE if the 
action was successful, but returns FALSE if the action wasn't successful or you provided a non-numeric nid.

bool protected_node_isset_protected(int $nid)
=============================================
This method returns TRUE if the node identified by the provided nid is set to be protected. Returns FALSE if
the node isn't protected or you provided a non-numeric nid.

File

API.txt
View source
  1. There is now a simple API with three functions ready to be used by 3rd party modules:
  2. bool protected_node_set_protected(int $nid, string $password)
  3. =============================================================
  4. With this method you can set a node (identified by the provided nid) to protected with the given password.
  5. If the node was already protected, it will update its password to provided one.
  6. This method returns TRUE if the action performed was successful. It will return FALSE not only when the
  7. database action was unsuccessful, but when you provide a $nid with not a numeric type or an empty password.
  8. bool protected_node_unset_protected(int $nid)
  9. =============================================
  10. This method removes protection from the node identified by the provided nid. It will return TRUE if the
  11. action was successful, but returns FALSE if the action wasn't successful or you provided a non-numeric nid.
  12. bool protected_node_isset_protected(int $nid)
  13. =============================================
  14. This method returns TRUE if the node identified by the provided nid is set to be protected. Returns FALSE if
  15. the node isn't protected or you provided a non-numeric nid.