Skip to content

Commit

Permalink
Optimized create_group existing group check
Browse files Browse the repository at this point in the history
via sprindo.

Resolves issue #367.
  • Loading branch information
benedmunds committed Dec 16, 2012
1 parent 0788e08 commit e9332c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/ion_auth_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1689,8 +1689,8 @@ public function create_group($group_name = FALSE, $group_description = NULL)
}

// bail if the group name already exists
$existing_group = $this->db->get_where('groups', array('name' => $group_name))->row();
if(!is_null($existing_group->id))
$existing_group = $this->db->get_where($this->tables['groups'], array('name' => $group_name))->num_row();
if($existing_group !== 0)
{
$this->set_error('group_already_exists');
return FALSE;
Expand Down

0 comments on commit e9332c6

Please sign in to comment.