[turba] Manually Adding use_shares in SQL, DataTree Permissions

Tony Lay tonylay at gmail.com
Thu Apr 6 09:43:39 PDT 2006


I'm trying to determine how to manually set up a turba database for
use_shares.  The script hangs after the first prompt and I'd rather
just learn/try to do this manually.  I'm running 5.4-STABLE FreeBSD,
PHP Version: 4.4.1, MySQL 4.1.15.

I enable "use_shares"

// I log in
Apr 06 12:13:59 HORDE [notice] [imp] Login success for tony
[192.168.X.X] to {XX.XX.XX.XXX:143} [on line 152 of
"/usr/local/www/data-dist/horde/imp/redirect.php"]

// I try to run a search on the database with use_shares enabled
Apr 06 12:13:59 HORDE [debug] [horde] SQL Query by
Prefs_sql::retrieve(): SELECT pref_scope, pref_name, pref_value FROM
horde_prefs WHERE pref_uid = ? AND (pref_scope = ? OR pref_scope =
'horde') ORDER BY pref_scope [on line 154 of
"/usr/local/lib/php/Horde/Prefs/sql.php"]
Apr 06 12:13:59 HORDE [debug] [horde] SQL Query by
Prefs_sql::retrieve(): SELECT pref_scope, pref_name, pref_value FROM
horde_prefs WHERE pref_uid = ? AND (pref_scope = ? OR pref_scope =
'horde') ORDER BY pref_scope [on line 154 of
"/usr/local/lib/php/Horde/Prefs/sql.php"]
Apr 06 12:14:01 HORDE [debug] [] SQL Query by Prefs_sql::retrieve():
SELECT pref_scope, pref_name, pref_value FROM horde_prefs WHERE
pref_uid = ? AND (pref_scope = ? OR pref_scope = 'horde') ORDER BY
pref_scope [on line 154 of "/usr/local/lib/php/Horde/Prefs/sql.php"]

// Turba looks to the DataTree for permissions
Apr 06 12:14:01 HORDE [debug] [turba] SQL Query by
DataTree_sql::getByAttributes(): SELECT c.datatree_id, c.datatree_name
FROM horde_datatree c LEFT JOIN horde_datatree_attributes a1 ON
a1.datatree_id = c.datatree_id WHERE c.group_uid = ? AND
(a1.attribute_name = ? AND a1.attribute_key = ?)   GROUP BY
c.datatree_id, c.datatree_name, c.datatree_order ORDER BY
c.datatree_order, c.datatree_name, c.datatree_id [on line 1121 of
"/usr/local/lib/php/Horde/DataTree/sql.php"]
Apr 06 12:14:01 HORDE [debug] [turba] SQL Query by
DataTree_sql::getByAttributes(): SELECT c.datatree_id, c.datatree_name
FROM horde_datatree c LEFT JOIN horde_datatree_attributes a1 ON
a1.datatree_id = c.datatree_id WHERE c.group_uid = ? AND
((a1.attribute_name = ? AND a1.attribute_value = ?) OR
(a1.attribute_name = ? AND a1.attribute_key = ? AND a1.attribute_value
\& ?) OR (a1.attribute_name = ? AND a1.attribute_value \& ?) OR
(a1.attribute_name = ? AND a1.attribute_value \& ?))   GROUP BY
c.datatree_id, c.datatree_name, c.datatree_order ORDER BY
c.datatree_order, c.datatree_name, c.datatree_id [on line 1121 of
"/usr/local/lib/php/Horde/DataTree/sql.php"]
Apr 06 12:14:01 HORDE [debug] [turba] SQL Query by
DataTree_sql::_buildParentIds(): SELECT datatree_id, datatree_parents
FROM horde_datatree WHERE datatree_name = ? AND group_uid = ? ORDER BY
datatree_id [on line 275 of
"/usr/local/lib/php/Horde/DataTree/sql.php"]
Apr 06 12:14:01 HORDE [debug] [turba] SQL Query by
DataTree_sql::_load(): SELECT c.datatree_id, c.datatree_name,
c.datatree_parents, c.datatree_order FROM horde_datatree c WHERE
c.group_uid = 'horde.shares.turba'  [on line 144 of
"/usr/local/lib/php/Horde/DataTree/sql.php"]

//I get a blank result panel (sidebar still present)

I turn off use_shares and everything works fine for individual address
books.  I looked for horde.shares.turba in the database and came
across three entries.

horde.horde_datatree horde.shares.turba
datatree_id group_uid			user_uid	datatree_name	datatree_parents	datatree_order	datatree_data	datatree_serialized	datatree_updated
9676  	horde.shares.turba  	brian  	brian  		:9674  		NULL			NULL 
		0				2005-12-14 12:25:53
9681 		horde.shares.turba 	jon 		localsql 			  		NULL 		 
				0				2005-12-15 02:30:49
9680 		horde.shares.turba 	jon 		jon 			:9681			NULL			NULL
			0				2005-12-15 02:30:49

Looking at the entries made me wonder if I could manually add the
permissions into mysql, assuming that I change ownership of the
contacts and put in the correct datatree numbers.  An explination of
how the permissions work in the datatree might be enough to get me
there.

I'm not much of a coder, but I saw in the Turba.php file it's a fairly
simple mechanism.  If use_shares=yes in sources.php and the
permissions check out then turba should return the source.  I can take
care of the contacts ownership, I was hoping somebody could give me
direction on how the rest of the tables should line up.  I'm having
difficulty extrapolating it from the script and the only way I could
get further debugging information was through horde.

Thanks for your help!

-Tony


More information about the turba mailing list