[horde] admin/user.php on horde hEAD 3 sept

alan walters alan at radiowave.ie
Sun Sep 4 05:08:39 PDT 2005


I amtryingtounderstand the below snipof code from admin/user.php

In horde. I am trying todisplaymy users frommy ldap directory and am getting
no results.

I guess that this is the section that I need to be looking at.

 

    $search_pattern = Util::getFormData('search_pattern', '');

 

    $users = $auth->listUsers();

 

Where are the contents of these above search strings kept. Also I can see
that it wold be possible to limit the users that you show

 

require_once 'Horde/Array.php';

 

but again where is this file?????

 

I have sent a few other queires recently regarding variations on this
problem.please can someone provide me some insight. Horde has worked well
for us for some time now so I have a good understanding of how it works. But
I find it difficult when no one can provide me with an idea of where I am
going wrong.

 

Please can someone shed somelight on this.

 

Regards alan walters

 

if ($auth->hasCapability('list')) {

 

    /* If we aren't supplied with a page number, default to page 0. */

    $page = Util::getFormData('page', 0);

    $search_pattern = Util::getFormData('search_pattern', '');

 

    $users = $auth->listUsers();

    if (is_a($users, 'PEAR_Error')) {

        Horde::fatal($users, __FILE__, __LINE__);

    }

 

    /* Returns only users that match the specified pattern. */

    require_once 'Horde/Array.php';

    $users = preg_grep('/' . $search_pattern . '/', $users);

    sort($users);

 

    require_once 'Horde/UI/Pager.php';

    $viewurl = Util::addParameter('admin/user.php', 'search_pattern',
$search_pattern);

 

    $numitem = count($users);

    $perpage = 20;

 

    $min = $page * $perpage;

    while ($min > $numitem) {

        $page--;

        $min = $page * $perpage;

    }

    $max = $min + $perpage;

 

    $start = ($page * $perpage) + 1;

    $end = min($numitem, $start + $perpage - 1);

 

 



More information about the horde mailing list