| 1 |
<?php |
<?php |
| 2 |
// $Id: acl.module,v 1.18 2009/01/27 01:17:33 salvis Exp $ |
// $Id: acl.module,v 1.19 2009/02/20 21:46:00 salvis Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file acl.module |
* @file |
| 6 |
|
* An API module providing by-user access control lists. |
| 7 |
* |
* |
| 8 |
* This module handles ACLs on behalf of other modules. The two main reasons |
* This module handles ACLs on behalf of other modules. The two main reasons |
| 9 |
* to do this are so that modules using ACLs can share them with each |
* to do this are so that modules using ACLs can share them with each |
| 80 |
$acls[] = $o->acl_id; |
$acls[] = $o->acl_id; |
| 81 |
} |
} |
| 82 |
if ($acls) { |
if ($acls) { |
| 83 |
db_query("DELETE FROM {acl_node} WHERE nid = %d AND acl_id in (%s)", $nid, |
db_query("DELETE FROM {acl_node} WHERE nid = %d AND acl_id IN (". db_placeholders($acls) .")", array_merge(array($nid), $acls)); |
|
implode(',', $acls)); |
|
| 84 |
} |
} |
| 85 |
} |
} |
| 86 |
|
|
| 153 |
} |
} |
| 154 |
|
|
| 155 |
/** |
/** |
| 156 |
* Implementation of hook_nodeapi |
* Implementation of hook_nodeapi(). |
| 157 |
*/ |
*/ |
| 158 |
function acl_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { |
function acl_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { |
| 159 |
switch ($op) { |
switch ($op) { |
| 164 |
} |
} |
| 165 |
|
|
| 166 |
/** |
/** |
| 167 |
* Implementation of hook_user |
* Implementation of hook_user(). |
| 168 |
*/ |
*/ |
| 169 |
function acl_user($op, &$edit, &$account, $category = NULL) { |
function acl_user($op, &$edit, &$account, $category = NULL) { |
| 170 |
switch ($op) { |
switch ($op) { |
| 175 |
} |
} |
| 176 |
|
|
| 177 |
/** |
/** |
| 178 |
* Implementation of hook_node_access_explain |
* Implementation of hook_node_access_explain(). |
| 179 |
*/ |
*/ |
| 180 |
function acl_node_access_explain($row) { |
function acl_node_access_explain($row) { |
| 181 |
static $interpretations = array(); |
static $interpretations = array(); |