authChoice management

This commit is contained in:
Xavier Guimard 2015-12-14 22:24:11 +00:00
parent a9343808da
commit 319df84b93
8 changed files with 100 additions and 8 deletions

View File

@ -1913,6 +1913,52 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
type => 'authChoiceContainer',
keyTest => qr/^(\d*)?[a-zA-Z0-9_]+$/,
keyMsgFail => 'Bad choice key',
select => [
[
{ k => 'Apache', v => 'Apache' },
{ k => 'AD', v => 'Active Directory' },
{ k => 'BrowserID', v => 'BrowserID (Mozilla Persona)' },
{ k => 'CAS', v => 'Central Authentication Service (CAS)' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Facebook', v => 'Facebook' },
{ k => 'Google', v => 'Google' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'Null', v => 'None' },
{ k => 'OpenID', v => 'OpenID' },
{ k => 'OpenIDConnect', v => 'OpenID Connect' },
{ k => 'Proxy', v => 'Proxy' },
{ k => 'Radius', v => 'Radius' },
{ k => 'Remote', v => 'Remote' },
{ k => 'SAML', v => 'SAML v2' },
{ k => 'Slave', v => 'Slave' },
{ k => 'SSL', v => 'SSL' },
{ k => 'Twitter', v => 'Twitter' },
{ k => 'WebID', v => 'WebID' },
{ k => 'Yubikey', v => 'Yubikey' }
],
[
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Facebook', v => 'Facebook' },
{ k => 'Google', v => 'Google' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'Null', v => 'None' },
{ k => 'OpenID', v => 'OpenID' },
{ k => 'OpenIDConnect', v => 'OpenID Connect' },
{ k => 'Proxy', v => 'Proxy' },
{ k => 'Remote', v => 'Remote' },
{ k => 'SAML', v => 'SAML v2' },
{ k => 'Slave', v => 'Slave' },
{ k => 'WebID', v => 'WebID' }
],
[
{ k => 'AD', v => 'Active Directory' },
{ k => 'Choice', v => 'authChoice' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'Null', v => 'None' }
]
],
},
# Multi

View File

@ -339,6 +339,9 @@ sub _scanNodes {
);
$self->newConf->{$name} = {};
foreach my $n (@$subNodes) {
if ( ref $n->{data} and ref $n->{data} eq 'ARRAY' ) {
$n->{data} = join ';', @{ $n->{data} };
}
$self->newConf->{$name}->{ $n->{title} } = $n->{data};
$count++;
unless ( defined $self->refConf->{$name}->{ $n->{title} } )

View File

@ -2,12 +2,29 @@
<div class="panel-heading">
<h3 class="panel-title" trspan="authChain"/>
</div>
{{currentNode | json}}
<table class="table table-striped">
<tbody>
<tr>
<td trspan="name"></td>
<td>
<input ng-model="currentNode.title">
</td>
</tr>
<tr ng-repeat="i in [[0,'authentication'],[1,'userDB'],[2,'passwordDB']]">
<td trspan="{{i[1]}}"</td>
<td>
<select id="selectform" class="form-control" ng-model="currentNode.data[i[0]]">
<option ng-repeat="item in _findContainer().select[i[0]]" ng-selected="item.k==currentNode.data[i[0]]" value="{{item.k}}">{{item.v}}</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
'title': 'newAuthChoice',
'action': 'newAuthChoice',
'title': 'newChain',
'icon': 'plus-sign'
},{
'title': 'deleteEntry',

View File

@ -2,11 +2,33 @@
<div class="panel-heading">
<h3 class="panel-title">{{translateTitle(currentNode)}}</h3>
</div>
{{currentNode | json}}
<table class="table table-striped">
<thead>
<tr>
<th trspan="name"></th>
<th trspan="authentication"></th>
<th trspan="userDB"></th>
<th trspan="passwordDB"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="c in currentNode.nodes">
<td>
<input ng-model="c.title">
</td>
<td ng-repeat="i in [0,1,2]">
<select class="form-control" ng-model="c.data[i]">
<option ng-repeat="item in currentNode.select[i]" ng-selected="item.k==c.data[i]" value="{{item.k}}">{{item.v}}</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
'title': 'newAuthChoice',
'action': 'newAuthChoice',
'title': 'newChain',
'icon': 'plus-sign'
}];
</script>

View File

@ -240,7 +240,7 @@
node.nodes.push({
"id": node.id + '/n' + (id++),
"title": "1-key",
"data": [],
"data": ['LDAP','LDAP','Null'],
"type": "authChoice"
});
};
@ -570,7 +570,7 @@
$scope.keyWritable = function(scope) {
var node = scope.$modelValue;
return node.type && node.type.match(/^(keyText|virtualHost|rule|menuCat|menuApp|samlAttribute)$/) ? true : false;
return node.type && node.type.match(/^(authChoice|keyText|virtualHost|rule|menuCat|menuApp|samlAttribute)$/) ? true : false;
}
/* method `newRSAKey`

View File

@ -36,6 +36,7 @@
"applicationList": "Categories and applications",
"appsInThisCat": "Applications in this category",
"attributesAndMacros": "Attributes and macros",
"authChain": "Authentication chain",
"authChoice": "Authentication choixe",
"authChoiceModules": "Allowed modules",
"authChoiceParam": "URL parameter",
@ -290,6 +291,7 @@
"multiValuesSeparator": "Separator",
"name": "Name",
"newApp": "New application",
"newChain": "New chain",
"newCat": "New category",
"newCfgAvailable": "A new configuration is available",
"newEntry": "New entry",

View File

@ -36,6 +36,7 @@
"applicationList": "Catégories et applications",
"appsInThisCat": "Applications dans cette catégorie",
"attributesAndMacros": "Attributs et macros",
"authChain": "Chaîne d'authentification",
"authChoice": "Choix d'authentification",
"authChoiceModules": "Modules autorisés",
"authChoiceParam": "Paramètre de l'URL",
@ -290,6 +291,7 @@
"multiValuesSeparator": "Separateur",
"name": "Nom",
"newApp": "Nouvelle application",
"newChain": "Nouvelle chaîne",
"newCat": "Nouvelle catégorie",
"newCfgAvailable": "Une nouvelle configuration est disponible",
"newEntry": "Nouvelle entrée",

File diff suppressed because one or more lines are too long