Active
Project:
Content Profile
Version:
6.x-1.0
Component:
Base module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2010 at 13:12 UTC
Updated:
2 Jun 2010 at 13:12 UTC
Content Profile seems currently limited to one profile node per content type, which I am fine with. Upon trying to add another node for an existing type users are normally redirected to the node edit page. Except for when a user has the 'administer nodes' permission, then strange things start to happen:
function content_profile_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if ($op == 'prepare' && is_content_profile($node) && !isset($node->nid) && $node->uid && !user_access('administer 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);
}
}
Because of that (bogus?) user_access() check, anybody with administrator privileges is actually allowed to create more than profile node (which will never be displayed anywhere, though). This looks like a bug to me.