Thanks autocy for your sharing. I will try it out today
Printable View
Hi autocy, Vladimir actually applied this fix to my site. I test by making a new plan with 1 limited usage then change a listing to that plan until it used up. Then try editing it and got message saying Hack Detected please choose other plan. :(
You need also fix for addlisting class file
Also if you use 4.6.2 version you have to uncomment lines 590-593 in Editlisting.php class file:Code:Only registered members can view the code.
Code:Only registered members can view the code.
Hi autocy
Thank you very much for your help.
I only apply this as your suggestion:
Quote:
// Check plan using data
// if ($plan_info['Limit'] > 0 && $plan_info['Using'] == 0 && $plan_info['Using'] != '') {
// $errors[] = $lang['plan_limit_using_hack'];
// }
Do you know what does this part actually do? I did not apply this, but hack detected problem is solved. Do I need it?
Quote:
// Limited listing mode
elseif ($plan_info['Type'] == 'listing' && $plan_info['Limit'] > 0 ) {
$usage_key = $plan_info['Using'] ? 'Using' : 'Limit';
if (empty($plan_info['Using'])) {
$plan_usage_insert = array(
'Account_ID' => $account_info['ID'],
'Plan_ID' => $plan_info['ID'],
'Listings_remains' => $plan_info[$usage_key] - 1,
'Type' => 'limited',
'Date' => 'NOW()',
'IP' => $reefless->getClientIpAddress()
);
$rlDb->insert($plan_usage_insert, 'listing_packages');
} else {
$plan_using_update = array(
'fields' => array(
'Account_ID' => $account_info['ID'],
'Plan_ID' => $plan_info['ID'],
'Listings_remains' => $plan_info['Using']-1,
'Type' => 'limited',
'Date' => 'NOW()',
'IP' => $reefless->getClientIpAddress()
),
'where' => array(
'ID' => $plan_info['Plan_using_ID']
)
);
$rlDb->update($plan_using_update, 'listing_packages');
}
}
return $paid_status;
}
Also the listing plan with limited usage does not show the number of usage allow. Is it normal to you? I meant when user look at three plan, plan 1 can be used 1 time, plan 2 and 3 can be used for 10 times. It doesn't show the number of limited usage. :(
Yes your right.It shows (1). I didn't noticed because my limited plan is for only one use. If your limited plans are allowed more than one time you need the modified version (the one you asked if it's needed) to count correctly the uses.eg. if it's used already the script will not add a new entry instead will update the plan number of uses