@@ -46,13 +46,13 @@ function api_cancel_license_ip($sid, $ip, $service_type)
4646 $ return = [];
4747 $ return ['status ' ] = '' ;
4848 $ return ['status_text ' ] = '' ;
49- $ GLOBALS [ ' tf ' ]-> session ->sessionid = $ sid ;
50- if ($ GLOBALS [ ' tf ' ]-> session ->verify ()) {
49+ \ MyAdmin \App:: session () ->sessionid = $ sid ;
50+ if (\ MyAdmin \App:: session () ->verify ()) {
5151 // Read there account data
52- $ custid = get_custid ($ GLOBALS [ ' tf ' ]-> session ->account_id , $ module );
53- $ GLOBALS [ ' tf ' ]-> accounts ->data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
54- $ GLOBALS [ ' tf ' ] ->ima = $ GLOBALS [ ' tf ' ]-> session ->appsession ('ima ' );
55- $ GLOBALS [ ' tf ' ]-> session ->update_dla ();
52+ $ custid = get_custid (\ MyAdmin \App:: session () ->account_id , $ module );
53+ \ MyAdmin \App:: accounts () ->data = \ MyAdmin \App:: accounts () ->read ($ custid );
54+ \ MyAdmin \App:: tf () ->ima = \ MyAdmin \App:: session () ->appsession ('ima ' );
55+ \ MyAdmin \App:: session () ->update_dla ();
5656 } else {
5757 $ return ['status ' ] = 'error ' ;
5858 $ return ['status_text ' ] = 'Invalid Session ID ' ;
@@ -114,13 +114,13 @@ function api_cancel_license($sid, $id)
114114 $ return = [];
115115 $ return ['status ' ] = '' ;
116116 $ return ['status_text ' ] = '' ;
117- $ GLOBALS [ ' tf ' ]-> session ->sessionid = $ sid ;
118- if ($ GLOBALS [ ' tf ' ]-> session ->verify ()) {
117+ \ MyAdmin \App:: session () ->sessionid = $ sid ;
118+ if (\ MyAdmin \App:: session () ->verify ()) {
119119 // Read there account data
120- $ custid = get_custid ($ GLOBALS [ ' tf ' ]-> session ->account_id , $ module );
121- $ GLOBALS [ ' tf ' ]-> accounts ->data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
122- $ GLOBALS [ ' tf ' ] ->ima = $ GLOBALS [ ' tf ' ]-> session ->appsession ('ima ' );
123- $ GLOBALS [ ' tf ' ]-> session ->update_dla ();
120+ $ custid = get_custid (\ MyAdmin \App:: session () ->account_id , $ module );
121+ \ MyAdmin \App:: accounts () ->data = \ MyAdmin \App:: accounts () ->read ($ custid );
122+ \ MyAdmin \App:: tf () ->ima = \ MyAdmin \App:: session () ->appsession ('ima ' );
123+ \ MyAdmin \App:: session () ->update_dla ();
124124 } else {
125125 $ return ['status ' ] = 'error ' ;
126126 $ return ['status_text ' ] = 'Invalid Session ID ' ;
@@ -202,20 +202,20 @@ function api_buy_license($sid, $ip, $service_type, $coupon = '', $use_prepay = n
202202 5002 => 5009 ,
203203 10683 => 10682
204204 ];
205- $ GLOBALS [ ' tf ' ]-> session ->sessionid = $ sid ;
206- if ($ GLOBALS [ ' tf ' ]-> session ->verify ()) {
205+ \ MyAdmin \App:: session () ->sessionid = $ sid ;
206+ if (\ MyAdmin \App:: session () ->verify ()) {
207207 // Read there account data
208- $ custid = convert_custid ($ GLOBALS [ ' tf ' ]-> session ->account_id , $ module );
209- $ GLOBALS [ ' tf ' ]-> accounts ->data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
210- $ GLOBALS [ ' tf ' ] ->ima = $ GLOBALS [ ' tf ' ]-> session ->appsession ('ima ' );
211- $ GLOBALS [ ' tf ' ]-> session ->update_dla ();
208+ $ custid = convert_custid (\ MyAdmin \App:: session () ->account_id , $ module );
209+ \ MyAdmin \App:: accounts () ->data = \ MyAdmin \App:: accounts () ->read ($ custid );
210+ \ MyAdmin \App:: tf () ->ima = \ MyAdmin \App:: session () ->appsession ('ima ' );
211+ \ MyAdmin \App:: session () ->update_dla ();
212212 } else {
213213 $ return ['status ' ] = 'error ' ;
214214 $ return ['status_text ' ] = 'Invalid Session ID ' ;
215215 return $ return ;
216216 }
217217 update_session_log (__FUNCTION__ );
218- $ data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
218+ $ data = \ MyAdmin \App:: accounts () ->read ($ custid );
219219 $ continue = true ;
220220 $ ip_owner = get_ip_owner ($ ip );
221221 if (!validIp ($ ip , false )) {
@@ -266,7 +266,7 @@ function api_buy_license($sid, $ip, $service_type, $coupon = '', $use_prepay = n
266266 $ service_cost = $ coupon_info ['amount ' ];
267267 break ;
268268 }
269- $ GLOBALS [ ' tf ' ]-> history ->add ('apply_coupon ' , $ ip , $ service_cost , $ tcost , $ custid );
269+ \ MyAdmin \App:: history () ->add ('apply_coupon ' , $ ip , $ service_cost , $ tcost , $ custid );
270270 }
271271 }
272272 if ($ use_prepay == true ) {
@@ -405,16 +405,16 @@ function_requirements('get_paypal_link');
405405 */
406406function api_change_license_ip ($ sid , $ oldip , $ newip )
407407{
408- $ GLOBALS [ ' tf ' ]-> session ->sessionid = $ sid ;
408+ \ MyAdmin \App:: session () ->sessionid = $ sid ;
409409 $ module = 'licenses ' ;
410410 $ settings = get_module_settings ($ module );
411411 $ db = get_module_db ($ module );
412412 $ oldip = $ db ->real_escape ($ oldip );
413- if ($ GLOBALS [ ' tf ' ]-> session ->verify ()) {
414- $ custid = $ GLOBALS [ ' tf ' ]-> session ->account_id ;
415- $ GLOBALS [ ' tf ' ]-> accounts ->data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
416- $ GLOBALS [ ' tf ' ] ->ima = $ GLOBALS [ ' tf ' ]-> session ->appsession ('ima ' );
417- $ GLOBALS [ ' tf ' ]-> session ->update_dla ();
413+ if (\ MyAdmin \App:: session () ->verify ()) {
414+ $ custid = \ MyAdmin \App:: session () ->account_id ;
415+ \ MyAdmin \App:: accounts () ->data = \ MyAdmin \App:: accounts () ->read ($ custid );
416+ \ MyAdmin \App:: tf () ->ima = \ MyAdmin \App:: session () ->appsession ('ima ' );
417+ \ MyAdmin \App:: session () ->update_dla ();
418418 if (!check_auth_limits (false )) {
419419 myadmin_log ('api ' , 'info ' , 'This account is currently locked or does not meet the requirements to login. ' , __LINE__ , __FILE__ );
420420 return false ;
@@ -425,7 +425,7 @@ function api_change_license_ip($sid, $oldip, $newip)
425425 return $ return ;
426426 }
427427 update_session_log (__FUNCTION__ );
428- $ data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
428+ $ data = \ MyAdmin \App:: accounts () ->read ($ custid );
429429 if ($ data ['status ' ] == 'locked ' ) {
430430 $ return ['status ' ] = 'error ' ;
431431 $ return ['status_text ' ] .= "Locked Account. \n" ;
@@ -463,15 +463,15 @@ function api_change_license_ip($sid, $oldip, $newip)
463463function api_change_license_ip_by_id ($ sid , $ id , $ newip )
464464{
465465 $ id = (int )$ id ;
466- $ GLOBALS [ ' tf ' ]-> session ->sessionid = $ sid ;
466+ \ MyAdmin \App:: session () ->sessionid = $ sid ;
467467 $ module = 'licenses ' ;
468468 $ settings = get_module_settings ($ module );
469469 $ db = get_module_db ($ module );
470- if ($ GLOBALS [ ' tf ' ]-> session ->verify ()) {
471- $ custid = $ GLOBALS [ ' tf ' ]-> session ->account_id ;
472- $ GLOBALS [ ' tf ' ]-> accounts ->data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
473- $ GLOBALS [ ' tf ' ] ->ima = $ GLOBALS [ ' tf ' ]-> session ->appsession ('ima ' );
474- $ GLOBALS [ ' tf ' ]-> session ->update_dla ();
470+ if (\ MyAdmin \App:: session () ->verify ()) {
471+ $ custid = \ MyAdmin \App:: session () ->account_id ;
472+ \ MyAdmin \App:: accounts () ->data = \ MyAdmin \App:: accounts () ->read ($ custid );
473+ \ MyAdmin \App:: tf () ->ima = \ MyAdmin \App:: session () ->appsession ('ima ' );
474+ \ MyAdmin \App:: session () ->update_dla ();
475475 if (!check_auth_limits (false )) {
476476 myadmin_log ('api ' , 'info ' , 'This account is currently locked or does not meet the requirements to login. ' , __LINE__ , __FILE__ , $ module );
477477 return false ;
@@ -482,7 +482,7 @@ function api_change_license_ip_by_id($sid, $id, $newip)
482482 return $ return ;
483483 }
484484 update_session_log (__FUNCTION__ );
485- $ data = $ GLOBALS [ ' tf ' ]-> accounts ->read ($ custid );
485+ $ data = \ MyAdmin \App:: accounts () ->read ($ custid );
486486 if ($ data ['status ' ] == 'locked ' ) {
487487 $ return ['status ' ] = 'error ' ;
488488 $ return ['status_text ' ] .= "Locked Account. \n" ;
0 commit comments