Ejemplo n.º 1
0
 function inject()
 {
     $options = red_get_options();
     if (isset($_POST['id']) && !isset($_POST['action'])) {
         wp_safe_redirect(add_query_arg('id', intval($_POST['id']), $_SERVER['REQUEST_URI']));
         die;
     }
     if (isset($_GET['token']) && isset($_GET['page']) && isset($_GET['sub']) && $_GET['token'] == $options['token'] && $_GET['page'] == 'redirection.php') {
         $exporter = Red_FileIO::create($_GET['sub']);
         if ($exporter) {
             $items = Red_Item::get_all_for_module(intval($_GET['module']));
             $exporter->export($items);
             die;
         }
     } elseif (isset($_POST['export-csv']) && check_admin_referer('redirection-log_management')) {
         if (isset($_GET['sub']) && $_GET['sub'] == 'log') {
             RE_Log::export_to_csv();
         } else {
             RE_404::export_to_csv();
         }
         die;
     }
 }
Ejemplo n.º 2
0
 function inject()
 {
     $options = $this->get_options();
     if (isset($_GET['token']) && isset($_GET['page']) && isset($_GET['sub']) && $_GET['token'] == $options['token'] && $_GET['page'] == 'redirection.php') {
         include dirname(__FILE__) . '/models/file_io.php';
         $exporter = Red_FileIO::create($_GET['sub']);
         if ($exporter) {
             $items = Red_Item::get_all_for_module(intval($_GET['module']));
             $exporter->export($items);
             die;
         }
     } elseif (isset($_POST['export-csv']) && check_admin_referer('redirection-log_management')) {
         if (isset($_GET['sub']) && $_GET['sub'] == 'log') {
             RE_Log::export_to_csv();
         } else {
             RE_404::export_to_csv();
         }
         die;
     }
 }