Re: leaf through users

Matthias Nothhaft <[email protected]> Sun, 05 Feb 2006 12:11:54 +0100
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Lukas Kahwe Smith schrieb:
> Matthias Nothhaft wrote:
> 
>> Hi,
>>
>> I would like to view an edit form with data from user X and prev/next
>> buttons.
>>
>> The admin user who is currently logged may only see/edit users with
>> perm_type <= current user
>>
>> I have a 'createtime' in the auth_users table and want to get the
>> prev/next IDs by comparing this time with the current record.
>>
>> I tried to getUsers() but without success... :-(
>>
>> $filter = array(
>>     'auth_container_name' => $this->_authContainer,
>>     'perm_type' => array('op' => '<=', 'value' => $current_perm_type,
>>     'createtime' => array('op' => '>' 'value' => $user['createtime']
>> );
>>
>> This gives me: Couldn't create the query, reason: not all fields
>> (createtime) could be linked to a table (perm_users, userrights, rights,
>> groupusers)
>>
>> If I try the 'auth' container I cannot filter by 'perm_type'.
>>
>>
>> Is there a chance to get it work with LiveUser or should I write my own
>> queries for this purpose? ;-)
> 
> 
> the clean solution would be to move the createtime to the
> liveusers_perm_users table if possible
> 
I had postponed that problem... I just need a way to get "reliable"
prev/next buttons (IDs).

'createtime' was just a workaround idea because auth_user_id is not a
sequence in my application.

Probably it works if I change the filter to not look for createtime, but
for next/prev perm_user_id:

filter (
    'perm_user_id' =>
      array('op' => '<', 'value' => $user['perm_user_id'])
)

and

filter (
    'perm_user_id' =>
      array('op' => '>', 'value' => $user['perm_user_id'])
)


Maybe this is a nice question for the LU FAQ :-)

Regards,
Matthias