[prev in list] [next in list] [prev in thread] [next in thread] 

List:       turba
Subject:    Re: [turba] Restricting user list when sharing address book
From:       Davide Della Giustina <davide.dellagiustina () ascotlc ! it>
Date:       2006-03-23 19:45:27
Message-ID: loom.20060323T203156-48 () post ! gmane ! org
[Download RAW message or body]

Chuck Hagenbuch <chuck <at> horde.org> writes:

> 
> Quoting Davide Della Giustina <davide.dellagiustina <at> ascotlc.it>:
> 
> > Is there any method to let a user see *only* his group ?
> 
> Not currently. It'd be a pretty simple change if people are in favor  
> of it. There are other places we've restricted things to just a user's  
> groups and have gotten feedback that users need to see outside their  
> own groups sometimes. I can go either way; I suppose it could also be  
> a configuration option but I'd rather not go that route for consistency.
> -chuck
 
Well... I'm no php programmer but i believe something like that should be okay:
/horde/templates/shares/edit.inc

//Actual user
$whoami = $auth->getAuth();
//Groups the user is in
$withami = $groups->getGroupMemberships($whoami);
// Every user that is in the same group as the actual user
$list = array();
foreach ($withami as $idgr => $grname)
{
 $list = $groups->listAllUsers($idgr);
}
And using:
    <?php foreach ($list as $user) { if ($user != $owner) { 
      <option value="<?php echo htmlspecialchars($user) ?>">
	<?php 
	echo htmlspecialchars(Auth::removeHook($user)) 
	?>
...
when listing users and using
    <?php 
    foreach ( $withami as $gid => $group ) { if (empty($groupperms[$gid])) {
    ?>
listing groups.
I did not test this config extensively but neither found any bug so far...
If somebody wishes the entire text I would gladly post it.

Regards,
 Davide

-- 
Turba mailing list - Join the hunt: http://horde.org/bounties/#turba
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: turba-unsubscribe@lists.horde.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic