diff options
| author | Yoggzo <yogg@epsina.com> | 2016-02-08 17:10:24 +0100 |
|---|---|---|
| committer | Yoggzo <yogg@epsina.com> | 2016-02-08 17:10:24 +0100 |
| commit | f1585a13323d408b6917a514bed1920aec3780f0 (patch) | |
| tree | b98a23443d20af008cbb8eca16a7aff7c9aa823c /client/js/requests | |
| parent | 43b65e1dbb53300d076f5885b5393ff68e248dd1 (diff) | |
| parent | 1cd1ae92f414573942262f65dc1644e8ff9bb8f6 (diff) | |
Merge branch 'develop' into Evan
mise a jour
Diffstat (limited to 'client/js/requests')
| -rw-r--r-- | client/js/requests/identity.js | 86 |
1 files changed, 48 insertions, 38 deletions
diff --git a/client/js/requests/identity.js b/client/js/requests/identity.js index cad1261..be3f4f8 100644 --- a/client/js/requests/identity.js +++ b/client/js/requests/identity.js @@ -1,42 +1,52 @@ -// Make Namespace -var identity = {} ; - - - - - - -/* -mainApp.controller('identityCtrl', function($scope, $http) { - - $scope.identityFormData = {}; - - $scope.processForm = function() { - - $http({ - method : 'POST', - url : 'http://148.60.11.31/', - data : $.param($scope.identityFormData), - headers : { 'Content-Type': 'application/x-www-form-urlencoded' } - }) - .success(function(data) { - console.log(data); - - if (!data.success) { - // if not successful, bind errors to error variables - //$scope.errorName = data.errors.name; - //$scope.errorSuperhero = data.errors.superheroAlias; - } else { - // if successful, bind success message to message - //$scope.message = data.message; - } - }); - }; - - +/** + * Client Identity Module + * @namespace identity + */ +var identity = {}; + +/** + * 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})); +}; + + +/** + * + * @param {string} response The response to parse + * @returns {requestParserResult} Formated data + */ +identity.requestParser.parseLoginAnswer=function(response){ + var requestParserResult={}; + + requestParserResult.status=0; + requestParserResult.data=response.data; -});*/ - + // TODO + + + return requestParserResult; +}; |
