first functional step in managing SAML idp in the manager through jquery

environments/ppa-mbqj77/deployments/1
Thomas CHEMINEAU 16 years ago
parent 3107f0e44b
commit 5ac95df875
  1. 26
      modules/lemonldap-ng-manager/example/skins/default/manager.js
  2. 9
      modules/lemonldap-ng-manager/example/skins/default/manager.tpl
  3. 8
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm
  4. 2
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm

@ -266,6 +266,16 @@ function samlAssertion(id) {
$('#samlAssertionLocation').attr('value',t[3]);
display('samlAssertion',lmtext(id));
}
function samlIDP(id){
currentId=id;
if($('#li_'+myB64('saml/samlIDPMetaData')).find('span').size()==1){
$('#delsamlidpb').hide();
}else{
$('#delsamlidpb').show();
}
$('#samlIDPMetaData').attr('value',lmtext(id));
display('samlIDPMetaData',lmtext(id));
}
function samlService(id) {
currentId=id;
var t=lmdata(id).split(';');
@ -383,6 +393,22 @@ function newVh(name){
vhost(vhId);
});
}
function delSamlIDP(id){
var idpname = $('#text_'+id).attr('name');
if(confirm('Delete '+idpname+' ?')){
$('#'+id).remove();
samlIDP(id);
}
}
function newSamlIDP(){
var value = prompt(text4newSamlIDP,'authentic');
if(!value){return false;}
var idpId='li_'+myB64('/saml/samlIDPMetaData/'+value);
simpleTreeCollection[0].newAjaxNodeIn($('#li_c2FtbC9zYW1sSURQTWV0YURhdGE1'),idpId,value,scriptname+'?type=new&node=saml/samlIDPMetaData/'+value,function(d,s){
$('>span',s).attr('name',value).attr('help','default').attr('id','text_'+idpId).attr('onclick','samlIDP(\''+idpId+'\')');
samlIDP(idpId);
});
}
var cfgAttrDone=0;
function uploadConf(f){
if(!(f==1))f=0;

@ -20,6 +20,7 @@
var text4newKey='<lang en="Key" fr="Clé" />';
var value4newKey='<lang en="Value" fr="Valeur" />';
var text4newVhost='<lang en="Virtual host name" fr="Nom de l\'hôte virtuel" />';
var text4newSamlIDP='<lang en="Identity provider name" fr="Nom du fournisseur d\'identités" />';
//]]></script>
<script src="<TMPL_VAR NAME="DIR">/manager.js" type="text/JavaScript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
@ -97,6 +98,14 @@
<button id="delkb" style="display:none;" onclick="delKey();return false;" class="ui-state-default ui-corner-all">
<lang en="Delete key" fr="Effacer la clef" />
</button>
<button id="newsamlidpb" style="display:none;" onclick="newSamlIDP();return false;" class="ui-state-default ui-corner-all">
<lang en="New identity provider" fr="Nouveau fournisseur d'identités" />
</button>
<button id="delsamlidpb" style="display:none;" onclick="delSamlIDP(currentId);" class="ui-state-default ui-corner-all">
<lang en="Delete identity provider" fr="Supprimer le fournisseur d'identités" />
</button>
</div>
<!-- Buttons -->

@ -244,9 +244,15 @@ sub struct {
# SAML #
########
saml => {
_nodes => [qw(n:samlServiceMetaData samlServicePrivateKey)],
_nodes => [qw(samlServicePrivateKey n:samlServiceMetaData n:samlIDPMetaData)],
_help => 'saml',
samlIDPMetaData => {
_nodes => ['nhash:/samlIDPMetaData:samlIDPMetaData:samlIDP'],
_help => 'default',
_call => '$(\'#newsamlidpb\').show();',
},
samlServiceMetaData => {
_nodes => [
qw(samlEntityID

@ -127,6 +127,7 @@ sub en {
saml => 'SAML',
samlServicePrivateKey => 'Private Key',
samlIDPMetaData => 'Identity providers',
samlServiceMetaData => 'SAML 2 Service',
samlEntityID => 'Entity Identifier',
samlOrganization => 'Organization',
@ -261,6 +262,7 @@ sub fr {
saml => 'SAML',
samlServicePrivateKey => 'Clé privée',
samlIDPMetaData => 'Fournisseurs d\'identités',
samlServiceMetaData => 'Service SAML 2',
samlEntityID => 'Identifiant d\'entité',
samlOrganization => 'Organisation',

Loading…
Cancel
Save