From d1ac6c1ab60639179c6c38af35160836d0f0a598 Mon Sep 17 00:00:00 2001 From: Artem Daniliants Date: Fri, 19 Mar 2010 11:11:43 +0200 Subject: [PATCH] Fixed minor bugs --- Server/application/controllers/api.php | 4 ++-- Server/application/models/database_dump.sql | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Server/application/controllers/api.php b/Server/application/controllers/api.php index 4d48e13..0b95e41 100644 --- a/Server/application/controllers/api.php +++ b/Server/application/controllers/api.php @@ -111,7 +111,7 @@ class Api_Controller extends Controller{ public function results($category, $limit){ $results = New Result_Model(); $cat = New Category_Model(); - if ($cat->category_exists($category) AND $this->is_authorized()){ + if ($cat->category_exists($category) AND $this->is_authorized() AND isset($limit)){ $view = new View('api/results'); $view->results = $results->get_results($category, $limit); $view->render(true); @@ -142,7 +142,7 @@ class Api_Controller extends Controller{ } else { header("HTTP/1.0 404 Not Found"); - die('Category not found'); + die('Category not found or not authorized'); } } diff --git a/Server/application/models/database_dump.sql b/Server/application/models/database_dump.sql index a1c18e3..bef5041 100644 --- a/Server/application/models/database_dump.sql +++ b/Server/application/models/database_dump.sql @@ -4,7 +4,7 @@ # # Host: localhost (MySQL 5.1.37) # Database: speedfreak -# Generation Time: 2010-03-19 09:49:37 +0200 +# Generation Time: 2010-03-19 11:11:11 +0200 # ************************************************************ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -52,6 +52,7 @@ CREATE TABLE `results` ( `cat_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `value` text NOT NULL, + `result_date` datetime NOT NULL, KEY `cat_id` (`cat_id`), KEY `user_id` (`user_id`), CONSTRAINT `results_ibfk_1` FOREIGN KEY (`cat_id`) REFERENCES `categories` (`id`), @@ -73,7 +74,7 @@ CREATE TABLE `users` ( PRIMARY KEY (`id`), UNIQUE KEY `login_unique` (`username`), UNIQUE KEY `email_unique` (`email`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- 1.7.9.5