Created
June 2, 2010 15:34
-
-
Save bcmiller/422523 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cvs diff: Diffing . | |
Index: content_profile.module | |
=================================================================== | |
RCS file: /cvs/drupal-contrib/contributions/modules/content_profile/Attic/content_profile.module,v | |
retrieving revision 1.1.2.41 | |
diff -u -p -r1.1.2.41 content_profile.module | |
--- content_profile.module 5 Aug 2009 14:08:34 -0000 1.1.2.41 | |
+++ content_profile.module 2 Jun 2010 15:14:06 -0000 | |
@@ -24,6 +24,14 @@ function content_profile_ctools_plugin_d | |
} | |
/** | |
+ * Implementation of hook_nodeapi(). | |
+ */ | |
+ function content_profile_perm() { | |
+ return array('administer content profile nodes'); | |
+} | |
+ | |
+ | |
+/** | |
* Implementation of hook_menu(). | |
*/ | |
function content_profile_menu() { | |
@@ -41,7 +49,7 @@ function content_profile_menu() { | |
'page callback' => 'drupal_get_form', | |
'page arguments' => array('content_profile_admin_settings', $type), | |
'access callback' => 'user_access', | |
- 'access arguments' => array('administer nodes'), | |
+ 'access arguments' => array('administer content profile nodes'), | |
'type' => MENU_LOCAL_TASK, | |
'weight' => 1, | |
); | |
@@ -89,7 +97,7 @@ function content_profile_page_access($ty | |
// Else user may view the page when they are going to create their own profile | |
// or have permission to create it for others. | |
global $user; | |
- if ($user->uid == $account->uid || user_access('administer nodes') ){ | |
+ if ($user->uid == $account->uid || user_access('administer content profile nodes') ){ | |
return node_access('create', $type); | |
} | |
return FALSE; | |
@@ -372,15 +380,16 @@ function _content_profile_node_delete($n | |
* Implementation of hook_nodeapi(). | |
*/ | |
function content_profile_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { | |
+ global $last_nid; | |
- if ($op == 'prepare' && is_content_profile($node) && !isset($node->nid) && $node->uid && !user_access('administer nodes') && arg(0) != 'admin') { | |
+ if ($op == 'prepare' && is_content_profile($node) && !isset($node->nid) && $node->uid && !user_access('administer content profile nodes') && arg(0) != 'admin') { | |
// Check if this nodetype already exists | |
if ($nid = content_profile_profile_exists($node, $node->uid)) { | |
// This node already exists, redirect to edit page | |
drupal_goto('node/'. $nid .'/edit', 'destination=user/'. $node->uid); | |
} | |
} | |
- elseif ($op == 'validate' && is_content_profile($node) && user_access('administer nodes')) { | |
+ elseif ($op == 'validate' && is_content_profile($node) && user_access('administer content profile nodes')) { | |
$form = $a3; | |
// Only validate if the user-name changed or we add a new node | |
if (!empty($node->nid) && $form['author']['name']['#default_value'] == $node->name) { | |
@@ -512,7 +521,7 @@ function content_profile_show_profiles($ | |
// Working around the bug described at http://drupal.org/node/302873 | |
module_load_include('inc', 'content_profile', 'content_profile.theme'); | |
} | |
- elseif (user_access('create '. $type .' content') && content_profile_get_settings($type, 'add_link') && !$node && ($uid == $user->uid || user_access('administer nodes'))) { | |
+ elseif (user_access('create '. $type .' content') && content_profile_get_settings($type, 'add_link') && !$node && ($uid == $user->uid || user_access('administer content profile nodes'))) { | |
$content['content_profile_'. $type] = array( | |
'#admin' => $uid != $user->uid, | |
'#theme' => 'content_profile_display_add_link', | |
cvs diff: Diffing modules | |
cvs diff: Diffing panels | |
cvs diff: Diffing panels/relationships | |
cvs diff: Diffing tests | |
cvs diff: Diffing translations | |
cvs diff: Diffing views |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment