mirror of https://github.com/apache/archiva.git
add validation for ldap form
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1425383 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b4b64ec49f
commit
82147d6b4a
|
@ -1414,6 +1414,23 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
if (valid==false) {
|
if (valid==false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var useLdap = false;
|
||||||
|
for(var i=0;i<self.usedUserManagerImpls().length;i++){
|
||||||
|
var beanId=self.usedUserManagerImpls()[i].beanId;
|
||||||
|
$.log("beanId:"+beanId);
|
||||||
|
if(beanId=='ldap'){
|
||||||
|
useLdap=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.log("useLdap:"+useLdap);
|
||||||
|
if(useLdap==true) {
|
||||||
|
valid = mainContent.find("#redback-runtime-ldap-form-id").valid();
|
||||||
|
$.log("ldap valid:"+valid);
|
||||||
|
if (valid==false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.log("saveRedbackRuntimeConfiguration");
|
$.log("saveRedbackRuntimeConfiguration");
|
||||||
var saveButton = mainContent.find("#redback-runtime-configuration-save" );
|
var saveButton = mainContent.find("#redback-runtime-configuration-save" );
|
||||||
saveButton.button('loading');
|
saveButton.button('loading');
|
||||||
|
@ -1495,6 +1512,27 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activateLdapConfigurationFormValidation=function(){
|
||||||
|
var formSelector=$("#main-content" ).find("#redback-runtime-ldap-form-id");
|
||||||
|
var validator = formSelector.validate({
|
||||||
|
rules: {
|
||||||
|
ldapHost : {
|
||||||
|
digits: true,
|
||||||
|
min: 1,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
ldapPort : {
|
||||||
|
digits: true,
|
||||||
|
min: 1,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showErrors: function(validator, errorMap, errorList) {
|
||||||
|
customShowError(formSelector,validator,errorMap,errorMap);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
displayRuntimeConfiguration=function(){
|
displayRuntimeConfiguration=function(){
|
||||||
$.log("displayRuntimeConfiguration");
|
$.log("displayRuntimeConfiguration");
|
||||||
var mainContent = $("#main-content");
|
var mainContent = $("#main-content");
|
||||||
|
@ -1516,6 +1554,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
mainContent.html( $("#redback-runtime-configuration-main" ).tmpl() );
|
mainContent.html( $("#redback-runtime-configuration-main" ).tmpl() );
|
||||||
ko.applyBindings(redbackRuntimeConfigurationViewModel,$("#redback-runtime-configuration-content" ).get(0));
|
ko.applyBindings(redbackRuntimeConfigurationViewModel,$("#redback-runtime-configuration-content" ).get(0));
|
||||||
activateRedbackRuntimeGeneralFormValidation();
|
activateRedbackRuntimeGeneralFormValidation();
|
||||||
|
activateLdapConfigurationFormValidation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -928,38 +928,38 @@
|
||||||
<form class="form-horizontal" id="redback-runtime-ldap-form-id">
|
<form class="form-horizontal" id="redback-runtime-ldap-form-id">
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="ldap-host" class="control-label">
|
<label for="ldapHost" class="control-label">
|
||||||
${$.i18n.prop('redback.runtime.ldap.host.label')}
|
${$.i18n.prop('redback.runtime.ldap.host.label')}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="ldap-host" name="ldap-host" class="input-xlarge"
|
<input type="text" id="ldapHost" name="ldapHost" class="input-xlarge"
|
||||||
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().hostName"/>
|
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().hostName"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="ldap-port" class="control-label">
|
<label for="ldapPort" class="control-label">
|
||||||
${$.i18n.prop('redback.runtime.ldap.port.label')}
|
${$.i18n.prop('redback.runtime.ldap.port.label')}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="ldap-port" name="ldap-port" class="input-large"
|
<input type="text" id="ldapPort" name="ldapPort" class="input-large"
|
||||||
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().port"/>
|
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().port"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="ldap-baseDn" class="control-label">
|
<label for="ldapBaseDn" class="control-label">
|
||||||
${$.i18n.prop('redback.runtime.ldap.baseDn.label')}
|
${$.i18n.prop('redback.runtime.ldap.baseDn.label')}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="ldap-baseDn" name="ldap-baseDn" class="input-xxlarge"
|
<input type="text" id="ldapBaseDn" name="ldapBaseDn" class="input-xxlarge"
|
||||||
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().baseDn"/>
|
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().baseDn"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="ldap-bindDn" class="control-label">
|
<label for="ldapBindDn" class="control-label">
|
||||||
${$.i18n.prop('redback.runtime.ldap.bindDn.label')}
|
${$.i18n.prop('redback.runtime.ldap.bindDn.label')}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="ldap-bindDn" name="ldap-bindDn" class="input-xxlarge"
|
<input type="text" id="ldapBindDn" name="ldapBindDn" class="input-xxlarge"
|
||||||
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().bindDn"/>
|
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().bindDn"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -973,11 +973,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="ldap-password" class="control-label">
|
<label for="ldapPassword" class="control-label">
|
||||||
${$.i18n.prop('redback.runtime.ldap.password.label')}
|
${$.i18n.prop('redback.runtime.ldap.password.label')}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="password" id="ldap-password" name="ldap-password" class="input-xlarge"
|
<input type="password" id="ldapPassword" name="ldapPassword" class="input-xlarge"
|
||||||
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().password"/>
|
data-bind="value: redbackRuntimeConfiguration().ldapConfiguration().password"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue