| 1 |
<?php |
<?php |
| 2 |
// $Id: clone.module,v 1.9.4.10 2008/05/23 00:39:42 pwolanin Exp $ |
// $Id: clone.module,v 1.9.4.11 2008/05/23 00:40:55 pwolanin Exp $ |
| 3 |
// $Name: DRUPAL-5 $ |
// $Name: DRUPAL-5 $ |
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_help(). |
* Implementation of hook_help(). |
| 57 |
global $user; |
global $user; |
| 58 |
// Check basic permissions first. |
// Check basic permissions first. |
| 59 |
$access = (user_access('clone node') || ($user->uid && ($node->uid == $user->uid) && user_access('clone own nodes'))); |
$access = (user_access('clone node') || ($user->uid && ($node->uid == $user->uid) && user_access('clone own nodes'))); |
| 60 |
|
// Make sure the user can view the original node content. |
| 61 |
|
$access = $access && node_access('view', $node); |
| 62 |
// Check additional conditions |
// Check additional conditions |
| 63 |
$access = $access && (clone_is_permitted($node->type) && filter_access($node->format) && node_access('create', $node->type)); |
$access = $access && (clone_is_permitted($node->type) && filter_access($node->format) && node_access('create', $node->type)); |
| 64 |
// Let other modules alter this - for exmple to only allow some users |
// Let other modules alter this - for exmple to only allow some users |