load->database(); } public function verifyUser($username, $userPass) { $pass = md5(substr_replace($userPass, $this->config->item('encryption_key'), 1, 0)); $this->db->select("username, fullName, userlvl, branch"); $result = $this->db->get_where("userinfo", array("username"=>$username, "pass"=>$pass)); if($result->num_rows() == 1) { foreach($result->result() as $row) { $this->username = $row->username; $this->fullName = $row->fullName; $this->userlvl = $row->userlvl; $this->branch = $row->branch; } return true; } else return false; } }