public function ajax() { check_ajax_referer(WPACCESS_PREFIX . 'ajax'); $cap = mvb_Model_API::isSuperAdmin() ? 'administrator' : 'aam_manage'; if (current_user_can($cap)) { $m = new mvb_Model_Ajax($this); $m->process(); } else { die(json_encode(array('status' => 'error', 'result' => 'error'))); } }
public function ajax() { check_ajax_referer(WPACCESS_PREFIX . 'ajax'); if (mvb_Model_API::getBlogOption(WPACCESS_PREFIX . 'first_time', FALSE) !== FALSE) { $cap = mvb_Model_API::isSuperAdmin() ? WPACCESS_ADMIN_ROLE : 'aam_manage'; } else { $cap = WPACCESS_ADMIN_ROLE; } if (current_user_can($cap)) { $m = new mvb_Model_Ajax($this); $m->process(); } else { die(json_encode(array('status' => 'error', 'result' => 'error'))); } }