* @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();
}