Re: Joining users to another table
Lukas Smith <[email protected]>
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Organization | BackendMedia GbR |
| Message-ID | <[email protected]> |
Dan Rossi wrote:
> Hi there I am needing to get the users table joined to say a customers
> table so we can add users for that customer. Is there a way to do this,
> either add the customerID in the users table or userId in the customer
> table ? Let me know
What you would need to do is have a look at
PEAR/LiveUser/Perm/Storage/Globals.php
this file defines the entire permission structure. also keep in mind
that users are unique identified by their id in the perm container and
not by their id in the auth container (as there can be multiple auth
containers using the same auth id naming scheme). therefore you want to
create the relation on perm_user_id. i hope the file itself is somewhat
self explaining.
This is all quite new territory but you have the following options.
1)
include LiveUser/Perm/Storage/Globals.php;
and modify the arrays at runtime
$GLOBALS['_LiveUser']['perm']['tables']
$GLOBALS['_LiveUser']['perm']['fields']
$GLOBALS['_LiveUser']['perm']['alias']
2)
modify the LiveUser/Perm/Storage/Globals.php in your pear directory, or
stick a modified version into an include path that is checked before
your pear path
3)
pass in the necessary arrays as permission container parameters. these
arrays will be merged with the default LiveUser/Perm/Storage/Globals.php
arrays.
'permContainer' => array(
'type' => 'Complex',
'storage' => array(
$perm => array(
'connection' => $db,
'dsn' => $dsn,
'prefix' => 'liveuser_',
'tables' => array(),
'fields' => array(),
'alias' => array(),
),
),
),
regards,
Lukas Smith
[email protected]
_______________________________
BackendMedia
www.backendmedia.com
[email protected]
Linn Zwoch Smith GbR
Pariser Str. 44
D-10707 Berlin
Tel +49 30 83 22 50 00
Fax +49 30 83 22 50 07