[Vtigercrm-commits] [vtiger-commits] r10058 - /vtigercrm/branches/5.0.3/modules/Users/Forms.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Jan 13 08:18:54 EST 2007
Author: richie
Date: Sat Jan 13 06:18:51 2007
New Revision: 10058
Log:
validation of image format
Modified:
vtigercrm/branches/5.0.3/modules/Users/Forms.php
Modified: vtigercrm/branches/5.0.3/modules/Users/Forms.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Users/Forms.php (original)
+++ vtigercrm/branches/5.0.3/modules/Users/Forms.php Sat Jan 13 06:18:51 2007
@@ -40,6 +40,7 @@
$lbl_user_email1 = $mod_strings['LBL_LIST_EMAIL'];
$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
$err_invalid_email_address = $app_strings['ERR_INVALID_EMAIL_ADDRESS'];
+$lbl_user_image=$mod_strings['User Image'];
$the_script = <<<EOQ
@@ -52,6 +53,7 @@
}
function verify_data(form) {
+
var isError = false;
var errorMessage = "";
if (trim(form.email1.value) == "") {
@@ -82,6 +84,8 @@
oField_miss =form.confirm_password;
}
}
+
+
if (trim(form.user_name.value) == "") {
isError = true;
errorMessage += "\\n$lbl_user_name";
@@ -106,6 +110,25 @@
form.yahoo_id.focus();
exit();
}
+
+// fix for new user upload image validation
+ if (trim(form.imagename.value) != "")
+
+ {
+ var valimg=form.imagename.value;
+ var aUpload=valimg.split(".");
+ if((aUpload[aUpload.length-1]!="jpg") && (aUpload[aUpload.length-1]!="gif") && (aUpload[aUpload.length-1]!="bmp") && (aUpload[aUpload.length-1]!="png"))
+ {
+
+ alert("Pleae Select a Valid Image");
+ form.imagename.focus(); exit();
+
+ }
+
+ }
+
+
+
if(form.mode.value != 'edit')
{
if(trim(form.user_password.value) != trim(form.confirm_password.value))
More information about the vtigercrm-commits
mailing list