Exemplo n.º 1
0
 protected function do_login()
 {
     $ul = new UserList();
     $ul->filterByAttribute("{$this->network}_id", $this->user->identifier);
     $list = $ul->get(1);
     $user = $list[0];
     $response = false;
     if ($user != null) {
         $response = User::loginByUserID($user->getUserID());
     }
     return $response;
 }
Exemplo n.º 2
0
 */
$getMembers = function ($filters) use($av) {
    // Filter to show only the staff members, or customize
    // by 'custom template' and choose a block name
    $ul = new UserList();
    $defaultAttribute = ['', true, '='];
    foreach ($filters as $k => $filter) {
        if ($k === 'groups') {
            foreach ($filter as $group) {
                $ul->filterByGroup($group);
            }
        } elseif ($k === 'attributes') {
            // $attribute keys: 'id', 'value', 'compare'
            foreach ($filter as $attribute) {
                list($handle, $value, $comparison) = array_replace($defaultAttribute, $attribute);
                $ul->filterByAttribute($handle, $value, $comparison);
            }
        }
        $ul->sortBy('ak_order', 'asc');
    }
    /**
     * Build doc with all the 'member's in it, and load the values we'll
     * need to display.
     */
    return array_map(function ($member) use($av) {
        return ['id' => $member->getUserID(), 'img' => $av->getImagePath($member), 'name' => trim($member->getAttribute('first_name') . ' ' . $member->getAttribute('last_name')), 'title' => $member->getAttribute('job_title') ?: "Jane's Walk", 'email' => $member->getUserEmail(), 'description' => $member->getAttribute('bio')];
    }, $ul->get(100));
};
echo $controller->getContent();
?>
<ul class="ccm-staff-list">