istic-openstack/client/js/requests/identity.js

32 lines
728 B
JavaScript
Raw Normal View History

2016-01-31 11:47:13 +01:00
2016-02-03 12:30:12 +01:00
// Make Namespace
var identity = {};
2016-02-05 17:47:53 +01:00
identity.request = {}; // Request part
identity.requestParser = {}; // Parser part
2016-02-03 12:30:12 +01:00
2016-02-05 17:47:53 +01:00
2016-02-05 19:35:38 +01:00
identity.request.login=function($http,username, password,projectname){
2016-02-05 17:47:53 +01:00
var requestResultObject={};
2016-02-05 20:52:13 +01:00
return $http.post('../server/index.php',
2016-02-05 17:47:53 +01:00
$.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}),
{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}});
};
2016-02-03 12:30:12 +01:00
2016-01-31 11:47:13 +01:00
2016-02-05 17:47:53 +01:00
identity.requestParser.parseLoginAnswer=function(response){
var requestParserResult={};
requestParserResult.status=0;
requestParserResult.data=response.data;
2016-01-31 11:47:13 +01:00
2016-02-05 17:47:53 +01:00
// TODO
return requestParserResult;
};
2016-01-31 11:47:13 +01:00