@@ -23,7 +23,7 @@ function_requirements('class.ImapAbuseCheck');
2323 $ maxmailed = 5 ;
2424 $ limit = 'limit 20 ' ;
2525 function_requirements ('has_acl ' );
26- if ($ GLOBALS [ ' tf ' ]-> ima != 'admin ' || !has_acl ('client_billing ' )) {
26+ if (\ MyAdmin \App:: ima () != 'admin ' || !has_acl ('client_billing ' )) {
2727 myadmin_log ('myadmin ' , 'debug ' , 'Not Admin ' , __LINE__ , __FILE__ );
2828 dialog ('Not admin ' , 'Not Admin or you lack the permissions to view this page. ' );
2929 return false ;
@@ -40,9 +40,9 @@ function_requirements('has_acl');
4040 $ table2 ->hide_title ();
4141 $ table2 ->hide_table ();
4242 $ table2 ->hide_form ();
43- if (isset ($ GLOBALS [ ' tf ' ]-> variables ->request ['lid ' ])) {
44- $ lid = $ db ->real_escape ($ GLOBALS [ ' tf ' ]-> variables ->request ['lid ' ]);
45- $ lid_data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ GLOBALS [ ' tf ' ]-> accounts ->cross_reference ($ lid ));
43+ if (isset (\ MyAdmin \App:: variables () ->request ['lid ' ])) {
44+ $ lid = $ db ->real_escape (\ MyAdmin \App:: variables () ->request ['lid ' ]);
45+ $ lid_data = \ MyAdmin \App:: accounts () ->read (\ MyAdmin \App:: accounts () ->cross_reference ($ lid ));
4646 $ table = new \TFTable ();
4747 $ table ->set_col_options ('style="vertical-align: middle; padding-top: 1px; padding-right: 3px;" ' );
4848 if (isset ($ lid_data ['picture ' ]) && null !== $ lid_data ['picture ' ] && $ lid_data ['picture ' ] != '' ) {
@@ -94,8 +94,8 @@ function_requirements('has_acl');
9494 function_requirements ('crud_abuse ' );
9595 crud_abuse ();
9696 }
97- if (isset ($ GLOBALS [ ' tf ' ]-> variables ->request ['headers ' ]) && verify_csrf ('abuse_admin ' )) {
98- $ ip = $ GLOBALS [ ' tf ' ]-> variables ->request ['ip ' ];
97+ if (isset (\ MyAdmin \App:: variables () ->request ['headers ' ]) && verify_csrf ('abuse_admin ' )) {
98+ $ ip = \ MyAdmin \App:: variables () ->request ['ip ' ];
9999 if (validIp ($ ip , false )) {
100100 $ server_data = get_server_from_ip ($ ip );
101101 if (isset ($ server_data ['email ' ]) && $ server_data ['email ' ] != '' ) {
@@ -104,20 +104,20 @@ function_requirements('crud_abuse');
104104 'abuse_id ' => null ,
105105 'abuse_time ' => mysql_now (),
106106 'abuse_ip ' => $ ip ,
107- 'abuse_type ' => $ GLOBALS [ ' tf ' ]-> variables ->request ['type ' ],
108- 'abuse_amount ' => $ GLOBALS [ ' tf ' ]-> variables ->request ['amount ' ],
107+ 'abuse_type ' => \ MyAdmin \App:: variables () ->request ['type ' ],
108+ 'abuse_amount ' => \ MyAdmin \App:: variables () ->request ['amount ' ],
109109 'abuse_lid ' => $ email ,
110110 'abuse_status ' => 'pending '
111111 ]), __LINE__ , __FILE__ );
112112 $ id = $ db ->getLastInsertId ('abuse ' , 'abuse_id ' );
113113 $ db ->query (make_insert_query ('abuse_data ' , [
114114 'abuse_id ' => $ id ,
115- 'abuse_headers ' => ImapAbuseCheck::fix_headers ($ GLOBALS [ ' tf ' ]-> variables ->request ['headers ' ]),
115+ 'abuse_headers ' => ImapAbuseCheck::fix_headers (\ MyAdmin \App:: variables () ->request ['headers ' ]),
116116 ]), __LINE__ , __FILE__ );
117117 $ subject = 'InterServer Abuse Report for ' .$ ip ;
118118 $ message = str_replace (
119119 ['{$email} ' , '{$ip} ' , '{$type} ' , '{$count} ' , '{$id} ' , '{$key} ' ],
120- [$ server_data ['email_abuse ' ], $ ip , $ GLOBALS [ ' tf ' ]-> variables ->request ['type ' ], $ GLOBALS [ ' tf ' ]-> variables ->request ['amount ' ], $ id , md5 ($ id . $ ip . $ GLOBALS [ ' tf ' ]-> variables ->request ['type ' ])],
120+ [$ server_data ['email_abuse ' ], $ ip , \ MyAdmin \App:: variables () ->request ['type ' ], \ MyAdmin \App:: variables () ->request ['amount ' ], $ id , md5 ($ id . $ ip . \ MyAdmin \App:: variables () ->request ['type ' ])],
121121 $ email_template
122122 );
123123 (new \MyAdmin \Mail ())->clientMail ($ subject , $ message , $ server_data ['email_abuse ' ], 'client/abuse.tpl ' );
@@ -133,8 +133,8 @@ function_requirements('crud_abuse');
133133 }
134134 }
135135 }
136- if (isset ($ GLOBALS [ ' tf ' ]-> variables ->request ['evidence ' ]) && verify_csrf ('abuse_admin_multiple ' )) {
137- $ ips = explode ("\n" , trim ($ GLOBALS [ ' tf ' ]-> variables ->request ['ips ' ]));
136+ if (isset (\ MyAdmin \App:: variables () ->request ['evidence ' ]) && verify_csrf ('abuse_admin_multiple ' )) {
137+ $ ips = explode ("\n" , trim (\ MyAdmin \App:: variables () ->request ['ips ' ]));
138138 foreach ($ ips as $ ip ) {
139139 $ ip = trim ($ ip );
140140 if (validIp ($ ip , false )) {
@@ -145,20 +145,20 @@ function_requirements('crud_abuse');
145145 'abuse_id ' => null ,
146146 'abuse_time ' => mysql_now (),
147147 'abuse_ip ' => $ ip ,
148- 'abuse_type ' => $ GLOBALS [ ' tf ' ]-> variables ->request ['type ' ],
148+ 'abuse_type ' => \ MyAdmin \App:: variables () ->request ['type ' ],
149149 'abuse_amount ' => 1 ,
150150 'abuse_lid ' => $ email ,
151151 'abuse_status ' => 'pending '
152152 ]), __LINE__ , __FILE__ );
153153 $ id = $ db ->getLastInsertId ('abuse ' , 'abuse_id ' );
154154 $ db ->query (make_insert_query ('abuse_data ' , [
155155 'abuse_id ' => $ id ,
156- 'abuse_headers ' => ImapAbuseCheck::fix_headers ($ GLOBALS [ ' tf ' ]-> variables ->request ['headers ' ]),
156+ 'abuse_headers ' => ImapAbuseCheck::fix_headers (\ MyAdmin \App:: variables () ->request ['headers ' ]),
157157 ]), __LINE__ , __FILE__ );
158158 $ subject = 'InterServer Abuse Report for ' .$ ip ;
159159 $ message = str_replace (
160160 ['{$email} ' , '{$ip} ' , '{$type} ' , '{$count} ' , '{$id} ' , '{$key} ' ],
161- [$ server_data ['email_abuse ' ], $ ip , $ GLOBALS [ ' tf ' ]-> variables ->request ['type ' ], 1 , $ id , md5 ($ id . $ ip . $ GLOBALS [ ' tf ' ]-> variables ->request ['type ' ])],
161+ [$ server_data ['email_abuse ' ], $ ip , \ MyAdmin \App:: variables () ->request ['type ' ], 1 , $ id , md5 ($ id . $ ip . \ MyAdmin \App:: variables () ->request ['type ' ])],
162162 $ email_template
163163 );
164164 (new \MyAdmin \Mail ())->clientMail ($ subject , $ message , $ server_data ['email_abuse ' ], 'client/abuse.tpl ' );
@@ -187,8 +187,8 @@ function_requirements('crud_abuse');
187187 $ parts = explode (', ' , $ lines [$ x ]);
188188 $ ip = $ parts [0 ];
189189 $ date = new \DateTime (is_numeric ($ parts [1 ]) && mb_strlen ($ parts [1 ]) == 10 ? date (MYSQL_DATE_FORMAT , $ parts [1 ]) : $ parts [1 ]);
190- if (isset ($ GLOBALS [ ' tf ' ]-> variables ->request ['dates ' ]) && $ GLOBALS [ ' tf ' ]-> variables ->request ['dates ' ] != 'all ' && is_numeric ($ GLOBALS [ ' tf ' ]-> variables ->request ['dates ' ])) {
191- $ limit_date = new \DateTime (date (MYSQL_DATE_FORMAT , time () - $ GLOBALS [ ' tf ' ]-> variables ->request ['dates ' ]));
190+ if (isset (\ MyAdmin \App:: variables () ->request ['dates ' ]) && \ MyAdmin \App:: variables () ->request ['dates ' ] != 'all ' && is_numeric (\ MyAdmin \App:: variables () ->request ['dates ' ])) {
191+ $ limit_date = new \DateTime (date (MYSQL_DATE_FORMAT , time () - \ MyAdmin \App:: variables () ->request ['dates ' ]));
192192 if ($ date < $ limit_date ) {
193193 continue ;
194194 }
@@ -232,9 +232,9 @@ function_requirements('crud_abuse');
232232 add_output ('<pre style="text-align: left;">$_FILES = ' .var_export ($ _FILES , true ).';</pre> ' );
233233 }
234234 }
235- if (isset ($ GLOBALS [ ' tf ' ]-> variables ->request ['csvtext ' ]) && $ GLOBALS [ ' tf ' ]-> variables ->request ['csvtext ' ] != '' && verify_csrf ('abuse_admin_uce ' )) {
235+ if (isset (\ MyAdmin \App:: variables () ->request ['csvtext ' ]) && \ MyAdmin \App:: variables () ->request ['csvtext ' ] != '' && verify_csrf ('abuse_admin_uce ' )) {
236236 add_output ('Importing CSV Text<br> ' );
237- $ lines = explode ("\n" , $ GLOBALS [ ' tf ' ]-> variables ->request ['csvtext ' ]);
237+ $ lines = explode ("\n" , \ MyAdmin \App:: variables () ->request ['csvtext ' ]);
238238 for ($ x = 0 , $ x_max = count ($ lines ); $ x < $ x_max ; $ x ++) {
239239 if (mb_strpos ($ lines [$ x ], ', ' ) !== false && is_numeric (mb_substr ($ lines [$ x ], 0 , 1 ))) {
240240 $ parts = explode (', ' , $ lines [$ x ]);
@@ -277,9 +277,9 @@ function_requirements('crud_abuse');
277277 }
278278 // display the current abuse entries
279279 //uceprotect links to - http://www.uceprotect.net/en/rblcheck.php?ipr=$ip
280- if (isset ($ GLOBALS [ ' tf ' ]-> variables ->request ['tmcsvtext ' ]) && $ GLOBALS [ ' tf ' ]-> variables ->request ['tmcsvtext ' ] != '' && verify_csrf ('abuse_admin_trend ' )) {
280+ if (isset (\ MyAdmin \App:: variables () ->request ['tmcsvtext ' ]) && \ MyAdmin \App:: variables () ->request ['tmcsvtext ' ] != '' && verify_csrf ('abuse_admin_trend ' )) {
281281 add_output ('Importing TrendMicro CSV Text<br> ' );
282- $ lines = explode ("\n" , $ GLOBALS [ ' tf ' ]-> variables ->request ['tmcsvtext ' ]);
282+ $ lines = explode ("\n" , \ MyAdmin \App:: variables () ->request ['tmcsvtext ' ]);
283283 for ($ x = 0 , $ x_max = count ($ lines ); $ x < $ x_max ; $ x ++) {
284284 if (is_numeric (mb_substr ($ lines [$ x ], 0 , 1 ))) {
285285 $ ip = $ lines [$ x ];
@@ -299,7 +299,7 @@ function_requirements('crud_abuse');
299299 $ id = $ db ->getLastInsertId ('abuse ' , 'abuse_id ' );
300300 $ db ->query (make_insert_query ('abuse_data ' , [
301301 'abuse_id ' => $ id ,
302- 'abuse_headers ' => ImapAbuseCheck::fix_headers ($ GLOBALS [ ' tf ' ]-> variables ->request ['headers ' ]),
302+ 'abuse_headers ' => ImapAbuseCheck::fix_headers (\ MyAdmin \App:: variables () ->request ['headers ' ]),
303303 ]), __LINE__ , __FILE__ );
304304 $ subject = 'InterServer Abuse Report for ' .$ ip ;
305305 $ message = str_replace (
0 commit comments