Added login functionality to users controller
authorArtem Daniliants <artem@daniliants.com>
Mon, 24 May 2010 08:04:04 +0000 (11:04 +0300)
committerArtem Daniliants <artem@daniliants.com>
Mon, 24 May 2010 08:04:04 +0000 (11:04 +0300)
Server/application/controllers/users.php

index ee20517..bcfd042 100644 (file)
@@ -78,6 +78,20 @@ class Users_Controller extends Controller{
        $view->render(true);
     }
     
+    /**
+    * 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();
+    }
+    
     
     /**
      * Check that supplied avatar is valid and store it