Code Duplication    Length = 16-16 lines in 2 locations

class.jetpack-admin.php 1 location

@@ 227-242 (lines=16) @@
224
				// The following two lines will rarely happen, as Jetpack::activate_module normally exits at the end.
225
				wp_safe_redirect( wp_get_referer() );
226
				exit;
227
			case 'bulk-deactivate' :
228
				if ( ! current_user_can( 'jetpack_deactivate_modules' ) ) {
229
					break;
230
				}
231
232
				$modules = (array) $_GET['modules'];
233
				$modules = array_map( 'sanitize_key', $modules );
234
				check_admin_referer( 'bulk-jetpack_page_jetpack_modules' );
235
				foreach ( $modules as $module ) {
236
					Jetpack::log( 'deactivate', $module );
237
					Jetpack::deactivate_module( $module );
238
					Jetpack::state( 'message', 'module_deactivated' );
239
				}
240
				Jetpack::state( 'module', $modules );
241
				wp_safe_redirect( wp_get_referer() );
242
				exit;
243
			default:
244
				return;
245
		}

class.jetpack.php 1 location

@@ 4172-4187 (lines=16) @@
4169
				$this->disconnect();
4170
				wp_redirect( $this->build_connect_url( true, false, 'reconnect' ) );
4171
				exit;
4172
			case 'deactivate' :
4173
				if ( ! current_user_can( 'jetpack_deactivate_modules' ) ) {
4174
					$error = 'cheatin';
4175
					break;
4176
				}
4177
4178
				$modules = stripslashes( $_GET['module'] );
4179
				check_admin_referer( "jetpack_deactivate-$modules" );
4180
				foreach ( explode( ',', $modules ) as $module ) {
4181
					Jetpack::log( 'deactivate', $module );
4182
					Jetpack::deactivate_module( $module );
4183
					Jetpack::state( 'message', 'module_deactivated' );
4184
				}
4185
				Jetpack::state( 'module', $modules );
4186
				wp_safe_redirect( Jetpack::admin_url( 'page=jetpack' ) );
4187
				exit;
4188
			case 'unlink' :
4189
				$redirect = isset( $_GET['redirect'] ) ? $_GET['redirect'] : '';
4190
				check_admin_referer( 'jetpack-unlink' );