Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
fix(cleanup): deprecated LoadRegistrars class usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed May 19, 2021
1 parent 60e9170 commit bc4a455
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/addons/ispapidomainimport/ispapidomainimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use WHMCS\Module\Addon\IspapiDomainImport\Admin\AdminDispatcher;
use WHMCS\Module\Registrar\Ispapi\Ispapi;
use WHMCS\Module\Registrar\Ispapi\LoadRegistrars;

/**
* Define addon module configuration parameters.
Expand Down Expand Up @@ -57,14 +56,14 @@ function ispapidomainimport_config()
*/
function ispapidomainimport_output($vars)
{
//load all the ISPAPI registrars
$registrars = (new LoadRegistrars())->getLoadedRegistars();
$smarty = new Smarty();
$smarty->escape_html = true;
$smarty->caching = false;
$smarty->setCompileDir($GLOBALS['templates_compiledir']);
$smarty->setTemplateDir(implode(DIRECTORY_SEPARATOR, array(ROOTDIR, "modules", "addons", "ispapidomainimport", "templates", "admin")));
if (empty($registrars)) {
// check if the ispapi module can be loaded and is active
$registrar = new \WHMCS\Module\Registrar();
if (!$registrar->load("ispapi") || !$registrar->isActivated()) {
$smarty->assign("error", $vars["_lang"]["registrarerror"]);
$smarty->display('error.tpl');
return;
Expand All @@ -76,7 +75,7 @@ function ispapidomainimport_output($vars)
$smarty->assign($aInt->templatevars);

$smarty->assign($vars);
$smarty->assign('registrar', $registrars[0]);
$smarty->assign('registrar', 'ispapi');
//call the dispatcher with action and data
$dispatcher = new AdminDispatcher();
echo $dispatcher->dispatch($_REQUEST['action'], $vars, $smarty);
Expand Down

0 comments on commit bc4a455

Please sign in to comment.