Commit b6162f5a authored by Christophe Maudoux's avatar Christophe Maudoux

Hide secret keys in diff.html

parent cc0dc83d
...@@ -40,8 +40,9 @@ useRedirectOnError = 0 ...@@ -40,8 +40,9 @@ useRedirectOnError = 0
enabledModules = conf, sessions, notifications, 2ndFA, viewer enabledModules = conf, sessions, notifications, 2ndFA, viewer
protection = manager protection = manager
viewerHiddenPK = samlIDPMetaDataNodes samlSPMetaDataNodes portalDisplayLogout viewerHiddenPK = samlIDPMetaDataNodes samlSPMetaDataNodes portalDisplayLogout captcha_login_enabled
viewerAllowBrowser = 1 viewerAllowBrowser = 1
viewerAllowDiff = 1
staticPrefix = /static staticPrefix = /static
languages = fr, en, vi, ar, de, it, zh languages = fr, en, vi, ar, de, it, zh
......
...@@ -364,6 +364,7 @@ enabledModules = conf, sessions, notifications, 2ndFA, viewer ...@@ -364,6 +364,7 @@ enabledModules = conf, sessions, notifications, 2ndFA, viewer
; Viewer options - Default values ; Viewer options - Default values
;viewerHiddenPK = samlIDPMetaDataNodes samlSPMetaDataNodes ;viewerHiddenPK = samlIDPMetaDataNodes samlSPMetaDataNodes
;viewerAllowBrowser = 0 ;viewerAllowBrowser = 0
;viewerAllowDiff = 0
;[node-handler] ;[node-handler]
; ;
......
...@@ -24,6 +24,7 @@ extends 'Lemonldap::NG::Common::Conf::AccessLib', ...@@ -24,6 +24,7 @@ extends 'Lemonldap::NG::Common::Conf::AccessLib',
has csp => ( is => 'rw' ); has csp => ( is => 'rw' );
has brw => ( is => 'rw', default => 0 ); has brw => ( is => 'rw', default => 0 );
has dif => ( is => 'rw', default => 0 );
## @method boolean init($args) ## @method boolean init($args)
# Launch initialization method # Launch initialization method
...@@ -88,6 +89,7 @@ sub init { ...@@ -88,6 +89,7 @@ sub init {
"default-src 'self' $portal;frame-ancestors 'none';form-action 'self';" "default-src 'self' $portal;frame-ancestors 'none';form-action 'self';"
); );
$self->brw( $self->{viewerAllowBrowser} || $conf->{viewerAllowBrowser} ); $self->brw( $self->{viewerAllowBrowser} || $conf->{viewerAllowBrowser} );
$self->dif( $self->{viewerAllowDiff} || $conf->{viewerAllowDiff} );
$self->defaultRoute( $working[0]->defaultRoute ); $self->defaultRoute( $working[0]->defaultRoute );
# Find out more glyphicones at https://www.w3schools.com/icons/bootstrap_icons_glyphicons.asp # Find out more glyphicones at https://www.w3schools.com/icons/bootstrap_icons_glyphicons.asp
...@@ -135,7 +137,7 @@ sub init { ...@@ -135,7 +137,7 @@ sub init {
sub tplParams { sub tplParams {
my ($self) = @_; my ($self) = @_;
return ( VERSION => $VERSION, ALLOWBROWSER => $self->brw ); return ( VERSION => $VERSION, ALLOWBROWSER => $self->brw, ALLOWDIFF => $self->dif );
} }
sub javascript { sub javascript {
......
...@@ -3566,6 +3566,10 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a- ...@@ -3566,6 +3566,10 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
'default' => 0, 'default' => 0,
'type' => 'bool' 'type' => 'bool'
}, },
'viewerAllowDiff' => {
'default' => 0,
'type' => 'bool'
},
'viewerHiddenPK' => { 'viewerHiddenPK' => {
'default' => 'samlIDPMetaDataNodes samlSPMetaDataNodes', 'default' => 'samlIDPMetaDataNodes samlSPMetaDataNodes',
'type' => 'text' 'type' => 'text'
......
...@@ -927,6 +927,11 @@ sub attributes { ...@@ -927,6 +927,11 @@ sub attributes {
default => 0, default => 0,
documentation => 'Allow configuration browser', documentation => 'Allow configuration browser',
}, },
viewerAllowDiff => {
type => 'bool',
default => 0,
documentation => 'Allow configuration diff',
},
# Notification # Notification
oldNotifFormat => { oldNotifFormat => {
......
...@@ -70,8 +70,9 @@ sub addRoutes { ...@@ -70,8 +70,9 @@ sub addRoutes {
$self->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] ) $self->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
# Difference between confs # Difference between confs
->addRoute( diff => { ':conf1' => { ':conf2' => 'diff' } } ) ->addRoute(
->addRoute( 'diff.html', undef, ['GET'] ); view => { diff => { ':conf1' => { ':conf2' => 'viewDiff' } } } )
->addRoute( 'viewDiff.html', undef, ['GET'] );
} }
sub getConfByNum { sub getConfByNum {
...@@ -79,9 +80,44 @@ sub getConfByNum { ...@@ -79,9 +80,44 @@ sub getConfByNum {
$self->SUPER::getConfByNum( $cfgNum, @args ); $self->SUPER::getConfByNum( $cfgNum, @args );
} }
sub diff { sub viewDiff {
my ( $self, $req, @path ) = @_; my ( $self, $req, @path ) = @_;
$self->SUPER::diff( $req, @path ); return $self->sendError( $req, 'to many arguments in path info', 400 )
if (@path);
my @cfgNum =
( scalar( $req->param('conf1') ), scalar( $req->param('conf2') ) );
my @conf;
$self->logger->debug(" Loading confs");
# Load the 2 configurations
for ( my $i = 0 ; $i < 2 ; $i++ ) {
if ( %{ $self->currentConf }
and $cfgNum[$i] == $self->currentConf->{cfgNum} )
{
$conf[$i] = $self->currentConf;
}
else {
$conf[$i] = $self->confAcc->getConf(
{ cfgNum => $cfgNum[$i], raw => 1, noCache => 1 } );
return $self->sendError(
$req,
"Configuration $cfgNum[$i] not available $Lemonldap::NG::Common::Conf::msg",
400
) unless ( $conf[$i] );
}
}
require Lemonldap::NG::Manager::Conf::Diff;
my @res =
$self->Lemonldap::NG::Manager::Conf::Diff::diff( $conf[0], $conf[1] );
my $hiddenKeys = $self->{viewerHiddenPK} || '';
$self->logger->debug("Deleting hidden Conf keys...");
foreach ( split /\s+/, $hiddenKeys ) {
$self->logger->debug("Delete hidden Conf keys");
$self->logger->debug("-> Delete $_");
delete $res[0]->{$_};
delete $res[1]->{$_};
}
return $self->sendJSONresponse( $req, [@res] );
} }
sub rejectKey { sub rejectKey {
......
###
diff.html script
###
llapp = angular.module 'llngConfDiff', ['ui.tree', 'ui.bootstrap', 'llApp', 'ngCookies'] , ($rootScopeProvider) -> $rootScopeProvider.digestTtl(15)
llapp.controller 'DiffCtrl', [ '$scope', '$http', '$q', '$translator', '$location', ($scope, $http, $q, $translator, $location) ->
$scope.links = links
$scope.menulinks = menulinks
$scope.staticPrefix = staticPrefix
$scope.scriptname = scriptname
#$scope.formPrefix = formPrefix
$scope.availableLanguages = availableLanguages
$scope.waiting = true
$scope.showM = false
$scope.cfg = []
$scope.data = {}
$scope.currentNode = null
# Import translations functions
$scope.translateTitle = (node) ->
return $translator.translateField node, 'title'
$scope.translateP = $translator.translateP
$scope.translate = $translator.translate
$scope.toggle = (scope) ->
scope.toggle()
$scope.stoggle = (scope,node) ->
$scope.currentNode = node
scope.toggle()
# Handle menu items
$scope.menuClick = (button) ->
if button.popup
window.open button.popup
else
button.action = button.title unless button.action
switch typeof button.action
when 'function'
button.action $scope.currentNode, $scope
when 'string'
$scope[button.action]()
else
console.log typeof button.action
$scope.showM = false
# Function to change interface language
$scope.getLanguage = (lang) ->
$scope.lang = lang
$scope.init()
$scope.showM = false
# function `getCfg(b,n)`:
# Download configuration metadatas
#
#@param b local conf (0 or 1)
#@param n cfgNumber
getCfg = (b,n) ->
d = $q.defer()
if not $scope.cfg[b]? or $scope.cfg[b] != n
$http.get("#{confPrefix}#{n}").then (response) ->
if response and response.data
$scope.cfg[b] = response.data
date = new Date response.data.cfgDate * 1000
$scope.cfg[b].date = date.toLocaleString()
console.log "Metadatas of cfg #{n} loaded"
d.resolve 'OK'
else
d.reject response
, (response) ->
console.log response
d.reject 'NOK'
else
d.resolve()
return d.promise
# Intialization function
# Simply set $scope.waiting to false during $translator and tree root
# initialization
init = ->
$scope.message = null
$scope.currentNode = null
d = $q.defer()
$http.get("#{scriptname}view/diff/#{$scope.cfg[0].cfgNum}/#{$scope.cfg[1].cfgNum}").then (response) ->
data = []
data = readDiff(response.data[0],response.data[1])
$scope.data = buildTree(data)
$scope.message = ''
$scope.waiting = false
, (response) ->
$scope.message = "#{$scope.translate('error')} : #{response.statusLine}"
readDiff = (c1,c2,tr=true) ->
res = []
for k,v of c1
if tr
tmp =
title: $scope.translate(k)
id: k
else
tmp = title: k
unless k.match /^cfg(?:Num|Log|Author(?:IP)?|Date)$/
if v? and typeof v == 'object'
if v.constructor == 'array'
tmp.oldvalue = v
tmp.newvalue = c2[k]
else if typeof c2[k] == 'object'
tmp.nodes = readDiff c1[k],c2[k], false
else
tmp.oldnodes = toNodes v, 'old'
else
tmp.oldvalue = v
tmp.newvalue = c2[k]
res.push tmp
for k,v of c2
unless (k.match /^cfg(?:Num|Log|Author(?:IP)?|Date)$/) or c1[k]?
if tr
tmp =
title: $scope.translate(k)
id: k
else
tmp = title: k
if v? and typeof v == 'object'
if v.constructor == 'array'
tmp.newvalue = v
else
console.log "Iteration"
tmp.newnodes = toNodes v, 'new'
else
tmp.newvalue = v
res.push tmp
return res
toNodes = (c,s) ->
res = []
for k,v of c
tmp = title:k
if typeof v == 'object'
if v.constructor == 'array'
tmp["#{s}value"] = v
else
tmp["#{s}nodes"] = toNodes c[k], s
else
tmp["#{s}value"] = v
res.push tmp
return res
reverseTree = []
buildTree = (data) ->
return data unless reverseTree?
res = []
for elem in data
offset = res
path = if reverseTree[elem.id]? then reverseTree[elem.id].split '/' else ''
for node in path
if node.length > 0
if offset.length
found = -1
for n,i in offset
if n.id == node
#offset = n.nodes
found = i
if found != -1
offset = offset[found].nodes
else
offset.push
id: node
title: $scope.translate node
nodes: []
offset = offset[offset.length-1].nodes
else
offset.push
id: node
title: $scope.translate node
nodes: []
offset = offset[0].nodes
offset.push elem
return res
$scope.newDiff = ->
$location.path("/#{$scope.cfg[0].cfgNum}/#{$scope.cfg[1].cfgNum}")
pathEvent = (event, next, current) ->
n = next.match(new RegExp('#!?/(latest|[0-9]+)(?:/(latest|[0-9]+))?$'))
if n == null
$location.path '/latest'
else
$scope.waiting = true
$q.all [
$translator.init $scope.lang
$http.get("#{staticPrefix}reverseTree.json").then (response) ->
reverseTree = response.data
console.log "Structure loaded"
getCfg 0, n[1]
getCfg 1, n[2] if n[2]?
]
.then ->
if n[2]?
init()
else
if $scope.cfg[0].prev
$scope.cfg[1] = $scope.cfg[0]
getCfg 0, $scope.cfg[1].prev
.then ->
init()
else
$scope.data = []
$scope.waiting = false
, ->
$scope.message = $scope.translate('error')
$scope.waiting = false
true
$scope.$on '$locationChangeSuccess', pathEvent
]
...@@ -27,7 +27,7 @@ llapp.controller 'TreeCtrl', [ ...@@ -27,7 +27,7 @@ llapp.controller 'TreeCtrl', [
$scope.waiting = true $scope.waiting = true
$scope.showM = false $scope.showM = false
$scope.showT = false $scope.showT = false
$scope.form = 'home' $scope.form = 'homeViewer'
$scope.currentCfg = {} $scope.currentCfg = {}
$scope.viewPrefix = window.viewPrefix $scope.viewPrefix = window.viewPrefix
$scope.message = {} $scope.message = {}
...@@ -133,7 +133,7 @@ llapp.controller 'TreeCtrl', [ ...@@ -133,7 +133,7 @@ llapp.controller 'TreeCtrl', [
# Display main form # Display main form
$scope.home = -> $scope.home = ->
$scope.form = 'home' $scope.form = 'homeViewer'
$scope.showM = false $scope.showM = false
# Download raw conf # Download raw conf
...@@ -438,7 +438,7 @@ llapp.controller 'TreeCtrl', [ ...@@ -438,7 +438,7 @@ llapp.controller 'TreeCtrl', [
title: 'emptyConf' title: 'emptyConf'
message: '__zeroConfExplanations__' message: '__zeroConfExplanations__'
$scope.showModal 'message.html' $scope.showModal 'message.html'
$scope.form = 'home' $scope.form = 'homeViewer'
$scope.waiting = false $scope.waiting = false
, readError , readError
# Colorized link # Colorized link
......
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<span ng-if="!currentCfg.next" trspan="currentConfiguration"></span>
<span ng-if="currentCfg.next" trspan="loadedConfiguration"></span>
<i ng-if="currentCfg.prev">(<a trspan="diffWithPrevious" target="_blank" href="{{scriptname}}/viewDiff.html#!/{{currentCfg.cfgNum}}" role="link"></a>)</i>
</h3>
</div>
<table class="table table-striped">
<tr>
<th><span trspan="number"></span></th>
<td>
<span id="cfgnum" class="label label-success" comment="{{translateP('__newCfgAvailable__')}}" ng-class="{'label-warning':currentCfg.next}">{{currentCfg.cfgNum}}</span>
</td>
</tr>
<tr ng-if="currentCfg.cfgAuthor">
<th><span trspan="author"></span></th>
<td>{{currentCfg.cfgAuthor}}</td>
</tr>
<tr ng-if="currentCfg.cfgAuthorIP">
<th><span trspan="authorIPAddress"></span></th>
<td>{{currentCfg.cfgAuthorIP}}</td>
</tr>
<tr ng-if="currentCfg.cfgDate">
<th><span trspan="date"></span></th>
<td>{{currentCfg.date}}</td>
</tr>
<tr ng-if="currentCfg.cfgVersion">
<th><span trspan="cfgVersion"></span></th>
<td>{{currentCfg.cfgVersion}}</td>
</tr>
<tr ng-if="currentCfg.cfgLog">
<th><span trspan="cfgLog"></span></th>
<td id="cfglog">{{currentCfg.cfgLog}}</td>
</tr>
</table>
</div>
<script type="text/menu">
[{
"title": "downloadIt",
"action": "downloadConf",
"icon": "export"
},{
"title": "restore",
"icon": "import"
}]
</script>
function templates(tpl,key){var ind;var scalarTemplate=function(r){return{id:tpl+"s/"+ind++,title:r,get:tpl+"s/"+key+"/"+r}};switch(tpl){case"casAppMetaDataNode":return[{_nodes:[{get:tpl+"s/"+key+"/"+"casAppMetaDataOptionsService",id:tpl+"s/"+key+"/"+"casAppMetaDataOptionsService",title:"casAppMetaDataOptionsService"},{get:tpl+"s/"+key+"/"+"casAppMetaDataOptionsRule",id:tpl+"s/"+key+"/"+"casAppMetaDataOptionsRule",title:"casAppMetaDataOptionsRule"}],id:"casAppMetaDataOptions",title:"casAppMetaDataOptions",type:"simpleInputContainer"},{cnodes:tpl+"s/"+key+"/"+"casAppMetaDataExportedVars",default:[{data:"cn",id:tpl+"s/"+key+"/"+"casAppMetaDataExportedVars/cn",title:"cn",type:"keyText"},{data:"mail",id:tpl+"s/"+key+"/"+"casAppMetaDataExportedVars/mail",title:"mail",type:"keyText"},{data:"uid",id:tpl+"s/"+key+"/"+"casAppMetaDataExportedVars/uid",title:"uid",type:"keyText"}],id:tpl+"s/"+key+"/"+"casAppMetaDataExportedVars",title:"casAppMetaDataExportedVars",type:"keyTextContainer"}];case"casSrvMetaDataNode":return[{cnodes:tpl+"s/"+key+"/"+"casSrvMetaDataExportedVars",default:[{data:"cn",id:tpl+"s/"+key+"/"+"casSrvMetaDataExportedVars/cn",title:"cn",type:"keyText"},{data:"mail",id:tpl+"s/"+key+"/"+"casSrvMetaDataExportedVars/mail",title:"mail",type:"keyText"},{data:"uid",id:tpl+"s/"+key+"/"+"casSrvMetaDataExportedVars/uid",title:"uid",type:"keyText"}],id:tpl+"s/"+key+"/"+"casSrvMetaDataExportedVars",title:"casSrvMetaDataExportedVars",type:"keyTextContainer"},{cnodes:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsProxiedServices",id:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsProxiedServices",title:"casSrvMetaDataOptionsProxiedServices",type:"keyTextContainer"},{_nodes:[{get:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsUrl",id:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsUrl",title:"casSrvMetaDataOptionsUrl"},{default:0,get:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsRenew",id:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsRenew",title:"casSrvMetaDataOptionsRenew",type:"bool"},{default:0,get:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsGateway",id:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsGateway",title:"casSrvMetaDataOptionsGateway",type:"bool"}],id:"casSrvMetaDataOptions",title:"casSrvMetaDataOptions",type:"simpleInputContainer"},{_nodes:[{get:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsDisplayName",id:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsDisplayName",title:"casSrvMetaDataOptionsDisplayName"},{get:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsIcon",id:tpl+"s/"+key+"/"+"casSrvMetaDataOptionsIcon",title:"casSrvMetaDataOptionsIcon"}],id:"casSrvMetaDataOptionsDisplay",title:"casSrvMetaDataOptionsDisplay",type:"simpleInputContainer"}];case"oidcOPMetaDataNode":return[{get:tpl+"s/"+key+"/"+"oidcOPMetaDataJSON",id:tpl+"s/"+key+"/"+"oidcOPMetaDataJSON",title:"oidcOPMetaDataJSON",type:"file"},{get:tpl+"s/"+key+"/"+"oidcOPMetaDataJWKS",id:tpl+"s/"+key+"/"+"oidcOPMetaDataJWKS",title:"oidcOPMetaDataJWKS",type:"file"},{cnodes:tpl+"s/"+key+"/"+"oidcOPMetaDataExportedVars",default:[{data:"name",id:tpl+"s/"+key+"/"+"oidcOPMetaDataExportedVars/cn",title:"cn",type:"keyText"},{data:"email",id:tpl+"s/"+key+"/"+"oidcOPMetaDataExportedVars/mail",title:"mail",type:"keyText"},{data:"family_name",id:tpl+"s/"+key+"/"+"oidcOPMetaDataExportedVars/sn",title:"sn",type:"keyText"},{data:"sub",id:tpl+"s/"+key+"/"+"oidcOPMetaDataExportedVars/uid",title:"uid",type:"keyText"}],id:tpl+"s/"+key+"/"+"oidcOPMetaDataExportedVars",title:"oidcOPMetaDataExportedVars",type:"keyTextContainer"},{_nodes:[{_nodes:[{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsConfigurationURI",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsConfigurationURI",title:"oidcOPMetaDataOptionsConfigurationURI"},{default:0,get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsJWKSTimeout",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsJWKSTimeout",title:"oidcOPMetaDataOptionsJWKSTimeout",type:"int"},{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsClientID",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsClientID",title:"oidcOPMetaDataOptionsClientID"},{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsClientSecret",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsClientSecret",title:"oidcOPMetaDataOptionsClientSecret",type:"password"},{default:0,get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsStoreIDToken",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsStoreIDToken",title:"oidcOPMetaDataOptionsStoreIDToken",type:"bool"}],id:"oidcOPMetaDataOptionsConfiguration",title:"oidcOPMetaDataOptionsConfiguration",type:"simpleInputContainer"},{_nodes:[{default:"openid profile",get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsScope",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsScope",title:"oidcOPMetaDataOptionsScope"},{default:"",get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsDisplay",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsDisplay",select:[{k:"",v:""},{k:"page",v:"page"},{k:"popup",v:"popup"},{k:"touch",v:"touch"},{k:"wap",v:"wap"}],title:"oidcOPMetaDataOptionsDisplay",type:"select"},{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsPrompt",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsPrompt",title:"oidcOPMetaDataOptionsPrompt"},{default:0,get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsMaxAge",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsMaxAge",title:"oidcOPMetaDataOptionsMaxAge",type:"int"},{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsUiLocales",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsUiLocales",title:"oidcOPMetaDataOptionsUiLocales"},{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsAcrValues",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsAcrValues",title:"oidcOPMetaDataOptionsAcrValues"},{default:"client_secret_post",get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsTokenEndpointAuthMethod",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsTokenEndpointAuthMethod",select:[{k:"client_secret_post",v:"client_secret_post"},{k:"client_secret_basic",v:"client_secret_basic"}],title:"oidcOPMetaDataOptionsTokenEndpointAuthMethod",type:"select"},{default:1,get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsCheckJWTSignature",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsCheckJWTSignature",title:"oidcOPMetaDataOptionsCheckJWTSignature",type:"bool"},{default:30,get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsIDTokenMaxAge",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsIDTokenMaxAge",title:"oidcOPMetaDataOptionsIDTokenMaxAge",type:"int"},{default:1,get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsUseNonce",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsUseNonce",title:"oidcOPMetaDataOptionsUseNonce",type:"bool"}],id:"oidcOPMetaDataOptionsProtocol",title:"oidcOPMetaDataOptionsProtocol",type:"simpleInputContainer"}],id:"oidcOPMetaDataOptions",title:"oidcOPMetaDataOptions"},{_nodes:[{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsDisplayName",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsDisplayName",title:"oidcOPMetaDataOptionsDisplayName"},{get:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsIcon",id:tpl+"s/"+key+"/"+"oidcOPMetaDataOptionsIcon",title:"oidcOPMetaDataOptionsIcon"}],id:"oidcOPMetaDataOptionsDisplayParams",title:"oidcOPMetaDataOptionsDisplayParams",type:"simpleInputContainer"}];case"oidcRPMetaDataNode":return[{cnodes:tpl+"s/"+key+"/"+"oidcRPMetaDataExportedVars",default:[{data:"mail",id:tpl+"s/"+key+"/"+"oidcRPMetaDataExportedVars/email",title:"email",type:"keyText"},{data:"sn",id:tpl+"s/"+key+"/"+"oidcRPMetaDataExportedVars/family_name",title:"family_name",type:"keyText"},{data:"cn",id:tpl+"s/"+key+"/"+"oidcRPMetaDataExportedVars/name",title:"name",type:"keyText"}],id:tpl+"s/"+key+"/"+"oidcRPMetaDataExportedVars",title:"oidcRPMetaDataExportedVars",type:"keyTextContainer"},{cnodes:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsExtraClaims",default:[],id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsExtraClaims",title:"oidcRPMetaDataOptionsExtraClaims",type:"keyTextContainer"},{_nodes:[{_nodes:[{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsClientID",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsClientID",title:"oidcRPMetaDataOptionsClientID"},{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsClientSecret",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsClientSecret",title:"oidcRPMetaDataOptionsClientSecret",type:"password"}],id:"oidcRPMetaDataOptionsAuthentication",title:"oidcRPMetaDataOptionsAuthentication",type:"simpleInputContainer"},{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsUserIDAttr",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsUserIDAttr",title:"oidcRPMetaDataOptionsUserIDAttr"},{default:"HS512",get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsIDTokenSignAlg",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsIDTokenSignAlg",select:[{k:"none",v:"None"},{k:"HS256",v:"HS256"},{k:"HS384",v:"HS384"},{k:"HS512",v:"HS512"},{k:"RS256",v:"RS256"},{k:"RS384",v:"RS384"},{k:"RS512",v:"RS512"}],title:"oidcRPMetaDataOptionsIDTokenSignAlg",type:"select"},{default:3600,get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsIDTokenExpiration",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsIDTokenExpiration",title:"oidcRPMetaDataOptionsIDTokenExpiration",type:"int"},{default:3600,get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsAccessTokenExpiration",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsAccessTokenExpiration",title:"oidcRPMetaDataOptionsAccessTokenExpiration",type:"int"},{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsRedirectUris",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsRedirectUris",title:"oidcRPMetaDataOptionsRedirectUris"},{default:0,get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsBypassConsent",help:"openidconnectclaims.html",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsBypassConsent",title:"oidcRPMetaDataOptionsBypassConsent",type:"bool"},{_nodes:[{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsPostLogoutRedirectUris",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsPostLogoutRedirectUris",title:"oidcRPMetaDataOptionsPostLogoutRedirectUris"},{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsLogoutUrl",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsLogoutUrl",title:"oidcRPMetaDataOptionsLogoutUrl"},{default:"front",get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsLogoutType",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsLogoutType",select:[{k:"front",v:"Front Channel"},{k:"back",v:"Back Channel"}],title:"oidcRPMetaDataOptionsLogoutType",type:"select"},{default:0,get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsLogoutSessionRequired",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsLogoutSessionRequired",title:"oidcRPMetaDataOptionsLogoutSessionRequired",type:"bool"}],id:"logout",title:"logout",type:"simpleInputContainer"},{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsRule",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsRule",title:"oidcRPMetaDataOptionsRule"}],id:"oidcRPMetaDataOptions",title:"oidcRPMetaDataOptions"},{_nodes:[{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsDisplayName",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsDisplayName",title:"oidcRPMetaDataOptionsDisplayName"},{get:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsIcon",id:tpl+"s/"+key+"/"+"oidcRPMetaDataOptionsIcon",title:"oidcRPMetaDataOptionsIcon"}],id:"oidcRPMetaDataOptionsDisplay",title:"oidcRPMetaDataOptionsDisplay",type:"simpleInputContainer"}];case"samlIDPMetaDataNode":return[{get:tpl+"s/"+key+"/"+"samlIDPMetaDataXML",id:tpl+"s/"+key+"/"+"samlIDPMetaDataXML",title:"samlIDPMetaDataXML",type:"file"},{cnodes:tpl+"s/"+key+"/"+"samlIDPMetaDataExportedAttributes",default:[],help:"authsaml.html#exported_attributes",id:tpl+"s/"+key+"/"+"samlIDPMetaDataExportedAttributes",title:"samlIDPMetaDataExportedAttributes",type:"samlAttributeContainer"},{_nodes:[{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsAdaptSessionUtime",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsAdaptSessionUtime",title:"samlIDPMetaDataOptionsAdaptSessionUtime",type:"bool"},{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsForceUTF8",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsForceUTF8",title:"samlIDPMetaDataOptionsForceUTF8",type:"bool"},{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsStoreSAMLToken",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsStoreSAMLToken",title:"samlIDPMetaDataOptionsStoreSAMLToken",type:"bool"},{get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsUserAttribute",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsUserAttribute",title:"samlIDPMetaDataOptionsUserAttribute"}],id:"samlIDPMetaDataOptionsSession",title:"samlIDPMetaDataOptionsSession",type:"simpleInputContainer"},{_nodes:[{default:-1,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSignSSOMessage",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSignSSOMessage",title:"samlIDPMetaDataOptionsSignSSOMessage",type:"trool"},{default:1,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckSSOMessageSignature",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckSSOMessageSignature",title:"samlIDPMetaDataOptionsCheckSSOMessageSignature",type:"bool"},{default:-1,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSignSLOMessage",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSignSLOMessage",title:"samlIDPMetaDataOptionsSignSLOMessage",type:"trool"},{default:1,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckSLOMessageSignature",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckSLOMessageSignature",title:"samlIDPMetaDataOptionsCheckSLOMessageSignature",type:"bool"}],id:"samlIDPMetaDataOptionsSignature",title:"samlIDPMetaDataOptionsSignature",type:"simpleInputContainer"},{_nodes:[{default:"",get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSSOBinding",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSSOBinding",select:[{k:"",v:""},{k:"http-post",v:"POST"},{k:"http-redirect",v:"Redirect"},{k:"artifact-get",v:"Artifact GET"}],title:"samlIDPMetaDataOptionsSSOBinding",type:"select"},{default:"",get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSLOBinding",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsSLOBinding",select:[{k:"",v:""},{k:"http-post",v:"POST"},{k:"http-redirect",v:"Redirect"},{k:"http-soap",v:"SOAP"}],title:"samlIDPMetaDataOptionsSLOBinding",type:"select"}],id:"samlIDPMetaDataOptionsBinding",title:"samlIDPMetaDataOptionsBinding",type:"simpleInputContainer"},{_nodes:[{default:"none",get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsEncryptionMode",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsEncryptionMode",select:[{k:"none",v:"None"},{k:"nameid",v:"Name ID"},{k:"assertion",v:"Assertion"}],title:"samlIDPMetaDataOptionsEncryptionMode",type:"select"},{default:1,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckTime",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckTime",title:"samlIDPMetaDataOptionsCheckTime",type:"bool"},{default:1,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckAudience",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsCheckAudience",title:"samlIDPMetaDataOptionsCheckAudience",type:"bool"}],id:"samlIDPMetaDataOptionsSecurity",title:"samlIDPMetaDataOptionsSecurity",type:"simpleInputContainer"},{_nodes:[{default:"",get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsResolutionRule",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsResolutionRule",title:"samlIDPMetaDataOptionsResolutionRule",type:"longtext"},{default:"",get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsNameIDFormat",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsNameIDFormat",select:[{k:"",v:""},{k:"unspecified",v:"Unspecified"},{k:"email",v:"Email"},{k:"x509",v:"X509 certificate"},{k:"windows",v:"Windows"},{k:"kerberos",v:"Kerberos"},{k:"entity",v:"Entity"},{k:"persistent",v:"Persistent"},{k:"transient",v:"Transient"},{k:"encrypted",v:"Encrypted"}],title:"samlIDPMetaDataOptionsNameIDFormat",type:"select"},{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsForceAuthn",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsForceAuthn",title:"samlIDPMetaDataOptionsForceAuthn",type:"bool"},{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsIsPassive",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsIsPassive",title:"samlIDPMetaDataOptionsIsPassive",type:"bool"},{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsAllowProxiedAuthn",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsAllowProxiedAuthn",title:"samlIDPMetaDataOptionsAllowProxiedAuthn",type:"bool"},{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsAllowLoginFromIDP",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsAllowLoginFromIDP",title:"samlIDPMetaDataOptionsAllowLoginFromIDP",type:"bool"},{default:"",get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsRequestedAuthnContext",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsRequestedAuthnContext",select:[{k:"",v:""},{k:"kerberos",v:"Kerberos"},{k:"password-protected-transport",v:"Password protected transport"},{k:"password",v:"Password"},{k:"tls-client",v:"TLS client certificate"}],title:"samlIDPMetaDataOptionsRequestedAuthnContext",type:"select"},{default:0,get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsRelayStateURL",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsRelayStateURL",title:"samlIDPMetaDataOptionsRelayStateURL",type:"bool"}],help:"authsaml.html#options",id:"samlIDPMetaDataOptions",title:"samlIDPMetaDataOptions",type:"simpleInputContainer"},{_nodes:[{get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsDisplayName",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsDisplayName",title:"samlIDPMetaDataOptionsDisplayName"},{get:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsIcon",id:tpl+"s/"+key+"/"+"samlIDPMetaDataOptionsIcon",title:"samlIDPMetaDataOptionsIcon"}],id:"samlIDPMetaDataOptionsDisplay",title:"samlIDPMetaDataOptionsDisplay",type:"simpleInputContainer"}];case"samlSPMetaDataNode":return[{get:tpl+"s/"+key+"/"+"samlSPMetaDataXML",id:tpl+"s/"+key+"/"+"samlSPMetaDataXML",title:"samlSPMetaDataXML",type:"file"},{cnodes:tpl+"s/"+key+"/"+"samlSPMetaDataExportedAttributes",default:[],help:"idpsaml.html#exported_attributes",id:tpl+"s/"+key+"/"+"samlSPMetaDataExportedAttributes",title:"samlSPMetaDataExportedAttributes",type:"samlAttributeContainer"},{_nodes:[{_nodes:[{default:"",get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsNameIDFormat",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsNameIDFormat",select:[{k:"",v:""},{k:"unspecified",v:"Unspecified"},{k:"email",v:"Email"},{k:"x509",v:"X509 certificate"},{k:"windows",v:"Windows"},{k:"kerberos",v:"Kerberos"},{k:"entity",v:"Entity"},{k:"persistent",v:"Persistent"},{k:"transient",v:"Transient"},{k:"encrypted",v:"Encrypted"}],title:"samlSPMetaDataOptionsNameIDFormat",type:"select"},{get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsNameIDSessionKey",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsNameIDSessionKey",title:"samlSPMetaDataOptionsNameIDSessionKey"},{default:0,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsOneTimeUse",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsOneTimeUse",title:"samlSPMetaDataOptionsOneTimeUse",type:"bool"},{default:72e3,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsSessionNotOnOrAfterTimeout",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsSessionNotOnOrAfterTimeout",title:"samlSPMetaDataOptionsSessionNotOnOrAfterTimeout",type:"int"},{default:72e3,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsNotOnOrAfterTimeout",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsNotOnOrAfterTimeout",title:"samlSPMetaDataOptionsNotOnOrAfterTimeout",type:"int"},{default:1,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsForceUTF8",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsForceUTF8",title:"samlSPMetaDataOptionsForceUTF8",type:"bool"}],id:"samlSPMetaDataOptionsAuthnResponse",title:"samlSPMetaDataOptionsAuthnResponse",type:"simpleInputContainer"},{_nodes:[{default:-1,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsSignSSOMessage",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsSignSSOMessage",title:"samlSPMetaDataOptionsSignSSOMessage",type:"trool"},{default:1,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsCheckSSOMessageSignature",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsCheckSSOMessageSignature",title:"samlSPMetaDataOptionsCheckSSOMessageSignature",type:"bool"},{default:-1,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsSignSLOMessage",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsSignSLOMessage",title:"samlSPMetaDataOptionsSignSLOMessage",type:"trool"},{default:1,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsCheckSLOMessageSignature",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsCheckSLOMessageSignature",title:"samlSPMetaDataOptionsCheckSLOMessageSignature",type:"bool"}],id:"samlSPMetaDataOptionsSignature",title:"samlSPMetaDataOptionsSignature",type:"simpleInputContainer"},{_nodes:[{default:"none",get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsEncryptionMode",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsEncryptionMode",select:[{k:"none",v:"None"},{k:"nameid",v:"Name ID"},{k:"assertion",v:"Assertion"}],title:"samlSPMetaDataOptionsEncryptionMode",type:"select"},{default:0,get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsEnableIDPInitiatedURL",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsEnableIDPInitiatedURL",title:"samlSPMetaDataOptionsEnableIDPInitiatedURL",type:"bool"},{get:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsRule",id:tpl+"s/"+key+"/"+"samlSPMetaDataOptionsRule",title:"samlSPMetaDataOptionsRule"}],id:"samlSPMetaDataOptionsSecurity",title:"samlSPMetaDataOptionsSecurity",type:"simpleInputContainer"}],help:"idpsaml.html#options",id:"samlSPMetaDataOptions",title:"samlSPMetaDataOptions"}];case"virtualHost":return[{cnodes:tpl+"s/"+key+"/"+"locationRules",default:[{data:"deny",id:tpl+"s/"+key+"/"+"locationRules/default",re:"default",title:"default",type:"rule"}],help:"writingrulesand_headers.html#rules",id:tpl+"s/"+key+"/"+"locationRules",title:"locationRules",type:"ruleContainer"},{cnodes:tpl+"s/"+key+"/"+"exportedHeaders",help:"writingrulesand_headers.html#headers",id:tpl+"s/"+key+"/"+"exportedHeaders",title:"exportedHeaders",type:"keyTextContainer"},{cnodes:tpl+"s/"+key+"/"+"post",help:"formreplay.html",id:tpl+"s/"+key+"/"+"post",title:"post",type:"postContainer"},{_nodes:[{default:-1,get:tpl+"s/"+key+"/"+"vhostPort",id:tpl+"s/"+key+"/"+"vhostPort",title:"vhostPort",type:"int"},{default:-1,get:tpl+"s/"+key+"/"+"vhostHttps",id:tpl+"s/"+key+"/"+"vhostHttps",title:"vhostHttps",type:"trool"},{default:0,get:tpl+"s/"+key+"/"+"vhostMaintenance",id:tpl+"s/"+key+"/"+"vhostMaintenance",title:"vhostMaintenance",type:"bool"},{get:tpl+"s/"+key+"/"+"vhostAliases",id:tpl+"s/"+key+"/"+"vhostAliases",title:"vhostAliases"},{default:"Main",get:tpl+"s/"+key+"/"+"vhostType",id:tpl+"s/"+key+"/"+"vhostType",select:[{k:"Main",v:"Main"},{k:"Zimbra",v:"ZimbraPreAuth"},{k:"AuthBasic",v:"AuthBasic"},{k:"SecureToken",v:"SecureToken"},{k:"CDA",v:"CDA"},{k:"DevOps",v:"DevOps"},{k:"DevOpsST",v:"DevOpsST"},{k:"ServiceToken",v:"ServiceToken"}],title:"vhostType",type:"select"},{get:tpl+"s/"+key+"/"+"vhostAuthnLevel",id:tpl+"s/"+key+"/"+"vhostAuthnLevel",title:"vhostAuthnLevel",type:"int"}],help:"configvhost.html#options",id:"vhostOptions",title:"vhostOptions",type:"simpleInputContainer"}];default:return[]}}function setScopeVars(scope){scope.portal=scope.data[0]._nodes[0]._nodes[0];scope.getKey(scope.portal);scope.domain=scope.data[0]._nodes[4]._nodes[1];scope.getKey(scope.domain)}
// Generated by CoffeeScript 1.12.7
/*
diff.html script
*/
(function() {
var llapp;
llapp = angular.module('llngConfDiff', ['ui.tree', 'ui.bootstrap', 'llApp', 'ngCookies'], function($rootScopeProvider) {
return $rootScopeProvider.digestTtl(15);
});
llapp.controller('DiffCtrl', [
'$scope', '$http', '$q', '$translator', '$location', function($scope, $http, $q, $translator, $location) {
var buildTree, getCfg, init, pathEvent, readDiff, reverseTree, toNodes;
$scope.links = links;
$scope.menulinks = menulinks;
$scope.staticPrefix = staticPrefix;
$scope.scriptname = scriptname;
$scope.availableLanguages = availableLanguages;
$scope.waiting = true;
$scope.showM = false;
$scope.cfg = [];
$scope.data = {};
$scope.currentNode = null;
$scope.translateTitle = function(node) {
return $translator.translateField(node, 'title');
};
$scope.translateP = $translator.translateP;
$scope.translate = $translator.translate;
$scope.toggle = function(scope) {
return scope.toggle();
};
$scope.stoggle = function(scope, node) {
$scope.currentNode = node;
return scope.toggle();
};
$scope.menuClick = function(button) {
if (button.popup) {
window.open(button.popup);
} else {
if (!button.action) {
button.action = button.title;
}
switch (typeof button.action) {
case 'function':
button.action($scope.currentNode, $scope);
break;
case 'string':
$scope[button.action]();
break;
default:
console.log(typeof button.action);
}
}
return $scope.showM = false;
};
$scope.getLanguage = function(lang) {
$scope.lang = lang;
$scope.init();
return $scope.showM = false;
};
getCfg = function(b, n) {
var d;
d = $q.defer();
if (($scope.cfg[b] == null) || $scope.cfg[b] !== n) {
$http.get("" + confPrefix + n).then(function(response) {
var date;
if (response && response.data) {
$scope.cfg[b] = response.data;
date = new Date(response.data.cfgDate * 1000);
$scope.cfg[b].date = date.toLocaleString();
console.log("Metadatas of cfg " + n + " loaded");
return d.resolve('OK');
} else {
return d.reject(response);
}
}, function(response) {
console.log(response);
return d.reject('NOK');
});
} else {
d.resolve();
}
return d.promise;
};
init = function() {
var d;
$scope.message = null;
$scope.currentNode = null;
d = $q.defer();
return $http.get(scriptname + "