Code Duplication    Length = 12-13 lines in 2 locations

controller/admin_controller.php 2 locations

@@ 211-222 (lines=12) @@
208
			{
209
				$this->ad_preview($data['ad_code']);
210
			}
211
			else if (empty($this->errors))
212
			{
213
				$ad_id = $this->manager->insert_ad($data);
214
				$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
215
216
				// Add u_phpbb_ads_owner permission
217
				$this->auth_admin->acl_set('user', 0, $data['ad_owner'], array('u_phpbb_ads_owner' => 1));
218
219
				$this->log('ADD', $data['ad_name']);
220
221
				$this->success('ACP_AD_ADD_SUCCESS');
222
			}
223
224
			$this->assign_locations($data);
225
			$this->assign_form_data($data);
@@ 278-290 (lines=13) @@
275
276
				$success = $this->manager->update_ad($ad_id, $data);
277
278
				if ($success)
279
				{
280
					// Only insert new ad locations to DB when ad exists
281
					$this->manager->delete_ad_locations($ad_id);
282
					$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
283
284
					// Add u_phpbb_ads_owner permission to new owner
285
					$this->auth_admin->acl_set('user', 0, $data['ad_owner'], array('u_phpbb_ads_owner' => 1));
286
287
					$this->log('EDIT', $data['ad_name']);
288
289
					$this->success('ACP_AD_EDIT_SUCCESS');
290
				}
291
292
				$this->error('ACP_AD_DOES_NOT_EXIST');
293
			}