From: Elisha Oren Date: Sun, 22 Jan 2017 11:41:59 +0000 (+0200) Subject: prevent accessing tenant page of non exists tenant X-Git-Tag: release/carbon~22 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=1f0f97bcfdbbf1b67feef7d044e7890a7cb0c079;p=unimgr.git prevent accessing tenant page of non exists tenant Change-Id: I62c1f034c4219b9b08cd19a4a263fa832a92cbac Signed-off-by: Elisha Oren --- 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) {