Skip to content

Commit b938cd5

Browse files
committed
updates migrating off global tf handler to the MyAdminApp class handler
1 parent a569a95 commit b938cd5

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Plugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function getActivate(GenericEvent $event)
7676
$password = website_get_password($serviceClass->getId(), $serviceClass->getCustid());
7777
if (!$password) {
7878
$password = generateRandomString(10, 2, 2, 2, 1);
79-
$GLOBALS['tf']->history->add($settings['PREFIX'], 'password', $serviceClass->getId(), $password);
79+
\MyAdmin\App::history()->add($settings['PREFIX'], 'password', $serviceClass->getId(), $password);
8080
}
8181
$username = get_new_webhosting_username($serviceClass->getId(), $hostname, $serviceClass->getServer());
8282
if (in_array('reseller', explode(',', $event['field1']))) {
@@ -165,7 +165,7 @@ public static function getActivate(GenericEvent $event)
165165
if ($result['error'] != "0") {
166166
}
167167
}
168-
$GLOBALS['tf']->history->add($settings['PREFIX'], 'password', $serviceClass->getId(), $options['password']);
168+
\MyAdmin\App::history()->add($settings['PREFIX'], 'password', $serviceClass->getId(), $options['password']);
169169
}
170170
if (isset($result['result']) && $result['result'][0]['statusmsg'] == 'Sorry, a group for that username already exists.') {
171171
while ($result['result'][0]['statusmsg'] == 'Sorry, a group for that username already exists.') {
@@ -363,7 +363,7 @@ public static function getChangeIp(GenericEvent $event)
363363
$event['status'] = 'error';
364364
$event['status_text'] = 'Error Code '.$result['faultcode'].': '.$result['fault'];
365365
} else {
366-
$GLOBALS['tf']->history->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->getId(), $serviceClass->getCustid());
366+
\MyAdmin\App::history()->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->getId(), $serviceClass->getCustid());
367367
$serviceClass->set_ip($event['newip'])->save();
368368
$event['status'] = 'ok';
369369
$event['status_text'] = 'The IP Address has been changed.';

src/api_auto_directadmin_login.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function api_auto_directadmin_login($id)
2020
{
2121
$return = ['status' => 'error', 'status_text' => ''];
2222
$module = 'webhosting';
23-
$custid = get_custid($GLOBALS['tf']->session->account_id, 'vps');
23+
$custid = get_custid(\MyAdmin\App::session()->account_id, 'vps');
2424
$settings = get_module_settings($module);
2525
$db = get_module_db($module);
2626
$id = (int)$id;
@@ -61,7 +61,7 @@ function api_auto_directadmin_login($id)
6161
'clear_key' => 'no',
6262
'allow_html' => 'yes',
6363
'passwd' => $serviceMaster[$settings['PREFIX'].'_key'],
64-
'ips' => $GLOBALS['tf']->session::get_client_ip(),
64+
'ips' => \MyAdmin\App::session()::get_client_ip(),
6565
];
6666
*/
6767
$apiOptions = [
@@ -72,7 +72,7 @@ function api_auto_directadmin_login($id)
7272
'clear_key' => 'yes',
7373
'allow_html' => 'yes',
7474
'passwd' => $serviceMaster[$settings['PREFIX'].'_key'],
75-
//'ips' => $GLOBALS['tf']->session::get_client_ip(),
75+
//'ips' => \MyAdmin\App::session()::get_client_ip(),
7676
'login_keys_notify_on_creation' => 0,
7777
//'redirect-url' => '/user/email/accounts',
7878
];

0 commit comments

Comments
 (0)