Code Duplication    Length = 13-15 lines in 2 locations

admin_pages/venues/Venues_Admin_Page.core.php 1 location

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

admin_pages/events/Events_Admin_Page.core.php 1 location

@@ 1649-1663 (lines=15) @@
1646
		}
1647
1648
1649
		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1650
			$where['EVT_wp_user'] =  get_current_user_id();
1651
		} else {
1652
			if ( ! isset( $where['status'] ) ) {
1653
				if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events' ) ) {
1654
					$where['OR'] = array(
1655
						'status*restrict_private' => array( '!=', 'private' ),
1656
						'AND' => array(
1657
							'status*inclusive' => array( '=', 'private' ),
1658
							'EVT_wp_user' => get_current_user_id()
1659
						)
1660
					);
1661
				}
1662
			}
1663
		}
1664
1665
		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1666
			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {