Пример #1
0
 public function list_results($category, $limit, $show_unit = false)
 {
     $results = new Result_Model();
     $cat = new Category_Model();
     if ($cat->category_exists($category) and apiler::is_authorized() and isset($limit)) {
         $view = new View('api/results');
         $view->results = $results->get_results($category, $limit);
         $view->show_unit = $show_unit;
         $view->render(true);
     } else {
         apiler::not_authorized();
     }
 }
Пример #2
0
 /**
  * Verify credentials
  *
  * @return string Returns string "OK" if login is successful and error otherwise
  */
 public function login()
 {
     if (apiler::is_authorized()) {
         print "OK";
         die;
     } else {
         apiler::not_authorized();
     }
 }