sogo/UI/WebServerResources/js/Main.js
2020-05-08 10:40:46 -04:00

2 lines
1.3 KiB
JavaScript

!function(){"use strict";function o(o,n,t,e,i,a){var r=this;this.$onInit=function(){this.creds={username:n.cookieUsername,password:null,rememberLogin:angular.isDefined(n.cookieUsername)&&0<n.cookieUsername.length},/\blanguage=/.test(n.location.search)&&(this.creds.language=n.language),this.loginState=!1,this.verificationCodePattern="\\d{6}",this.showLogin=!1,t(function(){r.showLogin=!0},100)},this.login=function(){return r.loginState="authenticating",a.login(r.creds).then(function(o){o.gamissingkey?r.loginState="googleauthenticatorcode":(r.loginState="logged",r.cn=o.cn,t(function(){n.location.href===o.url?n.location.reload(!0):n.location.href=o.url},1e3))},function(o){r.loginState="error",r.errorMessage=o.error}),!1},this.restoreLogin=function(){r.loginState=!1,delete r.creds.verificationCode},this.showAbout=function(o){function n(o){this.closeDialog=function(){o.hide()}}i.show({targetEvent:o,templateUrl:"aboutBox.html",controller:n,controllerAs:"about"}),n.$inject=["$mdDialog"]},this.changeLanguage=function(o){n.location.href=ApplicationBaseURL+"login?language="+this.creds.language}}angular.module("SOGo.MainUI",["SOGo.Common","SOGo.Authentication"]),o.$inject=["$scope","$window","$timeout","Dialog","$mdDialog","Authentication"],angular.module("SOGo.MainUI").controller("LoginController",o)}();
//# sourceMappingURL=Main.js.map