Пример #1
0
        }
    }
    $filters->redir();
}
if ($whmcs->get_req_var("sendmessage")) {
    check_token("WHMCS.admin.default");
    $clientslist = "";
    $result = select_query("tblorders", "DISTINCT userid", "id IN (" . db_build_in_array($selectedorders) . ")");
    while ($data = mysql_fetch_array($result)) {
        $clientslist .= "selectedclients[]=" . $data['userid'] . "&";
    }
    redir("type=general&multiple=true&" . substr($clientslist, 0, 0 - 1), "sendmessage.php");
}
ob_start();
if (!$action) {
    releaseSession();
    echo $aInt->Tabs(array($aInt->lang("global", "searchfilter")), true);
    $client = $filters->get("client");
    $clientid = $filters->get("clientid");
    if (!$clientid && $client) {
        $clientid = $client;
    }
    $clientname = $filters->get("clientname");
    echo "\n<div id=\"tab0box\" class=\"tabbox\">\n  <div id=\"tab_content\">\n\n<form action=\"";
    echo $PHP_SELF;
    echo "\" method=\"post\">\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"15%\" class=\"fieldlabel\">";
    echo $aInt->lang("fields", "orderid");
    echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"orderid\" size=\"8\" value=\"";
    echo $orderid = $filters->get("orderid");
    echo "\"></td><td width=\"15%\" class=\"fieldlabel\">";
    echo $aInt->lang("fields", "client");
Пример #2
0
 public function __construct($reqpermission, $releaseSession = true)
 {
     global $CONFIG;
     global $licensing;
     global $_ADMINLANG;
     global $infobox;
     global $whmcs;
     $infobox = "";
     $licensing->remoteCheck();
     if ($licensing->getStatus() != "Active") {
         redir("licenseerror=" . $licensing->getStatus(), "licenseerror.php");
     }
     if ($CONFIG['AdminForceSSL'] && $CONFIG['SystemSSLURL']) {
         if (!$_SERVER['HTTPS'] || $_SERVER['HTTPS'] == "off") {
             $requesturl = $_SERVER['PHP_SELF'] . "?";
             foreach ($_REQUEST as $key => $value) {
                 if (!is_array($value)) {
                     $requesturl .= "" . $key . "=" . urlencode($value) . "&";
                     continue;
                 }
             }
             $requesturl = substr($requesturl, 0, 0 - 1);
             $requesturl = substr($requesturl, strrpos($requesturl, "/"));
             header("Location: " . $CONFIG['SystemSSLURL'] . "/" . $whmcs->get_admin_folder_name() . $requesturl);
             exit;
         }
     }
     if ($reqpermission == "loginonly") {
         $this->loginRequired = true;
     } else {
         if ($reqpermission) {
             $this->requiredPermission = $reqpermission;
         } else {
             $this->loginRequired = false;
         }
     }
     require ROOTDIR . "/includes/smarty/Smarty.class.php";
     if ($this->loginRequired) {
         $auth = new WHMCS_Auth();
         if (!$auth->isLoggedIn()) {
             $_SESSION['admloginurlredirect'] = html_entity_decode($_SERVER['REQUEST_URI']);
             redir("", "login.php");
         }
         $auth->getInfobyID($_SESSION['adminid']);
         if ($auth->isSessionPWHashValid()) {
             $auth->updateAdminLog();
             $this->adminTemplate = $auth->getAdminTemplate();
             if ($auth->getAdminLanguage()) {
                 $this->language = $auth->getAdminLanguage();
             }
         } else {
             $auth->destroySession();
             redir("", "login.php");
         }
     }
     if ($releaseSession) {
         releaseSession();
     }
     if ($this->requiredPermission) {
         $permid = array_search($this->requiredPermission, getAdminPermsArray());
         $result = select_query("tbladmins", "roleid", array("id" => $_SESSION['adminid']));
         $data = mysql_fetch_array($result);
         $roleid = $data['roleid'];
         $result = select_query("tbladminperms", "COUNT(*)", array("roleid" => $roleid, "permid" => $permid));
         $data = mysql_fetch_array($result);
         $match = $data[0];
         if (!$match) {
             redir("permid=" . $permid, "accessdenied.php");
             exit;
         }
     }
     $filename = $_SERVER['PHP_SELF'];
     $filename = substr($filename, strrpos($filename, "/"));
     $filename = str_replace(array("/", ".php"), "", $filename);
     if (isset($_SESSION['adminid'])) {
         $twofa = new WHMCS_2FA();
         $twofa->setAdminID($_SESSION['adminid']);
         if ($filename != "myaccount" && $twofa->isForced() && !$twofa->isEnabled() && $twofa->isActiveAdmins()) {
             redir("2faenforce=1", "myaccount.php");
         }
     }
     $this->filename = $filename;
     $this->rowLimit = $CONFIG['NumRecordstoDisplay'];
     if (isset($_SESSION['adminlang']) && $_SESSION['adminlang']) {
         $this->language = $_SESSION['adminlang'];
     }
     $this->language = $whmcs->validateLanguage($this->language, true);
     $whmcs->loadLanguage($this->language, true);
 }