Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
             echo "</div></div>";
         } else {
             echo "<div class=\"content\"><div style=\"padding:15px;\">";
             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 " &nbsp;&nbsp;&nbsp;&nbsp; <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") . " &raquo;\" onclick=\"dialogSubmit()\" class=\"btn btn-primary\" /></form>";
         echo "</div></div>";
     }
 }
 echo "<script type=\"text/javascript\">\n\$(\"#admindialogcont input:text:visible:first\").focus();\n</script>";
Example #4
0
}
ob_start();
if ($purchased) {
    $licensing->forceRemoteCheck();
    redir();
}
$twofasettings = $whmcs->get_config("2fasettings");
$twofasettings = unserialize($twofasettings);
echo $frm->form();
echo "<table width=\"100%\"><tr><td width=\"45%\" valign=\"top\">\n\n<div style=\"padding:20px;background-color:#FAF5E4;-moz-border-radius: 10px;-webkit-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px;\">";
echo "\n\n<strong>What is Two-Factor Authentication?</strong><br /><br />\n\nTwo-factor authentication adds an additional layer of security by adding a second step to your login. It takes something you know (ie. your password) and adds a second factor, typically something you have (such as your phone.) Since both are required to log in, even if an attacker has your password they can't access your account.\n\n<div style=\"margin:20px auto;padding:10px;width:370px;background-color:#fff;-moz-border-radius: 10px;-webkit-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px;\"><img src=\"images/twofahow.png\" width=\"350\" height=\"233\" /></div>\n\n<strong>Why do you need it?</strong><br /><br />\n\nPasswords are increasingly easy to compromise. They can often be guessed or leaked, they usually don't change very often, and despite advice otherwise, many of us have favorite passwords that we use for more than one thing. So Two-factor authentication gives you additional security because your password alone no longer allows access to your account.<br /><br />\n\n<strong>How it works?</strong><br /><br />\n\nThere are many different options available, and in WHMCS we support more than one so <i>you</i> have the choice.  But one of the most common and simplest to use is time based one-time passwords.  With these, in addition to your regular username & password, you also have to enter a 6 digit code that changes every 30 seconds.  Only your token device (typically a mobile smartphone) will know your secret key, and be able to generate valid one time passwords for your account.  And so your account is far safer.<br /><br />\n\n<strong>Force Settings</strong><br /><br />\n\n";
echo $frm->checkbox("forceclient", "Force Clients to enable Two Factor Authentication on Next Login", $twofasettings['forceclient']) . "<br />";
echo $frm->checkbox("forceadmin", "Force Administrator Users to enable Two Factor Authentication on Next Login", $twofasettings['forceadmin']) . "<br /><br />";
echo $frm->submit($aInt->lang("global", "savechanges"));
echo "</td><td width=\"55%\" valign=\"top\">";
$mod = new WHMCS_Module();
$moduleslist = $mod->getList("security");
if (!$moduleslist) {
    $aInt->gracefulExit("Security Module Folder Not Found. Please try reuploading all WHMCS related files.");
}
$i = 0;
foreach ($moduleslist as $module) {
    $mod->load($module);
    $configarray = $mod->call("config");
    $moduleconfigdata = $twofasettings['modules'][$module];
    echo "<div style=\"width:90%;margin:" . ($i ? "10px" : "0") . " auto;padding:10px 20px;border:1px solid #ccc;background-color:#fff;-moz-border-radius: 10px;-webkit-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px;\">";
    if ($moduleconfigdata['clientenabled'] || $moduleconfigdata['adminenabled']) {
        echo "<p style=\"float:right;\"><input type=\"button\" value=\"Deactivate\" class=\"btn-danger\" onclick=\"deactivate('" . $module . "')\" /></p>";
        $showstyle = "";
    } else {
        if (array_key_exists("Licensed", $configarray)) {
Example #5
0
 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;
 }