summaryrefslogtreecommitdiff
path: root/client/js/requests
diff options
context:
space:
mode:
Diffstat (limited to 'client/js/requests')
-rw-r--r--client/js/requests/identity.js40
1 files changed, 31 insertions, 9 deletions
diff --git a/client/js/requests/identity.js b/client/js/requests/identity.js
index d34af53..b2c7273 100644
--- a/client/js/requests/identity.js
+++ b/client/js/requests/identity.js
@@ -1,21 +1,43 @@
-// Make Namespace
+/**
+ * Client Identity Module
+ * @namespace identity
+ */
var identity = {};
-identity.request = {}; // Request part
-identity.requestParser = {}; // Parser part
-
-
-identity.request.login=function($http,username, password,projectname){
- var requestResultObject={};
-
+/**
+ * Contain all request who can be send with http request
+ * @namespace request
+ */
+identity.request = {};
+
+/**
+ * Contain parser for result of request made by {@link identity.request}
+ * @namespace request
+ */
+identity.requestParser = {};
+
+
+/**
+ *
+ * @param {object} $http Angular $http service
+ * @param {string} username The user name
+ * @param {string} password The user password
+ * @param {string} projectname The user project name
+ * @returns {promise} The result of the request
+ */
+identity.request.login=function($http,username, password,projectname){
return $http.post('../server/index.php',
$.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}),
{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}});
};
-
+/**
+ *
+ * @param {string} response The response to parse
+ * @returns {requestParserResult} Formated data
+ */
identity.requestParser.parseLoginAnswer=function(response){
var requestParserResult={};