Code Duplication    Length = 13-15 lines in 2 locations

admin_pages/venues/Venues_Admin_Page.core.php 1 location

@@ 1134-1146 (lines=13) @@
1131
		}
1132
1133
1134
		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_venues', 'get_venues' ) ) {
1135
			$where['VNU_wp_user'] =  get_current_user_id();
1136
		} else {
1137
				if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' ) ) {
1138
					$where['OR'] = array(
1139
						'status*restrict_private' => array( '!=', 'private' ),
1140
						'AND'                     => array(
1141
							'status*inclusive' => array( '=', 'private' ),
1142
							'VNU_wp_user'      => get_current_user_id()
1143
						)
1144
					);
1145
				}
1146
		}
1147
1148
1149

admin_pages/events/Events_Admin_Page.core.php 1 location

@@ 1595-1609 (lines=15) @@
1592
		}
1593
1594
1595
		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1596
			$where['EVT_wp_user'] =  get_current_user_id();
1597
		} else {
1598
			if ( ! isset( $where['status'] ) ) {
1599
				if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events' ) ) {
1600
					$where['OR'] = array(
1601
						'status*restrict_private' => array( '!=', 'private' ),
1602
						'AND' => array(
1603
							'status*inclusive' => array( '=', 'private' ),
1604
							'EVT_wp_user' => get_current_user_id()
1605
						)
1606
					);
1607
				}
1608
			}
1609
		}
1610
1611
		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1612
			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {