Re: Re: Re: Is it an April's fool ? If

Posts: 18
Joined: 02/29/2008
Bug Finder

I just replaced the function with the same name, in the uc_product.module file. Is that what I should do to make the fix? I'm making the fix on top of the version I downloaded from here:
http://drupal.org/node/241016
Is that right? Is that all I would need to change?

I haven't seen the bug yet my self, but just trying to prevent it. Smiling

Thanks,
Jacob

Lyle wrote:
Well, even today I found some more problems with uc_product_access(). I'm pretty sure they're fixed now, so this is the version that's in the Bazaar repository:
<?php
function uc_product_access($op, $node) {
  global
$user;
 
$type = is_string($node) ? $node : (is_array($node) ? $node['type'] : $node->type);

  if (
$type == 'product') {
   
$type = '';
  }
  else {
   
$type .= ' ';
  }
  switch (
$op) {
    case
'create':
      return
user_access('create '. $type .'products');
    case
'update':
    case
'delete':
    if (
user_access('edit '. $type .'products') || (user_access('edit own '. $type .'products') && ($user->uid == $node->uid))) {
      return
TRUE;
    }
  }
}
?>

Release Candidate Coming - Preview Available By: Ryan (16 replies) Tue, 04/01/2008 - 09:23