[turba] Map attribute in the sources

Chuck Hagenbuch chuck@horde.org
Sat, 16 Dec 2000 03:52:09 -0500


Quoting Christian Couder <christian@alcove.fr>:

> I think we must change this if we want to be able to deal with many
> objects from the same source.
> 
> For example if we want to deal with a source with both users and lists
> we could have something like:

Change the terminology to "objects" and "groups", and I'm happy:

>     'map' => array(
> 	'object' => array(
> 	        '__key' => 'uid',
> 	        'name' => 'fullname',
> 	        'email' => 'email',
> 	        'alias' => 'alias'
> 		),
> 	'group' => array(
> 		'__key' => 'group_id',
> 		'owner' => 'owner_id',
> 		'name' => 'name'
> 		)
> 	)


-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"If you can't stand the heat, get out of the chicken!" - Baby Blues


>From jack@zft.co.uk Date: r
Return-Path: <jack@zft.co.uk>
Mailing-List: contact turba-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list turba@lists.horde.org
Received: (qmail 48728 invoked from network); 19 Dec 2000 09:36:51 -0000
Received: from where.zft.co.uk (213.219.35.245)
  by horde.org with SMTP; 19 Dec 2000 09:36:51 -0000
Received: (from wwwrun@localhost)
	by where.zft.co.uk (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id JAA26525
	for turba@lists.horde.org; Tue, 19 Dec 2000 09:36:50 GMT
Received: from 213.219.35.248 ( [213.219.35.248])
	as user jack@imap.zft.co.uk by where.zft.co.uk with HTTP;
	r
Message-ID: <977218610.3a3f2c3248094@where.zft.co.uk>
Date: r
From: Jack Bertram <jack@zft.co.uk>
To: turba@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 2.3.6-cvs
X-Logged: Logged by where.zft.co.uk as JAA26525 at Tue Dec 19 09:36:50 2000
Subject: sql driver in turba

Hi all,

Noticed that the sql driver search function was only returning one row of
results and enclose a one-line patch.

Jack

--- cvs.horde.org.vanilla/horde/turba/lib/Driver/sql.php	Tue Dec  5
17:08:16 2000
+++ cvs.horde.org.working/horde/turba/lib/Driver/sql.php	Tue Dec 19 09:30:20
2000
@@ -64,17 +64,18 @@

         $results = array();
         if (isset($result)) {
-            $row = $result->fetchRow();
-            if (isset($row)) {
-                $entry = array();
-
-                for ($i = 0; $i < count($fields); $i++) {
-                    $field = $fields[$i];
-                    $entry[$field] = $row[$i];
-                }
-
-                $results[] = $entry;
-            }
+            while ($row = $result->fetchRow()) {
+
	    if (isset($row)) {
+
		$entry = array();
+
		
+
		for ($i = 0; $i < count($fields); $i++) {
+
		    $field = $fields[$i];
+
		    $entry[$field] = $row[$i];
+
		}
+
		
+
		$results[] = $entry;
+
	    }
+
	}
         }

         return $results;


----- End forwarded message -----


>From jack@zft.co.uk Date: r
Return-Path: <jack@zft.co.uk>
Mailing-List: contact turba-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list turba@lists.horde.org
Received: (qmail 48832 invoked from network); 19 Dec 2000 09:40:54 -0000
Received: from where.zft.co.uk (213.219.35.245)
  by horde.org with SMTP; 19 Dec 2000 09:40:54 -0000
Received: (from wwwrun@localhost)
	by where.zft.co.uk (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id JAA26596
	for turba@lists.horde.org; Tue, 19 Dec 2000 09:40:53 GMT
Received: from 213.219.35.248 ( [213.219.35.248])
	as user jack@imap.zft.co.uk by where.zft.co.uk with HTTP;
	r
Message-ID: <977218853.3a3f2d2520f8b@where.zft.co.uk>
Date: r
From: Jack Bertram <jack@zft.co.uk>
To: turba@lists.horde.org
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-MOQ977218853e77550f1788e0495ad3982006b027c07"
User-Agent: Internet Messaging Program (IMP) 2.3.6-cvs
X-Logged: Logged by where.zft.co.uk as JAA26596 at Tue Dec 19 09:40:53 2000
Subject: sql driver

---MOQ977218853e77550f1788e0495ad3982006b027c07
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Hi all,

Here's the patch as an attachment, since I didn't realise IMP wrapped emails to
76 columns :)

Jack

---MOQ977218853e77550f1788e0495ad3982006b027c07
Content-Type: unknown/; name="turba.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="turba.patch"

LS0tIGN2cy5ob3JkZS5vcmcudmFuaWxsYS9ob3JkZS90dXJiYS9saWIvRHJpdmVyL3NxbC5wa
HAJVHVlIERlYyAgNSAxNzowODoxNiAyMDAwCisrKyBjdnMuaG9yZGUub3JnLndvcmtpbmcvaG
9yZGUvdHVyYmEvbGliL0RyaXZlci9zcWwucGhwCVR1ZSBEZWMgMTkgMDk6MzA6MjAgMjAwMAp
AQCAtNjQsMTcgKzY0LDE4IEBACiAgICAgICAgIAogICAgICAgICAkcmVzdWx0cyA9IGFycmF5
KCk7CiAgICAgICAgIGlmIChpc3NldCgkcmVzdWx0KSkgewotICAgICAgICAgICAgJHJvdyA9I
CRyZXN1bHQtPmZldGNoUm93KCk7Ci0gICAgICAgICAgICBpZiAoaXNzZXQoJHJvdykpIHsKLS
AgICAgICAgICAgICAgICAkZW50cnkgPSBhcnJheSgpOwotICAgICAgICAgICAgICAgIAotICA
gICAgICAgICAgICAgIGZvciAoJGkgPSAwOyAkaSA8IGNvdW50KCRmaWVsZHMpOyAkaSsrKSB7
Ci0gICAgICAgICAgICAgICAgICAgICRmaWVsZCA9ICRmaWVsZHNbJGldOwotICAgICAgICAgI
CAgICAgICAgICAkZW50cnlbJGZpZWxkXSA9ICRyb3dbJGldOwotICAgICAgICAgICAgICAgIH
0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAkcmVzdWx0c1tdID0gJGVudHJ
5OwotICAgICAgICAgICAgfQorICAgICAgICAgICAgd2hpbGUgKCRyb3cgPSAkcmVzdWx0LT5m
ZXRjaFJvdygpKSB7CisJCSAgICBpZiAoaXNzZXQoJHJvdykpIHsKKwkJCSRlbnRyeSA9IGFyc
mF5KCk7CisJCQkKKwkJCWZvciAoJGkgPSAwOyAkaSA8IGNvdW50KCRmaWVsZHMpOyAkaSsrKS
B7CisJCQkgICAgJGZpZWxkID0gJGZpZWxkc1skaV07CisJCQkgICAgJGVudHJ5WyRmaWVsZF0
gPSAkcm93WyRpXTsKKwkJCX0KKwkJCQorCQkJJHJlc3VsdHNbXSA9ICRlbnRyeTsKKwkJICAg
IH0KKwkJfQogICAgICAgICB9CiAgICAgICAgIAogICAgICAgICByZXR1cm4gJHJlc3VsdHM7C
g==


---MOQ977218853e77550f1788e0495ad3982006b027c07--