KEYCLOAK-177

This commit is contained in:
Stian Thorgersen 2013-11-23 10:20:31 +00:00
parent 4c3f995a43
commit 7698e40aa5
4 changed files with 12 additions and 25 deletions

View file

@ -41,7 +41,6 @@
<script src="/auth-server/admin-ui/js/bootstrap-tokenfield.js"></script> <script src="/auth-server/admin-ui/js/bootstrap-tokenfield.js"></script>
--> -->
<script src="js/app.js"></script> <script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/controllers/realm.js"></script> <script src="js/controllers/realm.js"></script>
<script src="js/controllers/applications.js"></script> <script src="js/controllers/applications.js"></script>
<script src="js/controllers/users.js"></script> <script src="js/controllers/users.js"></script>
@ -51,7 +50,7 @@
</head> </head>
<body class="admin-console" data-ng-controller="GlobalCtrl"> <body class="admin-console" data-ng-controller="GlobalCtrl" ng-cloak>
<div id="idletimeout"> <div id="idletimeout">
You will be logged off in <strong><span></span> seconds</strong> due to inactivity. You will be logged off in <strong><span></span> seconds</strong> due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using this web page</a>. <a id="idletimeout-resume" href="#">Click here to continue using this web page</a>.

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var module = angular.module('keycloak', [ 'keycloak.services', 'keycloak.loaders', 'keycloak.controllers', 'ui.bootstrap', 'ui.select2' ]); var module = angular.module('keycloak', [ 'keycloak.services', 'keycloak.loaders', 'ui.bootstrap', 'ui.select2' ]);
var resourceRequests = 0; var resourceRequests = 0;
var loadingTimer = -1; var loadingTimer = -1;

View file

@ -1,22 +0,0 @@
'use strict';
var module = angular.module('keycloak.controllers', [ 'keycloak.services' ]);
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
function randomString(len) {
var charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var randomString = '';
for (var i = 0; i < len; i++) {
var randomPoz = Math.floor(Math.random() * charSet.length);
randomString += charSet.substring(randomPoz,randomPoz+1);
}
return randomString;
}

View file

@ -26,6 +26,16 @@ module.controller('ApplicationCredentialsCtrl', function($scope, $location, real
} }
} }
function randomString(len) {
var charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var randomString = '';
for (var i = 0; i < len; i++) {
var randomPoz = Math.floor(Math.random() * charSet.length);
randomString += charSet.substring(randomPoz,randomPoz+1);
}
return randomString;
}
$scope.generateTotp = function() { $scope.generateTotp = function() {
$scope.totp = randomString(5) + '-' + randomString(5) + '-' + randomString(5); $scope.totp = randomString(5) + '-' + randomString(5) + '-' + randomString(5);
} }