yf_shop_order_validate_data user module| File | plugins/shop/modules/shop/yf_shop_order_validate_data.class.php |
|---|---|
| Use | module('shop_order_validate_data'), URL ?object=shop_order_validate_data |
| Property | Default | Description |
|---|---|---|
| None declared in this class. | ||
None without a leading underscore.
_ hooks and helpers; not routable as page actionspublic function _order_validate_data()
validate order data for view order.
public function _order_validate_data()
{
if (empty($_POST['order_id'])) {
_re('Order empty');
}
$order_info = db()->query_fetch('SELECT * FROM ' . db('shop_orders') . ' WHERE id=' . (int) (($_POST['order_id'] ?? null)));
if (empty($order_info)) {
_re('No such order');
}
if (empty($_POST['email'])) {
_re('e-mail empty');
} elseif ( ! common()->email_verify(($_POST['email'] ?? null))) {
_re('email not valid.');
} elseif ($order_info['email'] != ($_POST['email'] ?? null)) {
_re('The order has been issued on other name');
}
}