aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources/META-INF
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/META-INF')
-rw-r--r--src/main/resources/META-INF/resources/designer/authenticate.html12
-rw-r--r--src/main/resources/META-INF/resources/designer/invalid_login.html13
-rw-r--r--src/main/resources/META-INF/resources/designer/logout.html40
-rw-r--r--src/main/resources/META-INF/resources/designer/partials/menu.html6
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/app.js7
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/authcontroller.js44
-rw-r--r--src/main/resources/META-INF/resources/designer/timeout.html55
7 files changed, 17 insertions, 160 deletions
diff --git a/src/main/resources/META-INF/resources/designer/authenticate.html b/src/main/resources/META-INF/resources/designer/authenticate.html
index a6c2cb8d..5429dced 100644
--- a/src/main/resources/META-INF/resources/designer/authenticate.html
+++ b/src/main/resources/META-INF/resources/designer/authenticate.html
@@ -18,7 +18,6 @@
limitations under the License.
============LICENSE_END============================================
===================================================================
-
-->
<style>
.divRow {
@@ -41,20 +40,13 @@
<head>
<title>CLDS</title>
</head>
-<div ng-controller="AuthenticateCtrl">
+<div ng-controller="AuthenticateCtrl" ng-init="authenticate()">
<div id='head'>
<div ng-include="'menu_simplified.html'"></div>
</div>
<div id='main'>
- <div class="divRow"><b>Welcome to Clamp. Please login first.</b></div>
- <div class="divForm">
- <form ng-submit="authenticate()" method="post" autocomplete="off">
- <div class="divFormRow"><label>User Name : <input type="text" ng-model="username" name="username"/> </label></div>
- <div class="divFormRow"><label>Password: <input type="password" ng-model="password" name="password"/> </label></div>
- <div class="divFormRow"><input type="submit" value=" Sign In"/></div>
- </form>
- </div>
+ <div class="divRow"><b>Welcome to Clamp.</b></div>
</div>
</div>
diff --git a/src/main/resources/META-INF/resources/designer/invalid_login.html b/src/main/resources/META-INF/resources/designer/invalid_login.html
index f42be51e..eb7d828a 100644
--- a/src/main/resources/META-INF/resources/designer/invalid_login.html
+++ b/src/main/resources/META-INF/resources/designer/invalid_login.html
@@ -32,14 +32,9 @@
<head>
<title>CLDS</title>
</head>
-<div>
+<div id='main'>
<div class="divRow"><b>Login Failed!</b></div>
- <div class="divRow"><b>Please make sure your login and password are correct.
- If you don't have the login credential, please contact CLAMP administrator.</b></div>
-
- <div class="divRow">To login again, please click <a href="/designer/index.html"/>Login</a></div>
+ <div class="divRow">You are not authorized to access CLAMP UI, please contact CLAMP administrator.</div>
+ <div class="divRow">Please <a href="/designer/index.html"/>Login</a> again.</div>
+</div>
</div>
-
-
-
-
diff --git a/src/main/resources/META-INF/resources/designer/logout.html b/src/main/resources/META-INF/resources/designer/logout.html
deleted file mode 100644
index e1759286..00000000
--- a/src/main/resources/META-INF/resources/designer/logout.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- ============LICENSE_START=======================================================
- ONAP CLAMP
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. All rights
- reserved.
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END============================================
- ===================================================================
-
- -->
-<style>
-.divRow {
- margin-left: 5px;
- font-size: 13px;
- font-weight: normal;
- margin-top:10px;
-}
-</style>
-
-<head>
- <title>CLDS</title>
-</head>
-<div ng-controller="AuthenticateCtrl" ng-init="logout()">
- <div id='main'>
- <div class="divRow"><b>You have been Logged Out successfully!</b></div>
- <div class="divRow">To login again, please click <a href="/designer/index.html"/>Login</a></div>
- </div>
-</div>
diff --git a/src/main/resources/META-INF/resources/designer/partials/menu.html b/src/main/resources/META-INF/resources/designer/partials/menu.html
index 2aea3167..036402ca 100644
--- a/src/main/resources/META-INF/resources/designer/partials/menu.html
+++ b/src/main/resources/META-INF/resources/designer/partials/menu.html
@@ -141,12 +141,6 @@
id="{{section.name}}" role="presentation"
ng-click="emptyMenuClick(section.link,section.name)">{{section.name}}</a>
</li>
-
- <li ng-repeat="section in tabs[dropDownName]"
- ng-if="section.name==='Log Out'"><a
- id="{{section.name}}" role="presentation"
- ng-click="emptyMenuClick(section.link,section.name)">{{section.name}}</a>
- </li>
<li ng-repeat="section in tabs[dropDownName]"
ng-if="section.name != 'Create CL' && section.name != 'Open CL' && section.name != 'ECOMP User Guide - Design Overview' && section.name != 'ECOMP User Guide - Closed Loop Design' && section.name != 'ECOMP User Guide - CLAMP' && section.name != 'User Info'"><a
diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js
index 63d44d55..7953ccc6 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/app.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/app.js
@@ -325,8 +325,6 @@ var app = angular.module('clds-app', ['ngRoute',
window.open(value);
} else if (name == "Contact Us") {
$rootScope.contactUs();
- } else if (name == "Log Out") {
- $scope.logout();
} else if (name == "Revert Model Changes") {
$scope.cldsRevertModel();
} else if (name == "Close Model") {
@@ -446,10 +444,6 @@ var app = angular.module('clds-app', ['ngRoute',
}, {
link: "/extraUserInfo",
name: "User Info"
- }],
- "Log Out": [{
- link: "/log_out.html",
- name: "Log Out"
}]
};
@@ -1416,4 +1410,5 @@ function updateDecisionLabel(originalLabel, newLabel) {
window.onunload = function() {
window.localStorage.removeItem("isAuth");
window.localStorage.removeItem("loginuser");
+ window.localStorage.removeItem("invalidUser");
};
diff --git a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
index ac891980..5992138b 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
@@ -18,7 +18,7 @@
* limitations under the License.
* ============LICENSE_END============================================
* ===================================================================
- *
+ *
*/
'use strict';
@@ -27,54 +27,30 @@ function AuthenticateCtrl($scope, $rootScope, $window, $resource, $http, $locati
console.log("//////////AuthenticateCtrl");
$scope.getInclude = function() {
console.log("getInclude011111111");
- var invalidUser = $window.localStorage.getItem("isInvalidUser");
+ var invalidUser = $window.localStorage.getItem("invalidUser");
var isAuth = $window.localStorage.getItem("isAuth");
-
- if (invalidUser != null && invalidUser == 'true') {
- console.log("Authentication failed");
- $window.localStorage.removeItem("isInvalidUser");
- window.location.href = "/designer/invalid_login.html";
- } else if (isAuth == null || isAuth == 'false') {
+ if (invalidUser == 'true')
+ return "invalid_login.html";
+ else if (isAuth == null || isAuth == 'false') {
return "authenticate.html";
}
- // Reassign the login user info, to be used in menu.html
- $rootScope.loginuser = $window.localStorage.getItem("loginuser");
return "utmdashboard.html";
};
$scope.authenticate = function() {
- var username = $scope.username;
- var pass = $scope.password;
- if (!username || !pass) {
- console.log("Invalid username/password");
- $window.localStorage.setItem("isInvalidUser", true);
- return;
- }
- var headers = username ? {
- authorization: "Basic " +
- btoa(username + ":" + pass)
- } : {};
- // send request to a test API with the username/password to verify the authorization
- $http.get('/restservices/clds/v1/user/testUser', {
- headers: headers
+ // send request to a test API for authentication/authorization check
+ $http.get('/restservices/clds/v1/user/getUser', {
}).success(function(data) {
if (data) {
$window.localStorage.setItem("isAuth", true);
- $window.localStorage.setItem("loginuser", $scope.username);
- $rootScope.loginuser = $scope.username;
- } else {
- $window.localStorage.removeItem("isInvalidUser", true);
+ $rootScope.loginuser = data;
}
+ window.localStorage.removeItem("invalidUser");
callback && callback();
}).error(function() {
- $window.localStorage.removeItem("isInvalidUser", true);
+ $window.localStorage.setItem("invalidUser", true);
callback && callback();
});
};
-
- $scope.logout = function() {
- window.localStorage.removeItem("isAuth");
- window.localStorage.removeItem("loginuser");
- };
}
diff --git a/src/main/resources/META-INF/resources/designer/timeout.html b/src/main/resources/META-INF/resources/designer/timeout.html
deleted file mode 100644
index ce3002b2..00000000
--- a/src/main/resources/META-INF/resources/designer/timeout.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--
- ============LICENSE_START=======================================================
- ONAP CLAMP
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. All rights
- reserved.
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END============================================
- ===================================================================
-
- -->
-<style>
-.divRow {
- margin-left: 5px;
- font-size: 13px;
- font-weight: normal;
- margin-top:10px;
-}
-</style>
-
-<head>
- <title>CLDS</title>
- <script language="javascript">
- function buttonVilibility()
- {
- if (window.opener && window.opener !== window) {
- document.getElementById("boton1").style.visibility="visible";
- } else {
- document.getElementById("boton1").style.visibility="hidden";
- }
- }
- </script>
-</head>
-<body onload='buttonVilibility()'>
-<div ng-controller="AuthenticateCtrl" ng-init="logout()">
- <div id='main'>
- <div class="divRow"><b>Your session is timeout.</b></div>
- <div class="divRow">Please <a href="/designer/index.html"/>Login</a> again.</div>
- </div>
- <div>
- <button id="boton1" ng-click="close(true)" class="btn btn-primary">Close</button>
- </div>
-</div>
-</body>