WeBid Bug Tracking

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000472WeBidAdmin Control Panelpublic2014-07-15 15:102015-02-17 12:01
Reporternay27uk 
Assigned To 
Priority@0@SeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.1.1 
Target VersionFixed in Version1.1.2 
Summary0000472: BUG FOUND: Problem with suspended user's after account is back in credit
DescriptionI think I may have found a bug in WeBid while working on a http://www.webidsupport.com/forums/showthread.php?7894-Add-a-credit-section-to-the-outstanding-page" [^" title="]MOD ">]MOD for another member.

This bug has to do with the status of the user suspended not changing when the account balance is brought back up to date.

Let me explain what I am talking about in the best way I can.

In admin you set a maximum dept limit, on mine the maximum dept limit is set to £1.00 (the maximum dept is a confusing one and is actually -£1.00 bellow £0.00 so maybe that needs renaming to Minimum dept limit in the admin side or Maximum dept over £0.00).
 
Another setting is "Suspend accounts that are over the dept limit" on mine I have this set to YES

Now when a member reaches this dept limit I.E £1.00 bellow £0.00 they are suspended, this is fine.

The member now gets a message when they log in saying that they are in dept and that their account is suspended and to click here to make a payment (or words to that effect).

Now this is where I am confused because I have not tried to make a payment as the member via Paypal to bring the account back in to credit (I don't have 2 Paypal accounts so I cant).

What I do do is log in as admin and make the account back in credit via the WeBid admin > Users > edit user link however this is not making the member un suspended again so when they log in they get the same message saying that they are in dept and that their account is suspended and to click here to make a payment (or words to that effect) even though their account is in credit £1.000,000 in credit in my case .

I cant say if it makes the member automatically un suspended if they take the Paypal rout but adding a + balance via the WeBid admin does not make them automatically un suspended the admin has to click the activate user link from the user section in admin to make them active again and stop the user from getting the above message when they log in (I even ran the cron.php manually because I thought that may make them un suspended again but that has no effect).

Could someone check this for me to confirm that this is a bug.

It may just need the balance code changing in the admin side to check if the user is suspended and if they are when the admin brings the account back in to balance it automatically sets suspended to 0.

Like I said I cant check it paying as the member because I have no access to 2 Paypal accounts and I have no clue if Sandbox would even work for that, or how to implement it into WeBid (A sandbox option in admin is another thing WeBid should have out of the box for testing things, but that's another thread).

Until I can resolve this problem I will have to put the MOD I linked to in the beginning of this thread on HOLD as the MOD and also what is displayed in outstanding.php contradict the WeBid admin and the message the user sees when they log in.
TagsNo tags attached.
import_id478
Thread
Attached Files

- Relationships

-  Notes
(0001293)
pani100 (reporter)
2014-07-15 15:50
edited on: 1970-01-01 00:00

Yes, it does not un-suspend user. Even in admin it still says Balance over debt limit when credit has been added.
(0001294)
nay27uk (reporter)
2014-07-15 15:53
edited on: 1970-01-01 00:00

pani100;39777 wrote

Yes, it does not un-suspend user. Even in admin it still says Balance over debt limit when credit has been added.


Exactly what I was trying to say panni I cant finish my MOD unless this gets resolved see my edited post above, the very last bits of it, I was editing when you where posting LOL
(0001295)
pani100 (reporter)
2014-07-15 17:30
edited on: 2014-10-14 10:31

nay27uk;39778 wrote

Exactly what I was trying to say panni I cant finish my MOD unless this gets resolved see my edited post above, the very last bits of it, I was editing when you where posting LOL

Balance has been added in the edit user page on the 1.1 versions but no processing is being done to that value.
It needs to be checked if empty and also compare with max allowed to change suspended to 0.
None of this is being done.
Try this in admin/edituser.php,
Find the below lines around 101 to 131

[PHP]
elseif (count($_POST['group']) == 0)
        {
            $ERR = $ERR_044;
        }
        else
        {
            if (!empty($_POST['birthdate']))
            {
                $birthdate = $birth_year . $birth_month . $birth_day;
            }
            else
            {
                $birthdate = 0;
            }

            $query = "UPDATE " . $DBPrefix . "users SET
                  name = '" . $system->cleanvars($_POST['name']) . "',
                  email = '" . $system->cleanvars($_POST['email']) . "',
                  address = '" . $system->cleanvars($_POST['address']) . "',
                  city = '" . $system->cleanvars($_POST['city']) . "',
                  prov = '" . $system->cleanvars($_POST['prov']) . "',
                  country = '" . $system->cleanvars($_POST['country']) . "',
                  zip = '" . $system->cleanvars($_POST['zip']) . "',
                  phone = '" . $system->cleanvars($_POST['phone']) . "',
                  birthdate = '" . $system->cleanvars($birthdate) . "',
                  groups = '" . implode(',', $_POST['group']) . "',
                  balance = '" . $system->input_money($_POST['balance']) . "'";
            if (strlen($_POST['password']) > 0)
            {
                $query .= ", password = '" . md5($MD5_PREFIX . $_POST['password']) . "'";
            }
[/PHP]


and replace with

[PHP]
        elseif (count($_POST['group']) == 0)
        {
            $ERR = $ERR_044;
        }
        if (empty($_POST['balance']))
        {
            $ERR = $ERR_112;
        }
        if (isset($_POST['balance'])) {
        
        $balance_clean = str_replace('-', '', $_POST['balance']);
        
        }
        if (!$system->CheckMoney($balance_clean))
        {
            $ERR = str_replace(strtolower($MSG['497']), $MSG['935'], $ERR_061);
            
        }
        else
        {
            if (!empty($_POST['birthdate']))
            {
                $birthdate = $birth_year . $birth_month . $birth_day;
            }
            else
            {
                $birthdate = 0;
            }

            // process balance positive and negative allowed and compare to max allowed credit before it is marked/unmarked as suspended
            $balance = '';
                if(isset($_POST['balance'])) {
                  if ($_POST['balance'] < 0) {
                      $balance = ", balance = '-" . $system->input_money($balance_clean) . "'";
                      } else {
                      $balance = ", balance = '" . $system->input_money($balance_clean) . "'";
                     }
                
                
                if ($_POST['balance'] >= -$system->SETTINGS['fee_max_debt']) {
                $balance .= ", suspended = 0 ";
                }
                elseif ($_POST['balance'] < -$system->SETTINGS['fee_max_debt']) {
                $balance .= ", suspended = 7 ";
                }
            }
            
            $query = "UPDATE " . $DBPrefix . "users SET
                  name = '" . $system->cleanvars($_POST['name']) . "',
                  email = '" . $system->cleanvars($_POST['email']) . "',
                  address = '" . $system->cleanvars($_POST['address']) . "',
                  city = '" . $system->cleanvars($_POST['city']) . "',
                  prov = '" . $system->cleanvars($_POST['prov']) . "',
                  country = '" . $system->cleanvars($_POST['country']) . "',
                  zip = '" . $system->cleanvars($_POST['zip']) . "',
                  phone = '" . $system->cleanvars($_POST['phone']) . "',
                  birthdate = '" . $system->cleanvars($birthdate) . "',
                  groups = '" . implode(',', $_POST['group']) . "'
                  " . $balance;
                  
            if (strlen($_POST['password']) > 0)
            {
                $query .= ", password = '" . md5($MD5_PREFIX . $_POST['password']) . "'";
            }
[/PHP]

Also find around line 205

[PHP]
'BALANCE' => $user_data['balance'],
[/PHP]

and replace with

[PHP]
'BALANCE' => $system->print_money_nosymbol($user_data['balance']),
[/PHP]
This will work with negative credit too and will re-mark user as suspended if value entered is lower than the max allowed credit.

[SIZE=4]Updated 14/10/2014 11:31am[/SIZE]

Added check for balance input money format as non usa type of currency was having a problem with the comma in the input and also had a problem displaying the correct currency format on the tpl page after balance was inserted.
(0001296)
nay27uk (reporter)
2014-07-15 22:29
edited on: 1970-01-01 00:00

Cheers pani100 that seems to have resolved that bug, great work mate.
Another thread to add to the 1.1.1 bug fix section

- Issue History
Date Modified Username Field Change
2015-04-01 13:17 renlok New Issue
2015-04-01 13:17 renlok import_id => 478
2015-04-01 13:17 renlok Date Submitted 2015-04-01 13:17 => 2014-07-15 15:10
2015-04-01 13:17 renlok Last Update 2015-04-01 13:17 => 2015-02-17 12:01


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker