From 1f0f97bcfdbbf1b67feef7d044e7890a7cb0c079 Mon Sep 17 00:00:00 2001 From: Elisha Oren Date: Sun, 22 Jan 2017 13:41:59 +0200 Subject: [PATCH] prevent accessing tenant page of non exists tenant Change-Id: I62c1f034c4219b9b08cd19a4a263fa832a92cbac Signed-off-by: Elisha Oren --- .../src/main/resources/cpeui/tenant.controller.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js index c2bb5ab1..8fd8a3c7 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js @@ -26,8 +26,16 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { } if ($stateParams.tenantTabName in tabIndexs) { $scope.tab.tenantData = tabIndexs[$stateParams.tenantTabName]; + } else { + $scope.tab.tenantData = tabIndexs.inventory; } + CpeuiSvc.getTenantList(function(tenant_list) { + if (tenant_list.filter(t => t.name == $scope.curTenant).length == 0) { + window.location = "#/cpeui/admin/tenants"; + } + }); + function init(){ $scope.updateUnis(function(unis){ CpeuiSvc.getCes(function(ces) { -- 2.36.6