ValidatorsConfiguration.js revision 62467e72606331d973e7610f7fc82ba9749282aa
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2012 ForgeRock AS. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/*global define, $, _ */
/**
* @author mbilski
*/
], function(constants, eventManager) {
var obj = {
"required": {
"name": "Required field",
"dependencies": [
],
if(v === "") {
callback("Required");
return;
}
callback();
}
},
"registrationEmail": {
"name": "Correct and unique email",
"dependencies": [
],
if(v === "") {
callback("Required");
return;
}
callback("Not a valid email address.");
return;
}
if(!available) {
callback("Email address already exists. <br /> <a href='#profile/forgotten_password/' id='frgtPasswrdSelfReg' class='ice'>Forgot password?</a>");
} else {
callback();
}
});
}
},
"adminRegistrationEmail": {
"name": "Correct and unique email",
"dependencies": [
],
if(v === "") {
callback("Required");
return;
}
callback("Not a valid email address.");
return;
}
if(!available) {
callback("Email address already exists.");
} else {
callback();
}
});
}
},
"name": {
"name": "Only alphabetic characters",
"dependencies": [
],
if(v === "") {
callback("Required");
return;
}
callback("Only alphabetic characters");
return;
}
callback();
}
},
"phone": {
"name": "Only numbers etc",
"dependencies": [
],
if(v === "") {
callback("Required");
return;
}
callback("Only numbers and special characters");
return;
}
callback();
}
},
"password": {
"name": "Password validator",
"dependencies": [
],
}
callback("disabled");
return;
} else {
}
}
if(v.length < 8) {
}
reg = /[(A-Z)]+/;
}
}
}
callback();
} else {
}
}
},
"passwordConfirm": {
"name": "Password confirmation",
"dependencies": [
],
callback("disabled");
return;
} else {
}
}
callback(["Confirmation matches password"]);
return;
}
callback();
}
},
"passPhrase": {
"name": "Min 4 characters",
"dependencies": [
],
callback("disabled");
return;
}
}
if(v.length < 4) {
callback("Minimum 4 characters");
return;
}
callback();
}
},
"siteImage": {
"name": "Site image not same as old",
"dependencies": [
],
callback("disabled");
return;
}
}
callback();
}
},
"termsOfUse": {
"name": "Acceptance required",
"dependencies": [
],
callback("Acceptance required for registration");
return;
}
callback();
}
},
"profileEmail": {
"name": "Correct and unique email",
"dependencies": [
],
callback();
return;
}
if(v === "") {
callback("Required");
return;
}
callback("Not a valid email address.");
return;
}
if(!available) {
callback("Email address already exists.");
} else {
callback();
}
});
}
},
"adminUserProfileEmail": {
"name": "Correct and unique email but can be same as was",
"dependencies": [
],
callback();
return;
}
if(v === "") {
callback("Required");
return;
}
callback("Not a valid email address.");
return;
}
if(!available) {
callback("Email address already exists.");
} else {
callback();
}
});
}
},
"oldPassword": {
"name": "Required field",
"dependencies": [
],
if(v === "") {
callback("Incorrect password");
return;
}
callback();
$("input[name='Continue']").click();
} else {
callback("Incorrect password");
}
});
}
},
"resetPasswordCorrectEmail": {
"name": "Reset Password Correct Email",
"dependencies": [
],
if(v === "") {
callback("Required");
$("input[name='Update']").click();
return;
}
callback("Not a valid email address.");
$("input[name='Update']").click();
return;
}
if(!available) {
callback();
} else {
callback("No such user");
}
$("input[name='Update']").click();
});
}
},
"securityAnswer": {
"name": "Check if security answer is correct",
"dependencies": [
],
if(v === "") {
callback("Required");
return;
}
function(result) {
callback();
}, function() {
callback("x");
});
}
},
"newSecurityAnswer": {
"name": "",
"dependencies": [
],
if(el.find("input[name=oldSecurityQuestion]").val() !== el.find("select[name=securityQuestion]").val()) {
if(v === "") {
callback("Required");
} else {
callback();
}
return;
}
if(v === "") {
callback("disabled");
} else {
callback();
}
}
}
};
return obj;
});