summaryrefslogtreecommitdiff
path: root/client/js/controllers
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-02-05 16:44:15 +0100
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-02-05 16:44:15 +0100
commit31f3a9d77fd3c2af679be75ddd2a4e18a3599082 (patch)
tree4ca255ef6a41df5c9f73b7a33f89c3b91cde4898 /client/js/controllers
parentc2a5b1880c19c1490c42eb40a6a15ce2bc64b9e9 (diff)
parent784b25754c6b168a6c015aa39837c34339c88444 (diff)
Merge branch 'loic' of github.com:manzerbredes/istic-openstack into loic
Diffstat (limited to 'client/js/controllers')
-rw-r--r--client/js/controllers/login.js48
1 files changed, 25 insertions, 23 deletions
diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js
index 2f74414..d08a9f2 100644
--- a/client/js/controllers/login.js
+++ b/client/js/controllers/login.js
@@ -1,8 +1,3 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
/**
* Represents a book.
@@ -10,30 +5,37 @@
*/
mainApp.controller('loginCtrl', function ($scope,$interval,$sce)
{
- // Define default states
- $('#loginModal').modal({backdrop: 'static', keyboard: false});
- $('#loadingLoginButton').hide();
- $('#failedToLoginAlert').hide();
+ // Define default states
+ $('#loginModal').modal({backdrop: 'static', keyboard: false});
+ $('#loadingLoginButton').hide();
+ $('#failedToLoginAlert').hide();
- $('#loginButton').click(function(){
- $('#loginButton').hide();
- $('#loadingLoginButton').show();
- $('#failedToLoginAlert').hide();
+ $('#loginButton').click(function(){
+ $('#loginButton').hide();
+ $('#loadingLoginButton').show();
+ $('#failedToLoginAlert').hide();
-
+ var result=identity.login($("#loginFormUsername").val(), $("#loginFormProjectname").val(), $("#loginFormPassword").val());
- $interval(
- function()
- {
- $('#failedToLoginAlert').show();
+ $interval(
+ function()
+ {
+ // Check for error
+ if(!errors.checkForLogin(result)){
+ $('#failedToLoginAlert').show();
+ }
+ else {
+ $('#loginModal').modal('hide');
+ }
+
+ // Reset button state
$('#loginButton').show();
- $('#loadingLoginButton').hide();
-
- }, 2000,1);
-
+ $('#loadingLoginButton').hide();
+ }, 2000,1);
+
});
-})
+});