var trboApplication=angular.module("login",["ngAnimate","ngSanitize"]).controller("loginController",function($scope,$http,$location){var loginErrorMessage="Login nicht erfolgreich",locationUrl=$location.url(),generateUniqueId=function(){var suffix=Math.floor(Math.random()*100).toString(),prefix='xxxxxx-xxxx-xxxxxx-xxxx-xxxxxx|'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8),s=v.toString(16);return s});return prefix+suffix},getUrlParameter=function getUrlVars(url,parameter){var parameters={},hash,hashes=url.slice(url.indexOf('?')+1).split('&');for(var i=0;i-1){$scope.emailPlaceholder="E-mail address";$scope.lang="en"}}catch(error){} $scope.checkLogin=function(userData,resend){$scope.loading=!0;$scope.error=!1;$scope.lang="de";$http.post("/login/validate",{user_name:userData.user_name,password:userData.password,tr_b_uuid:userData.tr_b_uuid,login_uuid:resend===!0?"":userData.login_uuid}).success(function(result){if(result.success===!0){if(angular.isDefined(locationUrl)&&locationUrl){document.location.href=locationUrl}else if(fallbackDestination){document.location.href=fallbackDestination}else{document.location.href="/admin"}}else{$scope.loading=!1;$scope.password="";$scope.error=!0;$scope.errorMessage=loginErrorMessage}}).error(function(result){$scope.error=!0;$scope.loading=!1;$scope.errorCode=result.code;$scope.password="";const ERROR_NEW_BROWSER_EN=2000003;const ERROR_WRONG_AUTHCODE_EN=2000004;if(result.code==2000001){$scope.errorMessage="Achtung! Sie versuchen sich über einen uns unbekannten Browser anzumelden.

Aus Sicherheitsgründen wurde Ihnen ein Code an die hier hinterlegte E-Mail Adresse versendet, um Ihren Account vor unberechtigten Zugriffen zu schützen. Bitte prüfen Sie Ihr E-Mail Postfach gegebenenfalls auch im Spam."}else if(result.code==ERROR_NEW_BROWSER_EN){$scope.errorMessage="Attention Please! You are attempting to log-in from a browser unknown to us.

For security reasons, a code has been sent to the Email address entered here, in order to protect your account from unauthorized access. Please revise your inbox and also your spam folder in case the email was ordered as spam.";$scope.lang="en"}else if(result.code==ERROR_WRONG_AUTHCODE_EN){$scope.errorMessage="Sorry, the security code you provided is incorrect.

Please generate a new code and use the new security code to log in again. Generate security code";$scope.lang="en"}else if(result.code==2000002){$scope.errorMessage="Der Sicherheitscode, den Sie angegeben haben ist leider falsch.

Bitte generieren Sie einen neuen Code und verwenden Sie den neuen Sicherheitscode für eine erneute Anmeldung. Sicherheitscode erstellen"}else if(result.code==2000005){$scope.lang="en";$scope.errorMessage="Login failed"}else{$scope.errorMessage=loginErrorMessage}})};function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i