@@ 289-292 (lines=4) @@ | ||
286 | $success = $this->manager->delete_ad($ad_id); |
|
287 | ||
288 | // Remove permission from the old user only if he has no more ads |
|
289 | if (count($this->manager->get_ads_by_owner($ad_data['ad_owner'])) === 0) |
|
290 | { |
|
291 | $this->auth_admin->acl_set('user', 0, (int) $ad_data['ad_owner'], array('u_phpbb_ads' => 0)); |
|
292 | } |
|
293 | ||
294 | // Only notify user on error or if not ajax |
|
295 | if (!$success) |
|
@@ 492-495 (lines=4) @@ | ||
489 | { |
|
490 | // Only update permissions when update was successful |
|
491 | // Remove permission from the old user only if he has no more ads |
|
492 | if (count($this->manager->get_ads_by_owner($old_data['ad_owner'])) === 0) |
|
493 | { |
|
494 | $this->auth_admin->acl_set('user', 0, $old_data['ad_owner'], array('u_phpbb_ads' => 0)); |
|
495 | } |
|
496 | $this->auth_admin->acl_set('user', 0, $this->data['ad_owner'], array('u_phpbb_ads' => 1)); |
|
497 | ||
498 | // Only insert new ad locations to DB when ad exists |