Code Duplication    Length = 16-16 lines in 2 locations

class.jetpack.php 1 location

@@ 4280-4295 (lines=16) @@
4277
					$this->disconnect();
4278
					wp_redirect( $this->build_connect_url( true, false, 'reconnect' ) );
4279
					exit;
4280
				case 'deactivate':
4281
					if ( ! current_user_can( 'jetpack_deactivate_modules' ) ) {
4282
						$error = 'cheatin';
4283
						break;
4284
					}
4285
4286
					$modules = stripslashes( $_GET['module'] );
4287
					check_admin_referer( "jetpack_deactivate-$modules" );
4288
					foreach ( explode( ',', $modules ) as $module ) {
4289
						self::log( 'deactivate', $module );
4290
						self::deactivate_module( $module );
4291
						self::state( 'message', 'module_deactivated' );
4292
					}
4293
					self::state( 'module', $modules );
4294
					wp_safe_redirect( self::admin_url( 'page=jetpack' ) );
4295
					exit;
4296
				case 'unlink':
4297
					$redirect = isset( $_GET['redirect'] ) ? $_GET['redirect'] : '';
4298
					check_admin_referer( 'jetpack-unlink' );

class.jetpack-admin.php 1 location

@@ 276-291 (lines=16) @@
273
				// The following two lines will rarely happen, as Jetpack::activate_module normally exits at the end.
274
				wp_safe_redirect( wp_get_referer() );
275
				exit;
276
			case 'bulk-deactivate':
277
				if ( ! current_user_can( 'jetpack_deactivate_modules' ) ) {
278
					break;
279
				}
280
281
				$modules = (array) $_GET['modules'];
282
				$modules = array_map( 'sanitize_key', $modules );
283
				check_admin_referer( 'bulk-jetpack_page_jetpack_modules' );
284
				foreach ( $modules as $module ) {
285
					Jetpack::log( 'deactivate', $module );
286
					Jetpack::deactivate_module( $module );
287
					Jetpack::state( 'message', 'module_deactivated' );
288
				}
289
				Jetpack::state( 'module', $modules );
290
				wp_safe_redirect( wp_get_referer() );
291
				exit;
292
			default:
293
				return;
294
		}