Merge branch 'loic' into develop
This commit is contained in:
commit
e026ce21b4
2 changed files with 11 additions and 4 deletions
|
@ -29,10 +29,10 @@ mainApp.controller('loginCtrl', ['$scope','$sce','Identity', function ($scope,$s
|
||||||
|
|
||||||
result.then(function (response){
|
result.then(function (response){
|
||||||
// Parser result
|
// Parser result
|
||||||
var requestResultObject=Identity.parseLoginAnswer(response);
|
var response=Identity.getResponse();
|
||||||
|
|
||||||
// Check for error
|
// Check for error
|
||||||
if(requestResultObject.status!==0){
|
if(response.status!==0){
|
||||||
|
|
||||||
$('#failedToLoginAlert').show();
|
$('#failedToLoginAlert').show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ mainApp.factory('Identity',[ '$http', function($http){
|
||||||
profile.projectname="Undefined";
|
profile.projectname="Undefined";
|
||||||
profile.token="";
|
profile.token="";
|
||||||
|
|
||||||
|
/* Will contain the result of the $http request */
|
||||||
|
var $httpResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to connect to OpenStack
|
* Function to connect to OpenStack
|
||||||
|
@ -21,8 +23,9 @@ mainApp.factory('Identity',[ '$http', function($http){
|
||||||
profile.username=username;
|
profile.username=username;
|
||||||
profile.projectname=projectname;
|
profile.projectname=projectname;
|
||||||
|
|
||||||
return $http.post('../server/index.php',
|
$httpResponse=$http.post('../server/index.php',
|
||||||
$.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}));
|
$.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}));
|
||||||
|
return $httpResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,11 +48,15 @@ mainApp.factory('Identity',[ '$http', function($http){
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var getResponse=function(){
|
||||||
|
return parseLoginAnswer($httpResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return services objects
|
// Return services objects
|
||||||
return {
|
return {
|
||||||
login: login,
|
login: login,
|
||||||
parseLoginAnswer: parseLoginAnswer,
|
getResponse: getResponse,
|
||||||
profile: profile
|
profile: profile
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue