Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
Chris Dickenson committed Mar 19, 2015
1 parent 26f73f8 commit 1671718
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 42 deletions.
2 changes: 1 addition & 1 deletion admin/counters.php
Expand Up @@ -45,7 +45,7 @@
loadblock($MSG['2__0062'], $MSG['2__0058']);
loadblock($MSG['2__0060'], '', 'checkbox', 'auctions', $system->SETTINGS['counter_auctions']);
loadblock($MSG['2__0061'], '', 'checkbox', 'users', $system->SETTINGS['counter_users']);
loadblock($MSG['2__0058'], '', 'checkbox', 'online', $system->SETTINGS['counter_online']);
loadblock($MSG['2__0059'], '', 'checkbox', 'online', $system->SETTINGS['counter_online']);

$template->assign_vars(array(
'ERROR' => (isset($ERR)) ? $ERR : '',
Expand Down
3 changes: 2 additions & 1 deletion bid.php
Expand Up @@ -214,7 +214,8 @@ function extend_auction($id, $ends)
$params = array();
$params[] = array(':auc_id', $id, 'int');
$db->query($query, $params);
if ($db->numrows() == 0 || $db->result('id') != $bidder_id)
// send outbid email if there are previous bidders and they where not you
if ($db->numrows() > 0 && $db->result('id') != $bidder_id)
{
$send_email = true;
}
Expand Down
7 changes: 6 additions & 1 deletion includes/datacheck.inc.php
Expand Up @@ -154,7 +154,7 @@ function CheckSellData()
$buy_now = 'yes';
}

if ($buy_now == 'yes' && (!$system->CheckMoney($buy_now_price) || empty($buy_now_price) || floatval($buy_now_price) == 0))
if ($buy_now == 'yes' && (!$system->CheckMoney($buy_now_price) || empty($buy_now_price) || floatval($clean_buy_now_price) == 0))
{
return '061';
}
Expand Down Expand Up @@ -281,6 +281,11 @@ function CheckBidData()
}
else //dutch auction
{
// cannot bid below min price
if (bccomp($bid, $Data['minimum_bid'], $system->SETTINGS['moneydecimals']) == -1)
{
return '607';
}
if (($qty == 0) || ($qty > $Data['quantity']))
{
return '608';
Expand Down
4 changes: 2 additions & 2 deletions includes/functions_sell.php
Expand Up @@ -82,8 +82,8 @@ function setvars()
} else {
$start_now = $_SESSION['SELL_start_now'];
}
$is_taxed = (isset($_POST['is_taxed'])) ? 'y' : $_SESSION['SELL_is_taxed'];
$tax_included = (isset($_POST['tax_included'])) ? 'y' : $_SESSION['SELL_tax_included'];
$is_taxed = (isset($_POST['is_taxed'])) ? $_POST['is_taxed'] : $_SESSION['SELL_is_taxed'];
$tax_included = (isset($_POST['tax_included'])) ? $_POST['tax_included'] : $_SESSION['SELL_tax_included'];
if (isset($_POST['action']) && $_POST['action'] == 2)
{
$is_bold = (isset($_POST['is_bold'])) ? 'y' : 'n';
Expand Down
56 changes: 37 additions & 19 deletions order_print.php
Expand Up @@ -15,9 +15,11 @@
include 'common.php';
include $include_path . 'functions_invoices.php';

// first chanck if from admin
$fromadmin = true;
// first check if from admin
if (!(isset($_GET['hash']) && $_SESSION['INVOICE_RETURN'] == 'admin/invoice.php' && $_GET['hash'] == $_SESSION['WEBID_ADMIN_NUMBER']))
{
$fromadmin = false;
// If user is not logged in redirect to login page
if (!$user->is_logged_in())
{
Expand Down Expand Up @@ -58,26 +60,21 @@
$params[] = array(':auc_id', $_POST['pfval'], 'int');
$params[] = array(':winner_id', $_POST['pfwon'], 'int');
$db->query($query, $params);
}
else
{
// get fee data
$query = "SELECT * FROM " . $DBPrefix . "useraccounts WHERE useracc_id = :user_id";
$params = array();
$params[] = array(':user_id', $_GET['id'], 'int');
$db->query($query, $params);
}

// check its real
if ($db->numrows() < 1)
{
invalidinvoice();
}
// check its real
if ($db->numrows() < 1)
{
invalidinvoice();
}

$data = $db->fetch();
$data = $db->fetch();

// do you have permission to view this?
if (!$fromadmin && $data['seller_id'] != $user->user_data['id'])
{
invalidinvoice();
}

if ($auction)
{
// sort out auction data
$seller = getSeller($data['seller_id']);
$winner = getAddressWinner($data['winner']);
Expand Down Expand Up @@ -137,7 +134,28 @@
}
else
{
$seller = getSeller($user->user_data['id']); // used as user: ??
// get fee data
$query = "SELECT * FROM " . $DBPrefix . "useraccounts WHERE useracc_id = :user_id";
$params = array();
$params[] = array(':user_id', $_GET['id'], 'int');
$db->query($query, $params);

// check its real
if ($db->numrows() < 1)
{
invalidinvoice();
}

$data = $db->fetch();

// do you have permission to view this?
if (!$fromadmin && $data['user_id'] != $user->user_data['id'])
{
invalidinvoice();
}

//$seller = getSeller($user->user_data['id']); // used as user: ??
$seller = getSeller($data['user_id']);
$vat = getTax(true, $seller['country']);
$winner_address = '';
$data['shipping_terms'] = '';
Expand Down
8 changes: 4 additions & 4 deletions sell.php
Expand Up @@ -697,10 +697,10 @@
'NUMIMAGES' => count($_SESSION['UPLOADED_PICTURES']),
'RELIST' => $relist_options,
'MAXRELIST' => $system->SETTINGS['autorelist_max'],
'TAX_Y' => (intval($is_taxed) == 'y') ? 'checked' : '',
'TAX_N' => (intval($is_taxed) == 'n' || empty($is_taxed)) ? 'checked' : '',
'TAXINC_Y' => (intval($tax_included) == 1 || empty($tax_included)) ? 'checked' : '',
'TAXINC_N' => (intval($tax_included) == 2) ? 'checked' : '',
'TAX_Y' => ($is_taxed == 'y') ? 'checked' : '',
'TAX_N' => ($is_taxed == 'n' ) ? 'checked' : '',
'TAXINC_Y' => ($tax_included == 'y') ? 'checked' : '',
'TAXINC_N' => ($tax_included == 'n') ? 'checked' : '',
'MAXPICS' => sprintf($MSG['673'], $system->SETTINGS['maxpictures'], $system->SETTINGS['maxuploadsize']),

'FEE_VALUE' => get_fee($minimum_bid),
Expand Down
14 changes: 7 additions & 7 deletions themes/default/edit_data.tpl
Expand Up @@ -16,18 +16,18 @@
</tr>
<tr>
<td valign="top" class="errfont" style="text-align:right !important;">{L_004}</td>
<td align="left"><input type="password" name="TPL_password" size=20 maxlength="20"> {L_050}</td>
<td align="left"><input type="password" name="TPL_password" size="20"> {L_050}</td>
</tr>
<tr>
<td valign="top" class="errfont" style="text-align:right !important;">{L_005}</td>
<td align="left">
<input type="password" name="TPL_repeat_password" size=20 maxlength=20 />
<input type="password" name="TPL_repeat_password" size="20">
</td>
</tr>
<tr>
<td valign="top" align="right">{L_006}</td>
<td>
<input type="email" name="TPL_email" size=50 maxlength=50 value="{EMAIL}">
<input type="email" name="TPL_email" size="20" maxlength="50" value="{EMAIL}">
</td>
</tr>
<tr>
Expand All @@ -39,19 +39,19 @@
<tr>
<td valign="top" align="right">{L_009}</td>
<td>
<input type="text" name="TPL_address" size=40 maxlength=255 value="{ADDRESS}">
<input type="text" name="TPL_address" size="40" maxlength="255" value="{ADDRESS}">
</td>
</tr>
<tr>
<td valign="top" align="right">{L_010}</td>
<td>
<input type="text" name="TPL_city" size=25 maxlength=25 value="{CITY}">
<input type="text" name="TPL_city" size="25" maxlength="25" value="{CITY}">
</td>
</tr>
<tr>
<td valign="top" align="right">{L_011}</td>
<td>
<input type="text" name="TPL_prov" size=10 maxlength=10 value="{PROV}">
<input type="text" name="TPL_prov" size="20" maxlength="20" value="{PROV}">
</td>
</tr>
<tr>
Expand All @@ -65,7 +65,7 @@
<tr>
<td valign="top" align="right">{L_012}</td>
<td>
<input type="text" name="TPL_zip" size=8 value="{ZIP}">
<input type="text" name="TPL_zip" size="8" value="{ZIP}">
</td>
</tr>
<tr>
Expand Down
1 change: 1 addition & 0 deletions themes/default/home.tpl
Expand Up @@ -142,6 +142,7 @@
<li>{newsbox.DATE} - <a href="viewnews.php?id={newsbox.ID}">{newsbox.TITLE}</a></li>
<!-- END newsbox -->
</ul>
<a href="{SITEURL}viewallnews.php">{L_341}</a>
</div>
<!-- ENDIF -->
</td>
Expand Down
14 changes: 7 additions & 7 deletions themes/default/register.tpl
Expand Up @@ -30,21 +30,21 @@
<tr>
<td width="40%" valign="top" align="right"><b>{L_004}</b> *</td>
<td width="60%">
<input type="password" name="TPL_password" size=20 maxlength=20 <!-- IF MISSING2 eq 1 -->class="missing"<!-- ENDIF -->> {L_050}
<input type="password" name="TPL_password" size="20" <!-- IF MISSING2 eq 1 -->class="missing"<!-- ENDIF -->> {L_050}
<!-- IF MISSING2 eq 1 --><div class="error-box missing">{L_939}</div><!-- ENDIF -->
</td>
</tr>
<tr>
<td width="40%" valign="top" align="right"><b>{L_005}</b> *</td>
<td width="60%">
<input type="password" name="TPL_repeat_password" size=20 maxlength=20 <!-- IF MISSING3 eq 1 -->class="missing"<!-- ENDIF -->>
<input type="password" name="TPL_repeat_password" size="20" <!-- IF MISSING3 eq 1 -->class="missing"<!-- ENDIF -->>
<!-- IF MISSING3 eq 1 --><div class="error-box missing">{L_940}</div><!-- ENDIF -->
</td>
</tr>
<tr>
<td width="40%" valign="top" align="right"><b>{L_006}</b> *</td>
<td width="60%">
<input type="email" name="TPL_email" size=50 maxlength=50 value="{V_EMAIL}" <!-- IF MISSING4 eq 1 -->class="missing"<!-- ENDIF -->>
<input type="email" name="TPL_email" size="20" maxlength="50" value="{V_EMAIL}" <!-- IF MISSING4 eq 1 -->class="missing"<!-- ENDIF -->>
<!-- IF MISSING4 eq 1 --><div class="error-box missing">{L_941}</div><!-- ENDIF -->
</td>
</tr>
Expand All @@ -61,7 +61,7 @@
<tr>
<td width="40%" valign="top" align="right"><b>{L_009}</b>{REQUIRED(1)}</td>
<td width="60%">
<input type="text" name="TPL_address" size=40 maxlength=255 value="{V_ADDRE}" <!-- IF MISSING6 eq 1 -->class="missing"<!-- ENDIF -->>
<input type="text" name="TPL_address" size="40" maxlength="255" value="{V_ADDRE}" <!-- IF MISSING6 eq 1 -->class="missing"<!-- ENDIF -->>
<!-- IF MISSING6 eq 1 --><div class="error-box missing">{L_942}</div><!-- ENDIF -->
</td>
</tr>
Expand All @@ -70,7 +70,7 @@
<tr>
<td width="40%" valign="top" align="right"><b>{L_010}</b>{REQUIRED(2)}</td>
<td width="60%">
<input type="text" name="TPL_city" size=25 maxlength=25 value="{V_CITY}" <!-- IF MISSING7 eq 1 -->class="missing"<!-- ENDIF -->>
<input type="text" name="TPL_city" size="25" maxlength="25" value="{V_CITY}" <!-- IF MISSING7 eq 1 -->class="missing"<!-- ENDIF -->>
<!-- IF MISSING7 eq 1 --><div class="error-box missing">{L_943}</div><!-- ENDIF -->
</td>
</tr>
Expand All @@ -79,7 +79,7 @@
<tr>
<td width="40%" valign="top" align="right"><b>{L_011}</b>{REQUIRED(3)}</td>
<td width="60%">
<input type="text" name="TPL_prov" size=10 maxlength=10 value="{V_PROV}" <!-- IF MISSING8 eq 1 -->class="missing"<!-- ENDIF -->>
<input type="text" name="TPL_prov" size="20" maxlength="20" value="{V_PROV}" <!-- IF MISSING8 eq 1 -->class="missing"<!-- ENDIF -->>
<!-- IF MISSING8 eq 1 --><div class="error-box missing">{L_944}</div><!-- ENDIF -->
</td>
</tr>
Expand All @@ -100,7 +100,7 @@
<tr>
<td width="40%" valign="top" align="right"><b>{L_012}</b>{REQUIRED(5)}</td>
<td width="60%">
<input type="text" name="TPL_zip" size=8 value="{V_POSTCODE}" <!-- IF MISSING10 eq 1 -->class="missing"<!-- ENDIF -->>
<input type="text" name="TPL_zip" size="8" value="{V_POSTCODE}" <!-- IF MISSING10 eq 1 -->class="missing"<!-- ENDIF -->>
<!-- IF MISSING10 eq 1 --><div class="error-box missing">{L_946}</div><!-- ENDIF -->
</td>
</tr>
Expand Down

0 comments on commit 1671718

Please sign in to comment.