Anonymous Login
2023-06-05 10:18 PDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000881v3.2 ReleaseUser Adminpublic2014-07-16 21:28
Reporterbbalegere 
Assigned Tocaseydk 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product Version 
Target Version3.2Fixed in Version3.2 
Summary0000881: Email is not validated in while creating users
DescriptionWhile creating users the email id is not validated.
Anything with a length of more than 4 is accepted.
So i have added an extra function to validate email id.
TagsNo tags attached.
Attached Files
  • diff file icon emailvalid.diff (1,213 bytes) 1969-12-31 16:00 -
    --- addedituser.php	2011-07-05 11:25:16.000000000 +0530
    +++ myaddedituser.php	2011-07-13 18:48:24.338585001 +0530
    @@ -88,6 +88,16 @@
         $AppUI->addFooterJavascriptFile('js/passwordstrength.js');
     ?>
     <script language="javascript" type="text/javascript">
    +function validateEmail(x)
    +{
    +var atpos=x.indexOf("@");
    +var dotpos=x.lastIndexOf(".");
    +if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
    +{
    +
    +  return true;
    +}
    +}
     function submitIt(){
         var form = document.editFrm;
        if (form.user_username.value.length < <?php echo w2PgetConfig('username_min_len'); ?> && form.user_username.value != '<?php echo w2PgetConfig('admin_username'); ?>') {
    @@ -110,7 +120,7 @@
         } else if (form.contact_last_name.value.length < 1) {
             alert("<?php echo $AppUI->_('adminValidLastName', UI_OUTPUT_JS); ?>");
             form.contact_last_name.focus();
    -    } else if (form.contact_email.value.length < 4) {
    +    } else if (validateEmail(form.contact_email.value)) {
             alert("<?php echo $AppUI->_('adminInvalidEmail', UI_OUTPUT_JS); ?>");
             form.contact_email.focus();
         } else {
    @@ -260,4 +270,4 @@
             </tr>
             <?php } ?>
         </table>
    -</form>
    \ No newline at end of file
    +</form>
    
    diff file icon emailvalid.diff (1,213 bytes) 1969-12-31 16:00 +

-Relationships
+Relationships

-Notes

~0002026

caseydk (administrator)

This is a good implementation for the front end validation, we also need to hook an email validity check into the CUser->check() method using w2p_check_email() in includes/main_functions.php

~0002034

bbalegere (reporter)

w2p_check_email() can be updated with the validation code from here. http://pear.php.net/manual/en/package.validate.validate.email.php

~0002035

caseydk (administrator)

While that would work, it introduces a new dependency of that PEAR module. Instead, we'll use the filter_var function with FILTER_VALIDATE_EMAIL available in PHP 5.2.0+

Docs: http://www.php.net/manual/en/function.filter-var.php

~0003368

caseydk (administrator)

Resolved in development:
https://github.com/web2project/web2project/commit/dff74ec2571b7deae7f36f53968f4ce024814098
+Notes

-Issue History
Date Modified Username Field Change
2011-07-13 05:20 bbalegere New Issue
2011-07-13 05:20 bbalegere File Added: emailvalid.diff
2011-07-14 23:01 caseydk Note Added: 0002026
2011-07-14 23:01 caseydk Status new => acknowledged
2011-07-14 23:02 caseydk Severity major => minor
2011-07-14 23:02 caseydk Project v2.3 Release (Closed) => Pending Requests
2011-07-15 07:11 bbalegere Note Added: 0002034
2011-07-15 07:31 caseydk Note Added: 0002035
2014-05-20 20:32 caseydk Project Pending Requests => v3.2 Release
2014-05-20 20:34 caseydk Note Added: 0003368
2014-05-20 20:34 caseydk Status acknowledged => resolved
2014-05-20 20:34 caseydk Resolution open => fixed
2014-05-20 20:34 caseydk Assigned To => caseydk
2014-05-22 19:52 caseydk Category General => User Admin
2014-05-22 19:52 caseydk Product Version 2.3 =>
2014-06-10 22:09 caseydk Target Version => 3.2
2014-07-16 21:26 caseydk Fixed in Version => 3.2
2014-07-16 21:28 caseydk Status resolved => closed
+Issue History