From a6b0eaab5e1a77e0caa09fa7652f33cdeec9d950 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Fri, 22 Jul 2011 16:07:38 +0200 Subject: [PATCH] Move Eike's config-stuff to a new folder so he can deal with it later. --- application/controllers/api/statusrpc.php | 49 +++++++++++++++++++ .../configurations/fields.php | 0 .../configurations/index.php | 0 3 files changed, 49 insertions(+) create mode 100644 application/controllers/api/statusrpc.php rename application/controllers/{web => stashed for eikes later use}/configurations/fields.php (100%) rename application/controllers/{web => stashed for eikes later use}/configurations/index.php (100%) diff --git a/application/controllers/api/statusrpc.php b/application/controllers/api/statusrpc.php new file mode 100644 index 0000000..89fec9b --- /dev/null +++ b/application/controllers/api/statusrpc.php @@ -0,0 +1,49 @@ +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($secret, $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); + } +} \ No newline at end of file diff --git a/application/controllers/web/configurations/fields.php b/application/controllers/stashed for eikes later use/configurations/fields.php similarity index 100% rename from application/controllers/web/configurations/fields.php rename to application/controllers/stashed for eikes later use/configurations/fields.php diff --git a/application/controllers/web/configurations/index.php b/application/controllers/stashed for eikes later use/configurations/index.php similarity index 100% rename from application/controllers/web/configurations/index.php rename to application/controllers/stashed for eikes later use/configurations/index.php