Code Duplication    Length = 13-16 lines in 2 locations

controller/admin_controller.php 2 locations

@@ 139-151 (lines=13) @@
136
137
			$this->validate($data, 'phpbb/admanagement/add');
138
139
			if ($preview)
140
			{
141
				$this->ad_preview($data['ad_code']);
142
			}
143
			else if (empty($this->errors))
144
			{
145
				$ad_id = $this->manager->insert_ad($data);
146
				$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
147
148
				$this->log('ADD', $data['ad_name']);
149
150
				$this->success('ACP_AD_ADD_SUCCESS');
151
			}
152
153
			$this->assign_locations($data);
154
			$this->assign_form_data($data);
@@ 191-206 (lines=16) @@
188
			{
189
				$this->ad_preview($data['ad_code']);
190
			}
191
			else if (empty($this->errors))
192
			{
193
				$success = $this->manager->update_ad($ad_id, $data);
194
195
				if ($success)
196
				{
197
					// Only insert new ad locations to DB when ad exists
198
					$this->manager->delete_ad_locations($ad_id);
199
					$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
200
201
					$this->log('EDIT', $data['ad_name']);
202
203
					$this->success('ACP_AD_EDIT_SUCCESS');
204
				}
205
				$this->error('ACP_AD_DOES_NOT_EXIST');
206
			}
207
		}
208
		else
209
		{