From Habari Project
You can retrieve the current user, who could be anonymous.
$user = User::identify();
Users can be retrieved through group membership.
$usergroup = Usergroups::get(array('name'=>'authenticated')); // Get a list of ids $user_ids = $usergroup->members; // Get the actual users $users = $usergroup->users;
Users can also be retrieved by any database field (username, email, id).
$users = Users::get(array('username' => 'admin'));
As for posts, additional information can be stored for users. If you store a user's hometown in a userfield called 'hometown', you can access users from Chicago this way:
$users = Users::get( array( 'info' => array( 'hometown' => 'Chicago' ) ) );