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);
}
else {
header("HTTP/1.0 404 Not Found");
- die('Category not found');
+ die('Category not found or not authorized');
}
}
#
# 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 */;
`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`),
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;