Skip to content

Commit

Permalink
for fraud ip work done.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Aug 5, 2015
1 parent c76d1c5 commit 0473564
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 173 deletions.
Empty file.
4 changes: 3 additions & 1 deletion upload/admin/controller/fraud/ip.php
Expand Up @@ -172,7 +172,9 @@ public function addIp() {
} else {
$this->load->model('fraud/ip');

$this->model_fraud_ip->addIp($this->request->post['ip']);
if (!$this->model_fraud_ip->getTotalIpsByIp($this->request->post['ip'])) {
$this->model_fraud_ip->addIp($this->request->post['ip']);
}

$json['success'] = $this->language->get('text_success');
}
Expand Down
6 changes: 6 additions & 0 deletions upload/admin/model/fraud/ip.php
Expand Up @@ -41,4 +41,10 @@ public function getTotalIps() {

return $query->row['total'];
}

public function getTotalIpsByIp($ip) {
$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "fraud_ip` WHERE ip = '" . $this->db->escape($ip) . "'");

return $query->row['total'];
}
}
322 changes: 159 additions & 163 deletions upload/admin/view/template/fraud/ip.tpl

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions upload/catalog/model/checkout/order.php
Expand Up @@ -255,12 +255,12 @@ public function getOrder($order_id) {

public function addOrderHistory($order_id, $order_status_id, $comment = '', $notify = false) {
$event_data = array(
'order_id' => $order_id,
'order_status_id' => $order_status_id,
'comment' => $comment,
'notify' => $notify
'order_id' => $order_id,
'order_status_id' => $order_status_id,
'comment' => $comment,
'notify' => $notify
);

$this->event->trigger('pre.order.history.add', $event_data);

$order_info = $this->getOrder($order_id);
Expand Down
14 changes: 13 additions & 1 deletion upload/system/engine/loader.php
@@ -1,11 +1,16 @@
<?php
final class Loader {
private $registry;
private $hooks = array();

public function __construct($registry) {
$this->registry = $registry;
}

public function addHook($type, $object) {
$this->hooks[$type][] = $object;
}

public function controller($route, $args = array()) {
$action = new Action($route, $args);

Expand All @@ -27,6 +32,13 @@ public function model($model) {
}

public function view($template, $data = array()) {
/*
if (isset($this->hooks[$type])) {
foreach ($this->hook as $hook) {
$hook->call(&$template, &data);
}
}
*/
$file = DIR_TEMPLATE . $template;

if (file_exists($file)) {
Expand Down Expand Up @@ -76,4 +88,4 @@ public function config($config) {
public function language($language) {
return $this->registry->get('language')->load($language);
}
}
}
10 changes: 7 additions & 3 deletions upload/system/library/document.php
Expand Up @@ -54,11 +54,15 @@ public function getStyles() {
return $this->styles;
}

public function addScript($script, $postion = 'header') {
$this->scripts[$postion][md5($script)] = $script;
public function addScript($href, $postion = 'header') {
$this->scripts[$postion][$href] = $href;
}

public function getScripts($postion = 'header') {
return $this->scripts[$postion];
if (isset($this->scripts[$postion])) {
return $this->scripts[$postion];
} else {
return array();
}
}
}

0 comments on commit 0473564

Please sign in to comment.