mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 09:32:34 +00:00
fix identation
This commit is contained in:
parent
5d2ef7dac4
commit
5f4aaa4a11
@ -1,60 +1,24 @@
|
|||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular
|
angular
|
||||||
.module('vertoControllers')
|
.module('vertoControllers')
|
||||||
.controller('LoginController', ['$scope', '$http', '$location', 'verto',
|
.controller('LoginController', ['$scope', '$http', '$location', 'verto',
|
||||||
function($scope, $http, $location, verto) {
|
function($scope, $http, $location, verto) {
|
||||||
$scope.checkBrowser();
|
var preRoute = function() {
|
||||||
|
if(verto.data.connected) {
|
||||||
|
$location.path('/dialpad');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
preRoute();
|
||||||
|
|
||||||
/*
|
|
||||||
* Load the Configs before logging in
|
|
||||||
* with cache buster
|
|
||||||
*/
|
|
||||||
|
|
||||||
$http.get(window.location.pathname + '/config.json?cachebuster=' + Math.floor((Math.random()*1000000)+1))
|
verto.data.name = $scope.storage.data.name;
|
||||||
.success(function(data) {
|
verto.data.email = $scope.storage.data.email;
|
||||||
|
|
||||||
/* save these for later as we're about to possibly over write them */
|
console.debug('Executing LoginController.');
|
||||||
var name = verto.data.name;
|
}
|
||||||
var email = verto.data.email;
|
]);
|
||||||
|
|
||||||
console.debug("googlelogin: " + data.googlelogin);
|
|
||||||
if (data.googlelogin){
|
|
||||||
$scope.googlelogin = data.googlelogin;
|
|
||||||
$scope.googleclientid = data.googleclientid;
|
|
||||||
}
|
|
||||||
|
|
||||||
angular.extend(verto.data, data);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* use stored data (localStorage) for login, allow config.json to take precedence
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (name != '' && data.name == '') {
|
|
||||||
verto.data.name = name;
|
|
||||||
}
|
|
||||||
if (email != '' && data.email == '') {
|
|
||||||
verto.data.email = email;
|
|
||||||
}
|
|
||||||
if (verto.data.login == '' && verto.data.password == '' && $scope.storage.data.login != '' && $scope.storage.data.password != '') {
|
|
||||||
verto.data.login = $scope.storage.data.login;
|
|
||||||
verto.data.password = $scope.storage.data.password;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (verto.data.autologin == "true" && !verto.data.autologin_done) {
|
|
||||||
console.debug("auto login per config.json");
|
|
||||||
verto.data.autologin_done = true;
|
|
||||||
$scope.login();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
verto.data.name = $scope.storage.data.name;
|
|
||||||
verto.data.email = $scope.storage.data.email;
|
|
||||||
|
|
||||||
console.debug('Executing LoginController.');
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user