Skip to content

Commit 641e043

Browse files
committed
updates migrating off global tf handler to the MyAdminApp class handler
1 parent 8406d06 commit 641e043

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

bin/create_customer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function_requirements('get_webhosting_plesk_instance');
1515
$plesk = get_webhosting_plesk_instance(($_SERVER['argv'][1] ?? false));
1616

1717
try {
18-
$data = $GLOBALS['tf']->accounts->read(2773);
18+
$data = \MyAdmin\App::accounts()->read(2773);
1919
$password = _randomstring(10);
2020
$username = 'joeapitest';
2121
echo "Calling createCustomer($username, $password)\n";

src/Plugin.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ public static function getActivate(GenericEvent $event)
6464
$password = website_get_password($serviceClass->getId(), $serviceClass->getCustid());
6565
if ($password == false) {
6666
$password = generateRandomString(10, 2, 2, 2, 1);
67-
$GLOBALS['tf']->history->add($settings['PREFIX'], 'password', $serviceClass->getId(), $password);
67+
\MyAdmin\App::history()->add($settings['PREFIX'], 'password', $serviceClass->getId(), $password);
6868
}
6969

7070
$username = get_new_webhosting_username($serviceClass->getId(), $hostname, $serviceClass->getServer());
71-
$data = $GLOBALS['tf']->accounts->read($serviceClass->getCustid());
71+
$data = \MyAdmin\App::accounts()->read($serviceClass->getCustid());
7272
$debugCalls = false;
7373
if (!is_array($extra)) {
7474
$extra = [];
@@ -178,7 +178,7 @@ function_requirements('get_webhosting_plesk_instance');
178178
}
179179
}
180180
if ($passwordUpdated == true) {
181-
$GLOBALS['tf']->history->add($settings['PREFIX'], 'password', $serviceClass->getId(), $request['password']);
181+
\MyAdmin\App::history()->add($settings['PREFIX'], 'password', $serviceClass->getId(), $request['password']);
182182
}
183183
}
184184
request_log(self::$module, $serviceClass->getCustid(), __FUNCTION__, 'plesk', 'createClient', $request, $result, $serviceClass->getId());
@@ -400,7 +400,7 @@ public static function getChangeIp(GenericEvent $event)
400400
$event['status'] = 'error';
401401
$event['status_text'] = 'Error Code '.$result['faultcode'].': '.$result['fault'];
402402
} else {
403-
$GLOBALS['tf']->history->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->getId(), $serviceClass->getCustid());
403+
\MyAdmin\App::history()->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->getId(), $serviceClass->getCustid());
404404
$serviceClass->set_ip($event['newip'])->save();
405405
$event['status'] = 'ok';
406406
$event['status_text'] = 'The IP Address has been changed.';
@@ -415,7 +415,7 @@ public static function getChangeIp(GenericEvent $event)
415415
public static function getMenu(GenericEvent $event)
416416
{
417417
$menu = $event->getSubject();
418-
if ($GLOBALS['tf']->ima == 'admin') {
418+
if (\MyAdmin\App::ima() == 'admin') {
419419
$menu->add_link(self::$module, 'choice=none.reusable_plesk', '/images/myadmin/to-do.png', _('ReUsable Plesk Licenses'));
420420
$menu->add_link(self::$module, 'choice=none.plesk_list', '/images/myadmin/to-do.png', _('Plesk Licenses Breakdown'));
421421
$menu->add_link(self::$module.'api', 'choice=none.plesk_licenses_list', '/images/whm/createacct.gif', _('List all Plesk Licenses'));

0 commit comments

Comments
 (0)