Checks the database if the E-mail address for Paypal is already in use.

Checks the database if the E-mail address for Paypal is already in use.

  1. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    jjjason84 submitted a new resource:

    Checks the database if the E-mail address for Paypal is already in use. - Checks the database if the E-mail address for Paypal is already in use.

    Read more about this resource...
     
    Last edited by a moderator: May 20, 2015
  2. liran

    liran New Member

    Joined:
    May 17, 2012
    Messages:
    136
    Likes Received:
    2
    thanks for this mod=)
    works great
     
    Last edited: Sep 15, 2012
  3. Lefteris Lefteros

    Lefteris Lefteros New Member

    Joined:
    Sep 6, 2012
    Messages:
    1
    Likes Received:
    0
    thank you for the mod.. it works like a charm!
     
  4. liran

    liran New Member

    Joined:
    May 17, 2012
    Messages:
    136
    Likes Received:
    2
    jjjason after checking it a bit more i had 1 problem.
    if somone already have blank paypal address, and another person trys to register with blank paypal it wont let him register..
     
  5. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    They should not be able to register with a blank paypal email it should come up with a error message ( A vaild PayPal email address is required ) when they try to register. But i did test your problem on my webid i deleted the paypal email out of my DB then whent to the user ( Edit your personal profile ) then enter the paypal email and clicked Save Changes and had no problem updating the paypal email in the DB.
     
  6. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,572
    Likes Received:
    546
    JJ they can join without a valid paypal email if the admin of the auction site has not set it as REQUIRED they mayhave it switched on in the admin back end but have forgot to select REQUIRED when turning it on
     
  7. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    OK i register as a new member with out the paypal email and turned off REQUIRED paypal email before registering. I confirm the account in the email then logged in to my webid with the new user name and password that i made when i registered. then went to ( Edit your personal profile ) and entered a paypal email and it updated with out any problems.

    Nay can you install this mod on your test server and see if you get the same error as he did i tried it and did not get any errors ?
     
  8. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,572
    Likes Received:
    546
    J sorry but he is not talking about editing the profile mate.

    What he is saying is that with your mod installed Man 1 joins the site and leaves his paypal email blank on joining, thats fine no problems but then Man 2 comes along a registers in the same way leaving his paypal email blank, your mod now stops Man 2 from joining because it has found another blank paypal email in the database bellonging to man 1

    Hope you understand now what he was saying.

    Basicaly if all admins select that the paypal email is a required field in admin then this is not a problem however not everyone likes to force new members to fill out crtain fields, in this case your mod needs to be rewriten to egnore blanks in the database.

    I am unsure how you would code this but maybe somthing in the code that if a NULL is returned continue the loop checking for other addresses.

    I dont know how to code but maybe somthing to add to the first line somthing like.
    PHP:
    $query "SELECT paypal_email FROM " $DBPrefix "users WHERE paypal_email= 'NOT_NULL'" $system->cleanvars
     
    Last edited: Oct 15, 2012
  9. liran

    liran New Member

    Joined:
    May 17, 2012
    Messages:
    136
    Likes Received:
    2
    yep nay is right, that's what i meant.
     
  10. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    Thank you nay for that info i will have to play around with the mod to see if i can fix it.
     
  11. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Don't know where about this has been fitted in the registration page but try this
    find
    PHP:
    if ($gateway_data['paypal_required'] == && empty($_POST['TPL_pp_email']))
        {
            
    $ERR $MSG['810'];
            
    $missing['paypal'] = true;
        }
    and directly under it place this

    PHP:
    if (isset($_POST['TPL_pp_email']) && !empty($_POST['TPL_pp_email']))
    {
    $query "SELECT paypal_email FROM " $DBPrefix "users WHERE paypal_email= '" $system->cleanvars($_POST['TPL_pp_email']) . "'"
    $res mysql_query($query); 
    $system->check_mysql($res$query__LINE____FILE__); 
    if (
    mysql_num_rows($res) > 0

    $ERR $ERR_115_1// Paypal E-mail already used 
    }
    }
    This should check and throw error only if paypal email has been entered and a match is found.
    (not tested but should work)
     
  12. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    Hello pani and thank you for that code i did look in the register page for it but it is not a ( if ) statement it is a ( elseif ) statement so would it still be the same just not using ( if ) and using ( elseif ) statement so it would look like this. ?

    PHP:
    elseif ($gateway_data['paypal_required'] == && empty($_POST['TPL_pp_email'])) 
        { 
            
    $ERR $MSG['810']; 
            
    $missing['paypal'] = true
        }  
    if (isset(
    $_POST['TPL_pp_email']) && !empty($_POST['TPL_pp_email'])) 

    $query "SELECT paypal_email FROM " $DBPrefix "users WHERE paypal_email= '" $system->cleanvars($_POST['TPL_pp_email']) . "'";  
    $res mysql_query($query);  
    $system->check_mysql($res$query__LINE____FILE__);  
    if (
    mysql_num_rows($res) > 0)  
    {  
    $ERR $ERR_115_1// Paypal E-mail already used  

    }
     
  13. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Yes like
    PHP:
    elseif ($gateway_data['paypal_required'] == && empty($_POST['TPL_pp_email']))
            {
                
    $ERR $MSG['810'];
            }
            elseif (isset(
    $_POST['TPL_pp_email']) && !empty($_POST['TPL_pp_email']))
            {
                
    $query "SELECT paypal_email FROM " $DBPrefix "users WHERE paypal_email= '" $system->cleanvars($_POST['TPL_pp_email']) . "'"
                
    $res mysql_query($query); 
                
    $system->check_mysql($res$query__LINE____FILE__); 
                if (
    mysql_num_rows($res) > 0
                { 
                  
    $ERR $ERR_115_1// Paypal E-mail already used 
                
    }
            }
    Got to keep remembering mine is way out of original version.
     
  14. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    Pani I tried that code a few weeks ago and never tried to register a new account and I tried today and did not work because of that code so i had to take it out and put it back the way i had it. Do you have any ideas why it did not work when you try to register it would just reload the register page with no errors?
     
  15. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Yes tried it and it does not work. Its in the wrong place find around line 250

    PHP:
    $query "SELECT email FROM " $DBPrefix "users WHERE email = '" $system->cleanvars($_POST['TPL_email']) . "'";
                
    $res mysql_query($query);
                
    $system->check_mysql($res$query__LINE____FILE__);
                if (
    mysql_num_rows($res) > 0)
                {
                    
    $ERR $ERR_115// E-mail already used
                
    }
    and right after it add

    PHP:
    $query "SELECT paypal_email FROM " $DBPrefix "users WHERE paypal_email= '" $system->cleanvars($_POST['TPL_pp_email']) . "'";  
                
    $res mysql_query($query);  
                
    $system->check_mysql($res$query__LINE____FILE__);  
                if (
    mysql_num_rows($res) > 0)  
                {  
                  
    $ERR $ERR_115_1// Paypal E-mail already used
                  
                
    This works and tested
     
  16. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    LOL now that funny that where i said to put it when i made the mod then someone had a problem with it but i guess back to square 1.
     
  17. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Oh ye, I forgot that was the reason for the problem. If someone has registered with no paypal email anyone registering after him without a paypal email it will see it as a duplicate of '' and throw an error. Add this instead, so it will only check the paypal email only when its filled in

    PHP:
    if (isset($_POST['TPL_pp_email']) && !empty($_POST['TPL_pp_email']))
               { 
    $query "SELECT paypal_email FROM " $DBPrefix "users WHERE paypal_email= '" $system->cleanvars($_POST['TPL_pp_email']) . "'";  
                
    $res mysql_query($query);  
                
    $system->check_mysql($res$query__LINE____FILE__);  
                if (
    mysql_num_rows($res) > 0)  
                {  
                  
    $ERR $ERR_115_1// Paypal E-mail already used 
                

                }
     
    Last edited: Oct 31, 2012
  18. dani

    dani New Member

    Joined:
    Oct 26, 2012
    Messages:
    13
    Likes Received:
    0
    I have created 2 accounts. first one with Paypal Email and the second blank.
    Once both activated I have updated the second account successfully with the existing paypal email from the first account.
    It seems that the code should also be somewhere in edit_data.php.
    Not sure where.
     
  19. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Hi dani,
    yes try this,
    in edit_data.php find
    PHP:
    if (isset($_POST['action']) && $_POST['action'] == 'update')
    {
        
    // Check data
        
    if ($_POST['TPL_email'])
        {
            if (
    strlen($_POST['TPL_password']) < && strlen($_POST['TPL_password']) > 0)
    and replace with

    PHP:
    if (isset($_POST['action']) && $_POST['action'] == 'update'

        
    // Check data 
        
    if ($_POST['TPL_email']) 
        {    
            
    $pp_email_already_exists false;
            if (!empty(
    $_POST['TPL_pp_email'])) 
               {  
               
    $query "SELECT paypal_email FROM " $DBPrefix "users WHERE paypal_email= '" $system->cleanvars($_POST['TPL_pp_email']) . "' AND id != " $user->user_data['id'];   
               
    $res mysql_query($query);   
               
    $system->check_mysql($res$query__LINE____FILE__);   
               if (
    mysql_num_rows($res) > 0)   
                {  
                 
    $pp_email_already_exists true
                } 
                } 
            if (
    $pp_email_already_exists) { 
                
    $ERR $ERR_115_1// Paypal E-mail already used  
            
    }         
            elseif (
    strlen($_POST['TPL_password']) < && strlen($_POST['TPL_password']) > 0)
     
    Last edited: Nov 17, 2012
  20. dani

    dani New Member

    Joined:
    Oct 26, 2012
    Messages:
    13
    Likes Received:
    0
    Hi Pani,
    I have managed to patch it just today. Thank you its working.
    However, that happen with the main email.
    I opened 2 accounts with different emails.
    Then I edited one account and entered successfully the existing email from the second account.
    Now I have 2 accounts with the same email.
     

Share This Page