Skip to content

Commit d1e5f53

Browse files
committed
updates migrating off global tf handler to the MyAdminApp class handler
1 parent 03d0ae4 commit d1e5f53

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Plugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function_requirements('whm_api');
159159
myadmin_log(self::$module, 'info', 'Response: '.str_replace('\n', "\n", $response), __LINE__, __FILE__, self::$module, $serviceClass->getId());
160160
$response = json_decode($response, true);
161161
}
162-
$GLOBALS['tf']->history->add($settings['PREFIX'], 'password', $serviceClass->getId(), $options['password']);
162+
\MyAdmin\App::history()->add($settings['PREFIX'], 'password', $serviceClass->getId(), $options['password']);
163163
}
164164
if ($response['result'][0]['statusmsg'] == 'Sorry, a group for that username already exists.') {
165165
while ($response['result'][0]['statusmsg'] == 'Sorry, a group for that username already exists.') {
@@ -332,7 +332,7 @@ function_requirements('whm_api');
332332
if (isset($extra['script']) && $extra['script'] > 0) {
333333
$script = (int) $extra['script'];
334334
include_once __DIR__.'/../../../../include/webhosting/softaculous/sdk.php';
335-
$userdata = $GLOBALS['tf']->accounts->read($serviceClass->getCustid());
335+
$userdata = \MyAdmin\App::accounts()->read($serviceClass->getCustid());
336336
$soft = new \Softaculous_SDK();
337337
$soft->login = "https://{$username}:{$password}@{$serverdata[$settings['PREFIX'].'_name']}:2083/frontend/jupiter/softaculous/index.live.php";
338338
$soft->list_scripts();
@@ -553,7 +553,7 @@ public static function getChangeIp(GenericEvent $event)
553553
$event['status'] = 'error';
554554
$event['status_text'] = 'Error Code '.$response['faultcode'].': '.$response['fault'];
555555
} else {
556-
$GLOBALS['tf']->history->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->getId(), $serviceClass->getCustid());
556+
\MyAdmin\App::history()->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->getId(), $serviceClass->getCustid());
557557
$serviceClass->set_ip($event['newip'])->save();
558558
$event['status'] = 'ok';
559559
$event['status_text'] = 'The IP Address has been changed.';
@@ -568,7 +568,7 @@ public static function getChangeIp(GenericEvent $event)
568568
public static function getMenu(GenericEvent $event)
569569
{
570570
$menu = $event->getSubject();
571-
if ($GLOBALS['tf']->ima == 'admin') {
571+
if (\MyAdmin\App::ima() == 'admin') {
572572
function_requirements('has_acl');
573573
if (has_acl('module_config')) {
574574
$menu->add_menu(self::$module, self::$module.'api', 'API', '/images/myadmin/api.png');

src/api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function api_auto_cpanel_login($id)
1818
{
1919
$return = ['status' => 'error', 'status_text' => ''];
2020
$module = 'webhosting';
21-
$custid = get_custid($GLOBALS['tf']->session->account_id, 'vps');
21+
$custid = get_custid(\MyAdmin\App::session()->account_id, 'vps');
2222
$settings = get_module_settings($module);
2323
$db = get_module_db($module);
2424
$id = (int)$id;

0 commit comments

Comments
 (0)