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

Posts: 2259
Joined: 08/07/2007
AdministratoreLiTe!

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