Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skipyT’s picture

Status: Needs work » Active
skipyT’s picture

Assigned: Unassigned » skipyT
skipyT’s picture

Title: ban.ip_manager injects database service » Add a ban.ip_manager mongo service
Status: Active » Needs review
FileSize
3.04 KB

Added the mongo.ban_ip.manager mongo service.

skipyT’s picture

Issue summary: View changes
marcingy’s picture

Status: Needs review » Needs work
 public function findById($ban_id) {
+    $result = $this->mongo->get('ban_ip')
+      ->findOne(array('iid' => $ban_id), array('ip'));
+    return $result ? $result['ip'] : FALSE;
+  }

When we ban an IP in mongo we never set iid, as a result it won't exist, instead we will have an _id. This will be a mongo_id object based _id. I am thinking that we need to swap this query to use _id (free index) and also explicitly set the _id when we create the ban record.

skipyT’s picture

Status: Needs work » Needs review
FileSize
2.86 KB

using the _id from mongo now instead of iid.
also deleted the isDenied function, because it was deleted in core and rerolled the patch on current mongo codebase.

Status: Needs review » Needs work

The last submitted patch, 6: 2224723-ban_ip_manager-6.patch, failed testing.

skipyT’s picture

Status: Needs work » Needs review
FileSize
2.86 KB

fixed typo.

fgm’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Category: Task » Feature request

Although there was no move in 4 years on that issue, the feature and its implementation might make sense in 8.x-2.x, so bumping.

fgm’s picture

Status: Needs review » Needs work

Rebased on 8.x-2.x but needs changes to use the 8.x-2.x API instead of 8.x-1.x.

PR at https://github.com/fgm/mongodb/pull/63