load->model('job'); $query = $this->db->get_where('servers', array('secret' => $secret)); // if we are in production mode, we do not want to tell the evil hacker // that he used a wrong secret. That just encourages him. if($query->num_rows() < 1 && ENVIRONMENT != 'production') { die("Unauthorized access."); } $this->job->update($job_id, $progress); } /** * Update the workload of the server. */ public function update_workload() { $this->load->model('server'); $query = $this->db->get_where('servers', array('secret' => $secret)); // if we are in production mode, we do not want to tell the evil hacker // that he used a wrong secret. That just encourages him. if($query->num_rows() < 1 && ENVIRONMENT != 'production') { die("Unauthorized access."); } $this->server->updateWorkload($secret, $workload); } }