Beispiel #1
0
 function get_xml_category($category_id)
 {
     $category_lookup = $this->db->get_where('categories', array('category_id' => $category_id));
     if ($category_lookup->num_rows() == 0) {
         show_error_xml("No service found with id \"{$category_id}\".", OPEN311_SERVICE_ID_NOT_FOUND);
     }
     $this->db->where('category_id', $category_id);
     $this->db->order_by("order", "asc");
     $data['attributes'] = $this->db->get('category_attributes');
     $data['category_id'] = $category_id;
     $this->load->view('category_attributes_xml', $data);
 }
Beispiel #2
0
 function _get_source_client_from_api($api_key)
 {
     if (is_config_true(config_item('open311_use_api_keys'))) {
         if (empty($api_key)) {
             show_error_xml("You must provide an API key to submit reports to this server.", OPEN311_SERVICE_BAD_API_KEY);
         } else {
             $api_key_lookup = $this->db->get_where('api_keys', array('api_key' => $api_key));
             if ($api_key_lookup->num_rows() == 0) {
                 show_error_xml("The API key you provided (\"{$api_key}\") is not valid for this server.", OPEN311_SERVICE_BAD_API_KEY);
             } else {
                 return $api_key_lookup->row()->client_id;
             }
         }
     }
 }