From a1dbcb4bb4e8bc8a724ee8bac3f9bcfeec63e830 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Thu, 4 Aug 2016 19:36:03 +0800 Subject: [PATCH] Add download system info file --- addons/system_info.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/addons/system_info.php b/addons/system_info.php index e29cb19f..487050a4 100644 --- a/addons/system_info.php +++ b/addons/system_info.php @@ -17,7 +17,7 @@ class UM_ADDON_system_info { global $ultimatemember; $this->addon = $ultimatemember->addons['system_info']; - add_submenu_page('ultimatemember', "System Info","System Info", 'manage_options', 'system_info', array(&$this, 'content') ); + add_submenu_page('ultimatemember', "System Info","System Info", 'manage_options', 'um_system_info', array(&$this, 'content') ); } @@ -28,8 +28,14 @@ class UM_ADDON_system_info { case 'download_system_info': - // do something - + nocache_headers(); + + header( "Content-type: text/plain" ); + header( 'Content-Disposition: attachment; filename="ultimatemember-system-info.txt"' ); + + echo wp_strip_all_tags( $_POST['um-sysinfo'] ); + exit; + break; default: @@ -74,8 +80,8 @@ class UM_ADDON_system_info { echo $this->content; } else { ?> -
-

- +