Code Duplication    Length = 13-15 lines in 2 locations

admin_pages/venues/Venues_Admin_Page.core.php 1 location

@@ 1210-1222 (lines=13) @@
1207
        }
1208
1209
1210
        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_venues', 'get_venues')) {
1211
            $where['VNU_wp_user'] = get_current_user_id();
1212
        } else {
1213
            if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')) {
1214
                $where['OR'] = array(
1215
                    'status*restrict_private' => array('!=', 'private'),
1216
                    'AND'                     => array(
1217
                        'status*inclusive' => array('=', 'private'),
1218
                        'VNU_wp_user'      => get_current_user_id(),
1219
                    ),
1220
                );
1221
            }
1222
        }
1223
1224
1225
        if (isset($this->_req_data['s'])) {

admin_pages/events/Events_Admin_Page.core.php 1 location

@@ 1833-1847 (lines=15) @@
1830
                            ->format(implode(' ', $start_formats));
1831
            $where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1832
        }
1833
        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1834
            $where['EVT_wp_user'] = get_current_user_id();
1835
        } else {
1836
            if (! isset($where['status'])) {
1837
                if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1838
                    $where['OR'] = array(
1839
                        'status*restrict_private' => array('!=', 'private'),
1840
                        'AND'                     => array(
1841
                            'status*inclusive' => array('=', 'private'),
1842
                            'EVT_wp_user'      => get_current_user_id(),
1843
                        ),
1844
                    );
1845
                }
1846
            }
1847
        }
1848
        if (isset($this->_req_data['EVT_wp_user'])) {
1849
            if ($this->_req_data['EVT_wp_user'] != get_current_user_id()
1850
                && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')