manage default button in assertion panel
This commit is contained in:
parent
61f8236140
commit
f1fa213487
@ -157,31 +157,52 @@ function setlmtext(id,v){
|
|||||||
function setlmdata(id,v){
|
function setlmdata(id,v){
|
||||||
$('#text_'+id).attr('value',v);
|
$('#text_'+id).attr('value',v);
|
||||||
}
|
}
|
||||||
function setlmsaml(id,div,v){
|
function setlmsamlassertion(id){
|
||||||
var max=0;
|
var ind=$('#samlAssertionIndex').attr('value');
|
||||||
if(div=='samlAssertion'){
|
var bin=$('#samlAssertionBinding').attr('value');
|
||||||
max=1;
|
var loc=$('#samlAssertionLocation').attr('value');
|
||||||
|
var def='0';
|
||||||
|
if($('#samlAssertionDefaultOn').attr('checked')==true){
|
||||||
|
def='1';
|
||||||
}
|
}
|
||||||
var s='';
|
// Update default value in other assertions.
|
||||||
var t=$('#content_'+div).find('input').get();
|
var parentId=lmparent(id);
|
||||||
|
var t=$('#'+parentId).find('span').get();
|
||||||
for(i in t){
|
for(i in t){
|
||||||
if(i > max){
|
if(def=='1'){
|
||||||
s=s+';';
|
var currentId=$(t[i]).attr('id');
|
||||||
|
if((currentId!='text_'+id)&&(currentId!='text_'+parentId)){
|
||||||
|
var d=$(t[i]).attr('value').split(';');
|
||||||
|
d[0]='0';
|
||||||
|
$('#'+currentId).attr('value',d.join(';'));
|
||||||
|
}
|
||||||
|
// If off, force on the first one.
|
||||||
|
}else if(i<t.length-1){
|
||||||
|
var currentId=$(t[t.length-1-i]).attr('id');
|
||||||
|
var d=$(t[t.length-1-i]).attr('value').split(';');
|
||||||
|
if(t.length-1-i>1)
|
||||||
|
{
|
||||||
|
d[0]='0';
|
||||||
|
}else{
|
||||||
|
d[0]='1';
|
||||||
}
|
}
|
||||||
var k=$(t[i]).attr('id');
|
$('#'+currentId).attr('value',d.join(';'));
|
||||||
if(k=='samlAssertionDefaultOn'){
|
alert('#'+currentId+'\n'+d.join(';'));
|
||||||
if($(t[i]).attr('checked')==true){
|
if(currentId=='test_'+id)
|
||||||
s=s+'1';
|
{
|
||||||
|
def='1';
|
||||||
}
|
}
|
||||||
}else if(k=='samlAssertionDefaultOff'){
|
|
||||||
if($(t[i]).attr('checked')==true){
|
|
||||||
s=s+'0';
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
s=s+$(t[i]).attr('value');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setlmdata(id,s);
|
var v=def+';'+ind+';'+bin+';'+loc;
|
||||||
|
setlmdata(id,v);
|
||||||
|
}
|
||||||
|
function setlmsamlservice(id){
|
||||||
|
var bin=$('#samlServiceBinding').attr('value');
|
||||||
|
var loc=$('#samlServiceLocation').attr('value');
|
||||||
|
var rep=$('#samlServiceResponseLocation').attr('value');
|
||||||
|
var v=bin+';'+loc+';'+rep;
|
||||||
|
setlmdata(id,v);
|
||||||
}
|
}
|
||||||
function display(div,title) {
|
function display(div,title) {
|
||||||
var divs=$('#content').children();
|
var divs=$('#content').children();
|
||||||
|
@ -184,15 +184,15 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><lang en="Binding" fr="Binding"/></td>
|
<td><lang en="Binding" fr="Binding"/></td>
|
||||||
<td><input type="text" size="50" id="samlServiceBinding" onchange="setlmsaml(currentId,'samlService',this.value)"/></td>
|
<td><input type="text" size="50" id="samlServiceBinding" onchange="setlmsamlservice(currentId)"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><lang en="Location" fr="URL"/></td>
|
<td><lang en="Location" fr="URL"/></td>
|
||||||
<td><input type="text" size="50" id="samlServiceLocation" onchange="setlmsaml(currentId,'samlService',this.value)"/></td>
|
<td><input type="text" size="50" id="samlServiceLocation" onchange="setlmsamlservice(currentId)"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><lang en="Response Location" fr="URL de retour"/></td>
|
<td><lang en="Response Location" fr="URL de retour"/></td>
|
||||||
<td><input type="text" size="50" id="samlServiceResponseLocation" onchange="setlmsaml(currentId,'samlService',this.value)"/></td>
|
<td><input type="text" size="50" id="samlServiceResponseLocation" onchange="setlmsamlservice(currentId)"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -202,21 +202,21 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><lang en="Default" fr="Par défaut"/></td>
|
<td><lang en="Default" fr="Par défaut"/></td>
|
||||||
<td><input id="samlAssertionDefaultOn" type="radio" name="boolean" value="1" onclick="setlmsaml(currentId,'samlAssertion',1)"/> <lang en="On" fr="Activé"/>
|
<td><input id="samlAssertionDefaultOn" type="radio" name="boolean" value="1" onclick="setlmsamlassertion(currentId)"/> <lang en="On" fr="Activé"/>
|
||||||
<input id="samlAssertionDefaultOff" type="radio" name="boolean" value="0" onclick="setlmsaml(currentId,'samlAssertion',0)"/> <lang en="Off" fr="Désactivé"/>
|
<input id="samlAssertionDefaultOff" type="radio" name="boolean" value="0" onclick="setlmsamlassertion(currentId)"/> <lang en="Off" fr="Désactivé"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><lang en="Index" fr="Index"/></td>
|
<td><lang en="Index" fr="Index"/></td>
|
||||||
<td><input type="text" size="50" id="samlAssertionIndex" onchange="setlmsaml(currentId,'samlAssertion',this.value)"/></td>
|
<td><input type="text" size="50" id="samlAssertionIndex" onchange="setlmsamlassertion(currentId)"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><lang en="Binding" fr="Binding"/></td>
|
<td><lang en="Binding" fr="Binding"/></td>
|
||||||
<td><input type="text" size="50" id="samlAssertionBinding" onchange="setlmsaml(currentId,'samlAssertion',this.value)"/></td>
|
<td><input type="text" size="50" id="samlAssertionBinding" onchange="setlmsamlassertion(currentId)"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><lang en="Location" fr="URL"/></td>
|
<td><lang en="Location" fr="URL"/></td>
|
||||||
<td><input type="text" size="50" id="samlAssertionLocation" onchange="setlmsaml(currentId,'samlAssertion',this.value)"/></td>
|
<td><input type="text" size="50" id="samlAssertionLocation" onchange="setlmsamlassertion(currentId)"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user