public function moduleCall($function, $vars = "") { $mod = new WHMCS_Module("registrars"); $module = $this->getModule(); if (!$module) { $this->moduleresults = array("error" => "Domain not assigned to a registrar module"); return false; } $loaded = $mod->load($module); if (!$loaded) { $this->moduleresults = array("error" => "Registrar module not found"); return false; } $params = $this->buildParams($vars); $results = $mod->call($function, $params); if ($results === WHMCS_Module::FUNCTIONDOESNTEXIST) { $this->moduleresults = array("error" => "Function not found"); return false; } $this->moduleresults = $results; return is_array($results) && array_key_exists("error", $results) && $results['error'] ? false : true; }
public function moduleCall($function, $module = "") { $mod = new WHMCS_Module("security"); $module = $module ? $module : $this->getModule(); $loaded = $mod->load($module); if (!$loaded) { return false; } $params = $this->buildParams($module); $result = $mod->call($function, $params); return $result; }
echo $output; echo "</div></div>"; } } else { echo "<div class=\"content\"><div style=\"padding:15px;\">"; echo "<h2>" . $aInt->lang("twofa", "enable") . "</h2>"; if ($twofa->isForced()) { echo "<div class=\"infobox\">" . $aInt->lang("twofa", "enforced") . "</div>"; } echo "<p>" . $aInt->lang("twofa", "activateintro") . "</p>\n<form><input type=\"hidden\" name=\"2fasetup\" value=\"1\" />"; if (1 < count($modules)) { echo "<p>" . $aInt->lang("twofa", "choose") . "</p>"; $mod = new WHMCS_Module("security"); $first = true; foreach ($modules as $module) { $mod->load($module); $configarray = $mod->call("config"); echo " <label><input type=\"radio\" name=\"module\" value=\"" . $module . "\"" . ($first ? " checked" : "") . " /> " . (isset($configarray['FriendlyName']['Value']) ? $configarray['FriendlyName']['Value'] : ucfirst($module)) . "</label><br />"; $first = false; } } else { echo "<input type=\"hidden\" name=\"module\" value=\"" . $modules[0] . "\" />"; } echo "<p align=\"center\"><br /><input type=\"button\" value=\"" . $aInt->lang("twofa", "getstarted") . " »\" onclick=\"dialogSubmit()\" class=\"btn btn-primary\" /></form>"; echo "</div></div>"; } } echo "<script type=\"text/javascript\">\n\$(\"#admindialogcont input:text:visible:first\").focus();\n</script>"; $content = ob_get_contents(); ob_end_clean(); echo $content;
public function moduleCall($function, $vars = "") { $mod = new WHMCS_Module("servers"); $module = $this->getModule(); if (!$module) { $this->moduleresults = array("error" => "Service not assigned to a module"); return false; } $loaded = $mod->load($module); if (!$loaded) { $this->moduleresults = array("error" => "Product module not found"); return false; } $params = $this->buildParams($vars); $results = $mod->call($function, $params); if ($results == false) { $this->moduleresults = array("error" => "Function not found"); return false; } if (is_array($results)) { $results = array("data" => $results); } else { $results = $results == "success" || !$results ? array() : array("error" => $results, "data" => $results); } $this->moduleresults = $results; return isset($results['error']) && $results['error'] ? false : true; }