0

I am playing with codeigniter and ion auth for the first time. I have got everything working however, in the ion auth template, the index view displays a list of all users.

<?php foreach ($users as $user):?>
    <tr>
        <td><?php echo $user->first_name;?></td>
        <td><?php echo $user->last_name;?></td>
        <td><?php echo $user->email;?></td>
        <td>
            <?php foreach ($user->groups as $group):?>
                <?php echo anchor("auth/edit_group/".$group->id, $group->name) ;?><br />
            <?php endforeach?>
        </td>
        <td><?php echo ($user->active) ? anchor("auth/deactivate/".$user->id, 'Active') : anchor("auth/activate/". $user->id, 'Inactive');?></td>
        <td><?php echo anchor("auth/edit_user/".$user->id, 'Edit') ;?></td>
    </tr>
<?php endforeach;?>

Normally the $users array would come from the model. however upon looking into the model(ion_auth_model), I cant see anything specific to $users. the auth controller doesn't give me too much either.

in the documentation, the users() function is: $users = $this->ion_auth->users();

I presume this is the array being populated on the index page. How is this pulling the MySQL data if not in a model? how does this work?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Smudger
  • 10,451
  • 29
  • 104
  • 179

1 Answers1

1

@Smudger - look a little closer, the ion_auth_model has a function users() starting around line 1125 (depending on your version) that takes an optional $groups argumant

jmadsen
  • 3,635
  • 2
  • 33
  • 49
  • Thanks jmadsen, I cannot find that function anywhere in the ion_auth_model. version is [link]https://github.com/benedmunds/CodeIgniter-Ion-Auth/zipball/2 any ideas or am I being a total idiot? – Smudger Feb 26 '13 at 11:31
  • I assume the zip file is the same as the git repo: https://github.com/benedmunds/CodeIgniter-Ion-Auth/blob/2/models/ion_auth_model.php line 1150 – jmadsen Feb 26 '13 at 12:55