2016-01-31 11:47:13 +01:00
|
|
|
|
2016-02-03 12:30:12 +01:00
|
|
|
// Make Namespace
|
2016-02-04 13:20:45 +01:00
|
|
|
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
|
|
|
|
|
|
|
identity.request.login=function($http,username, projectname, password){
|
|
|
|
var requestResultObject={};
|
2016-02-04 13:20:45 +01:00
|
|
|
|
2016-02-05 17:47:53 +01:00
|
|
|
return $http.post('http://localhost.istic-openstack/server/index.php',
|
|
|
|
$.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}),
|
|
|
|
{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}});
|
2016-02-04 13:20:45 +01:00
|
|
|
};
|
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-02-03 12:05:04 +01:00
|
|
|
|
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
|
|
|
|