Quoting Peter Paul Elfferich <[EMAIL PROTECTED]>:

It's not so much the list's owner as the entry's owner, which could be
another shared address book, so that would turn into:
"This list contains X1 contacts from address book 'Y1' that you do not have
permission to view. Contact the owner (Z1) if you have questions." And so
forth for X2, Y2 and Z2 etc. Where X is the number of contacts, Y is the
name of the source address book and Z1 is the owner of the address book or
share.

New patch attached from Michael Rubinsky. That wording is a bit verbose and also intensive on the list code. I'd prefer to provide a general help link to a description of share permissions.

-chuck
Index: browse.php
===================================================================
RCS file: /repository/turba/browse.php,v
retrieving revision 1.76.2.25
diff -u -r1.76.2.25 browse.php
--- browse.php	3 Aug 2007 23:54:05 -0000	1.76.2.25
+++ browse.php	7 Feb 2008 23:46:52 -0000
@@ -315,6 +315,10 @@
             if (!is_object($results = $list->listMembers($sortcolumn, $prefs->getValue('sortdir')))) {
                 $notification->push(_("Failed to browse list"), 'horde.error');
             } else {
+         	    if ($results->count() != $list->count()) {
+         	    	$notification->push(sprintf(_("There are %d contact(s) in this list that are not viewable to you"),
+         	    	                            ($list->count() - $results->count())), 'horde.message');
+         	    }
                 $view = &new Turba_ListView($results);
                 $view->setType('list');
             }
Index: lib/Driver/sql.php
===================================================================
RCS file: /repository/turba/lib/Driver/sql.php,v
retrieving revision 1.59.10.17
diff -u -r1.59.10.17 sql.php
--- lib/Driver/sql.php	30 Nov 2006 21:33:47 -0000	1.59.10.17
+++ lib/Driver/sql.php	7 Feb 2008 23:46:52 -0000
@@ -182,6 +182,15 @@
             $where = $criteria . ' = ?';
             $values[] = $this->_convertToDriver($id);
         }
+        if (isset($this->map['__owner'])) {
+            if ($this->usingShares) {
+                $owner = $this->share->get('uid');
+            } else {
+                $owner = Auth::getAuth();
+            }
+            $where .= ' AND ' . $this->map['__owner'] . ' = ?';
+            $values[] = $this->_convertToDriver($owner);
+        }
         if (!empty($this->_params['filter'])) {
             $where .= ' AND ' . $this->_params['filter'];
         }
Index: lib/Object/Group.php
===================================================================
RCS file: /repository/turba/lib/Object/Group.php,v
retrieving revision 1.9.2.2
diff -u -r1.9.2.2 Group.php
--- lib/Object/Group.php	14 Nov 2005 21:03:27 -0000	1.9.2.2
+++ lib/Object/Group.php	7 Feb 2008 23:46:53 -0000
@@ -123,6 +123,16 @@
         return true;
     }
 
+    function count()
+    {
+    	$children = unserialize($this->attributes['__members']);
+    	if (!is_array($children)) {
+    		return 0;
+    	} else {
+    		return count($children);
+    	}
+    }
+
     /**
      * Retrieve the Objects in this group
      *
@@ -163,14 +173,10 @@
                     $sourceId .= ':' . $owner;
                 }
                 $driver = &Turba_Driver::singleton($sourceId);
-                // Don't prune contacts if the source is not
-                // found, could just be temporarily unavailable.
                 if (!is_a($driver, 'PEAR_Error')) {
                     $contact = $driver->getObject($contactId);
                     if (is_a($contact, 'PEAR_Error')) {
-                        // Remove the contact if it no longer exists
-                        $this->removeMember($contactId, $sourceId);
-                        $modified = true;
+                    	continue;
                     }
                 } else {
                     continue;

Reply via email to