Welcome Guest, Not a member yet? Register   Sign In
flexi auth - A user authentication library for CodeIgniter

[eluser]Unknown[/eluser]
Hello!

Is it possible to change the user's group?

I've tried this without success:

Code:
public function set_user_group($groupID){
        // Get group details
        $query = $this->db->get_where("user_groups",array("ugrp_id"=>$groupID));
        $row = $query->row();
        // Set session data
        $this->auth->session_data[$this->auth->session_name['group']] = array($row->ugrp_id=>$row->ugrp_name);
        // Update database
        $this->db->where("uacc_id",$this->flexi_auth->get_user_id());
        $this->db->update("user_accounts",array("uacc_group_fk" => 1));
        // Gives new group ID
        // echo $this->flexi_auth->get_user_group_id();
       redirect("test");
}
public function test(){
        // Gives old group ID
        echo $this->flexi_auth->get_user_group_id();
}


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 10-09-2013, 02:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB