[dev] Re: Horde_Share patch

Chuck Hagenbuch chuck at horde.org
Wed Oct 27 09:15:34 PDT 2004


Quoting Ben Chavet <ben at chavet.net>:

> My patch works remarkably well for what I need to do, even if it 
> isn'tsupposed
> to :)  Just send a string $owner to listGalleries which then trickles through
> all of the calls & then grabs all galleries belonging to $owner.
>
> getShareCriteria is the critical call for that functionallity, 
> though. So, I'm
> thinking that we probably just need to do some extra checks there to make it
> reliable.  Is there a way to check for ($owner == true) vs. (owner ==
> 'some-string')?  If so, we could do some variant of:
>
>    if ($owner == true)
>        get all shares belonging to $userid
>    else if ($owner == 'johndoe')
>        get all shares belonging to 'johndoe'

Like Jan, I dislike overriding the parameter. I think it would be 
reasonable to
change what $owner is, though - to make it a string containing a userid 
instead
of a boolean, and for the logic to be that if it's non-null, then we 
only return
shares that $userid can access that $owner owns. That means that to get the
current behavior of setting $owner to true, we'd need to update calls to just
pass the same value that's passed for $userid as $owner (instead of 
true). That
seems consistent to me and gives Ben what he needs.

Any objections?

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the dev mailing list