public function appsync() { $this->load->library('GoogleDomain'); $api_key = $this->input->post('email'); $api_secret = $this->input->post('password'); $users = array(); $groups = array(); $message = ''; $error = false; try { $users = GoogleDomain::get_users($api_key, $api_secret); $groups = GoogleDomain::get_groups($api_key, $api_secret); } catch (GoogleDomainException $e) { $error = true; $message = $e->getMessage(); } $data['json'] = array('error' => $error, 'message' => $message, 'users' => $users, 'groups' => $groups); $this->respond('', 'accounts', $data); }