X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Server%2Fapplication%2Fcontrollers%2Fusers.php;h=94badbe7ae10299cbf901eda1e4721c9d33a0396;hp=ee20517c87eab0a5dbae640f0ccd5e168f847b84;hb=c9fc4fe3bc02ba4c440e4cb95097a1b8d1b37243;hpb=16692981b5e3265ac6734b84d91571e305b79d61 diff --git a/Server/application/controllers/users.php b/Server/application/controllers/users.php index ee20517..94badbe 100644 --- a/Server/application/controllers/users.php +++ b/Server/application/controllers/users.php @@ -71,11 +71,29 @@ class Users_Controller extends Controller{ * @return string Returns XML containing list of all users or error message */ public function list_all(){ - $users = new User_Model(); - $list = $users->list_all_users(); - $view = new View('api/user_list'); - $view->list = $list; - $view->render(true); + if (apiler::is_authorized()){ + $users = new User_Model(); + $list = $users->list_all_users(); + $view = new View('api/user_list'); + $view->list = $list; + $view->render(true); + } + else + apiler::not_authorized(); + } + + /** + * 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(); }