當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ctrl_options::GetSystemOption方法代碼示例

本文整理匯總了PHP中ctrl_options::GetSystemOption方法的典型用法代碼示例。如果您正苦於以下問題:PHP ctrl_options::GetSystemOption方法的具體用法?PHP ctrl_options::GetSystemOption怎麽用?PHP ctrl_options::GetSystemOption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ctrl_options的用法示例。


在下文中一共展示了ctrl_options::GetSystemOption方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkVersion

 function checkVersion($whmcs_version = null)
 {
     $version = module_controller::getVersion();
     if (empty($whmcs_version)) {
         $request_data = $this->XMLDataToArray($this->wsdata);
         $ctags = $request_data['xmws']['content'];
         $whmcs_version = $ctags['whmcs_version'];
     }
     $dataobject = new runtime_dataobject();
     $dataobject->addItemValue('response', '');
     if ((int) $version != (int) $whmcs_version) {
         $dataobject->addItemValue('content', ws_xmws::NewXMLTag('pass', 'false'));
         //check database if this is first time
         $alreadyReported = ctrl_options::GetSystemOption('whmcs_reported');
         if ($alreadyReported == 'false') {
             //if so then update database
             ctrl_options::SetSystemOption('whmcs_reported', $ctags['whmcs_version']);
             //then send email to admins if possible
             $sendemail = ctrl_options::GetSystemOption('whmcs_sendemail_bo');
             if ($sendemail == 'true') {
                 module_controller::sendBadVersionMail($ctags['whmcs_version']);
             }
         }
     } else {
         $alreadyReported = ctrl_options::GetSystemOption('whmcs_reported');
         if ($alreadyReported != 'false') {
             ctrl_options::SetSystemOption('whmcs_reported', 'false');
         }
         $dataobject->addItemValue('content', ws_xmws::NewXMLTag('pass', 'true'));
     }
     return $dataobject->getDataObject();
 }
開發者ID:kadivar,項目名稱:sentora-whmcs,代碼行數:32,代碼來源:webservice.ext.php

示例2: SendEmail

 /**
  * Sends the email with the contents of the object (Body etc. set using the parant calls in phpMailer!)
  * @author Bobby Allen (ballen@bobbyallen.me)
  * @return boolean 
  */
 public function SendEmail()
 {
     $this->Mailer = ctrl_options::GetSystemOption('mailer_type');
     $this->From = ctrl_options::GetSystemOption('email_from_address');
     $this->FromName = ctrl_options::GetSystemOption('email_from_name');
     if (ctrl_options::GetSystemOption('email_smtp') != 'false') {
         $this->IsSMTP();
         if (ctrl_options::GetSystemOption('smtp_auth') != 'false') {
             $this->SMTPAuth = true;
             $this->Username = ctrl_options::GetSystemOption('smtp_username');
             $this->Password = ctrl_options::GetSystemOption('smtp_password');
         }
         if (ctrl_options::GetSystemOption('smtp_secure') != 'false') {
             $this->SMTPSecure = ctrl_options::GetSystemOption('smtp_secure');
         }
         $this->Host = ctrl_options::GetSystemOption('smtp_server');
         $this->Port = ctrl_options::GetSystemOption('smtp_port');
     }
     ob_start();
     $send_resault = $this->Send();
     $error = ob_get_contents();
     ob_clean();
     if ($send_resault) {
         runtime_hook::Execute('OnSuccessfulSendEmail');
         return true;
     } else {
         $logger = new debug_logger();
         $logger->method = ctrl_options::GetSystemOption('logmode');
         $logger->logcode = "061";
         $logger->detail = 'Error sending email (using sys_email): ' . $error . '';
         $logger->writeLog();
         runtime_hook::Execute('OnFailedSendEmail');
         return false;
     }
 }
開發者ID:bbspike,項目名稱:sentora-core,代碼行數:40,代碼來源:email.class.php

示例3: GenerateWebalizerStats

function GenerateWebalizerStats()
{
    global $zdbh;
    $sql = $zdbh->prepare("SELECT * FROM x_vhosts LEFT JOIN x_accounts ON x_vhosts.vh_acc_fk=x_accounts.ac_id_pk WHERE vh_deleted_ts IS NULL");
    $sql->execute();
    echo "Generating webalizer stats html..." . fs_filehandler::NewLine();
    while ($rowvhost = $sql->fetch()) {
        $basedir = ctrl_options::GetSystemOption('MADmin_root') . "modules/webalizer_stats/stats/" . $rowvhost['ac_user_vc'] . "/" . $rowvhost['vh_name_vc'];
        if (!file_exists($basedir)) {
            @mkdir($basedir, 0755, TRUE);
        }
        /** set webalizer command dependant on OS */
        if (sys_versions::ShowOSPlatformVersion() == "Windows") {
            $command = ctrl_options::GetSystemOption('MADmin_root') . 'modules/webalizer_stats/bin/webalizer.exe';
        } else {
            chmod(ctrl_options::GetSystemOption('MADmin_root') . "modules/webalizer_stats/bin/webalizer", 4777);
            $command = "webalizer";
        }
        /** all other args and flags are the same so keep them outsite to avoid duplication */
        $flag = '-o';
        $secondFlags = '-d -F clf -n';
        $domain = $rowvhost['vh_name_vc'];
        $logFile = realpath(ctrl_options::GetSystemOption('log_dir') . 'domains/' . $rowvhost['ac_user_vc'] . '/' . $rowvhost['vh_name_vc'] . '-access.log');
        $statsPath = ctrl_options::GetSystemOption('MADmin_root') . "modules/webalizer_stats/stats/" . $rowvhost['ac_user_vc'] . '/' . $rowvhost['vh_name_vc'];
        /** build arg array, this is in the required order! do not just change the order of this array */
        $args = array($logFile, $flag, $statsPath, $secondFlags, $domain);
        echo "Generating stats for: " . $rowvhost['ac_user_vc'] . "/" . $rowvhost['vh_name_vc'] . fs_filehandler::NewLine();
        $returnValue = ctrl_system::systemCommand($command, $args);
        echo (0 === $returnValue ? 'Succeeded' : 'Failed') . fs_filehandler::NewLine();
    }
}
開發者ID:Boter,項目名稱:madmin-core,代碼行數:31,代碼來源:OnDaemonHour.hook.php

示例4: DeleteAliasForDeletedClient

function DeleteAliasForDeletedClient()
{
    global $zdbh;
    $deletedclients = array();
    $sql = "SELECT COUNT(*) FROM x_accounts WHERE ac_deleted_ts IS NOT NULL";
    if ($numrows = $zdbh->query($sql)) {
        if ($numrows->fetchColumn() != 0) {
            $sql = $zdbh->prepare("SELECT * FROM x_accounts WHERE ac_deleted_ts IS NOT NULL");
            $sql->execute();
            while ($rowclient = $sql->fetch()) {
                $deletedclients[] = $rowclient['ac_id_pk'];
            }
        }
    }
    // Include mail server specific file here.
    if (file_exists("modules/aliases/hooks/" . ctrl_options::GetSystemOption('mailserver_php') . "")) {
        include "modules/aliases/hooks/" . ctrl_options::GetSystemOption('mailserver_php') . "";
    }
    foreach ($deletedclients as $deletedclient) {
        $bindArray = array(':deletedclient' => $deletedclient);
        $sqlStatment = $zdbh->bindQuery("SELECT * FROM x_aliases WHERE al_acc_fk=:deletedclient AND al_deleted_ts IS NULL", $bindArray);
        $result = $zdbh->returnRow();
        if ($result) {
            $sql = $zdbh->prepare("UPDATE x_aliases SET al_deleted_ts=:time WHERE al_acc_fk=:deletedclient");
            $sql->bindParam(':time', time());
            $sql->bindParam(':deletedclient', $deletedclient);
            $sql->execute();
        }
    }
}
開發者ID:bbspike,項目名稱:sentora-core,代碼行數:30,代碼來源:OnAfterDeleteClient.hook.php

示例5: DeleteMailboxesForDeletedClient

function DeleteMailboxesForDeletedClient()
{
    global $zdbh;
    $deletedclients = array();
    $sql = "SELECT COUNT(*) FROM x_accounts WHERE ac_deleted_ts IS NOT NULL";
    if ($numrows = $zdbh->query($sql)) {
        if ($numrows->fetchColumn() != 0) {
            $sql = $zdbh->prepare("SELECT * FROM x_accounts WHERE ac_deleted_ts IS NOT NULL");
            $sql->execute();
            while ($rowclient = $sql->fetch()) {
                $deletedclients[] = $rowclient['ac_id_pk'];
            }
        }
    }
    // Include mail server specific file here.
    if (file_exists("modules/mailboxes/hooks/" . ctrl_options::GetSystemOption('mailserver_php') . "")) {
        include "modules/mailboxes/hooks/" . ctrl_options::GetSystemOption('mailserver_php') . "";
    }
    foreach ($deletedclients as $deletedclient) {
        //      $result = $zdbh->query("SELECT * FROM x_mailboxes WHERE mb_acc_fk=" . $deletedclient . " AND mb_deleted_ts IS NULL")->Fetch();
        $numrows = $zdbh->prepare("SELECT * FROM x_mailboxes WHERE mb_acc_fk=:deletedclient AND mb_deleted_ts IS NULL");
        $numrows->bindParam(':deletedclient', $deletedclient);
        $numrows->execute();
        $result = $numrows->fetch();
        if ($result) {
            $time = time();
            $sql = $zdbh->prepare("UPDATE x_mailboxes SET mb_deleted_ts=:time WHERE mb_acc_fk=:deletedclient");
            $sql->bindParam(':time', $time);
            $sql->bindParam(':deletedclient', $deletedclient);
            $sql->execute();
        }
    }
}
開發者ID:TGates71,項目名稱:Sentora-Windows-Upgrade,代碼行數:33,代碼來源:OnAfterDeleteClient.hook.php

示例6: ListPackages

 /**
  * The 'worker' methods.
  */
 static function ListPackages($uid)
 {
     global $zdbh;
     $sql = "SELECT * FROM x_packages WHERE pk_reseller_fk=:uid AND pk_deleted_ts IS NULL";
     //$numrows = $zdbh->query($sql);
     $numrows = $zdbh->prepare($sql);
     $numrows->bindParam(':uid', $uid);
     $numrows->execute();
     if ($numrows->fetchColumn() != 0) {
         $sql = $zdbh->prepare($sql);
         $sql->bindParam(':uid', $uid);
         $res = array();
         $sql->execute();
         while ($rowpackages = $sql->fetch()) {
             //$numrows = $zdbh->query("SELECT COUNT(*) FROM x_accounts WHERE ac_package_fk=" . $rowpackages['pk_id_pk'] . " AND ac_deleted_ts IS NULL")->fetchColumn();
             $numrows = $zdbh->prepare("SELECT COUNT(*) FROM x_accounts WHERE ac_package_fk=:pk_id_pk AND ac_deleted_ts IS NULL");
             $numrows->bindParam(':pk_id_pk', $rowpackages['pk_id_pk']);
             $numrows->execute();
             $Column = $numrows->fetchColumn();
             array_push($res, array('packageid' => $rowpackages['pk_id_pk'], 'created' => date(ctrl_options::GetSystemOption('MADmin_df'), $rowpackages['pk_created_ts']), 'clients' => $Column[0], 'packagename' => ui_language::translate($rowpackages['pk_name_vc'])));
         }
         return $res;
     } else {
         return false;
     }
 }
開發者ID:Boter,項目名稱:madmin-core,代碼行數:29,代碼來源:controller.ext.php

示例7: DeleteApacheClientFiles

function DeleteApacheClientFiles()
{
    global $zdbh;
    $sql = "SELECT * FROM x_accounts WHERE ac_deleted_ts IS NOT NULL";
    $numrows = $zdbh->query($sql);
    if ($numrows->fetchColumn() != 0) {
        $sql = $zdbh->prepare($sql);
        $res = array();
        $sql->execute();
        while ($rowdeletedaccounts = $sql->fetch()) {
            // Check for an active user with same username
            $sql2 = "SELECT COUNT(*) FROM x_accounts WHERE ac_user_vc=:user AND ac_deleted_ts IS NULL";
            $numrows2 = $zdbh->prepare($sql2);
            $user = $rowdeletedaccounts['ac_user_vc'];
            $numrows2->bindParam(':user', $user);
            if ($numrows2->execute()) {
                if ($numrows2->fetchColumn() == 0) {
                    if (file_exists(ctrl_options::GetSystemOption('hosted_dir') . $rowdeletedaccounts['ac_user_vc'])) {
                        fs_director::RemoveDirectory(ctrl_options::GetSystemOption('hosted_dir') . $rowdeletedaccounts['ac_user_vc']);
                    }
                }
            }
        }
    }
}
開發者ID:bbspike,項目名稱:sentora-core,代碼行數:25,代碼來源:OnAfterDeleteClient.hook.php

示例8: Template

 public static function Template()
 {
     if (!fs_director::CheckForEmptyValue(ctrl_options::GetSystemOption('server_ip'))) {
         return ctrl_options::GetSystemOption('server_ip');
     } else {
         return sys_monitoring::ServerIPAddress();
     }
 }
開發者ID:Boter,項目名稱:madmin-core,代碼行數:8,代碼來源:serveripaddress.class.php

示例9: Template

 public static function Template()
 {
     $currentuser = ctrl_users::GetUserDetail(ctrl_auth::CurrentUserID());
     if ($currentuser['lastlogon']) {
         return date(ctrl_options::GetSystemOption('sentora_df'), $currentuser['lastlogon']);
     } else {
         return "<: Never :>";
     }
 }
開發者ID:TGates71,項目名稱:Sentora-Windows-Upgrade,代碼行數:9,代碼來源:lastlogon.class.php

示例10: getZpanelNews

 static function getZpanelNews()
 {
     $handle = @file_get_contents(ctrl_options::GetSystemOption('news_url'));
     $content = $handle;
     if (!$content) {
         return false;
     }
     return ws_generic::JSONToArray($content, true);
 }
開發者ID:TGates71,項目名稱:Sentora-Windows-Upgrade,代碼行數:9,代碼來源:controller.ext.php

示例11: CheckServerAPIKey

 /**
  * Checks that the Server API given in the webservice request XML is valid and matches the one stored in the x_settings table.
  * @author Bobby Allen (ballen@bobbyallen.me)
  * @return boolean
  */
 public function CheckServerAPIKey()
 {
     if ($this->wsdataarray['apikey'] != ctrl_options::GetSystemOption('apikey')) {
         runtime_hook::Execute('OnBadAPIKeyAuth');
         return false;
     } else {
         runtime_hook::Execute('OnGoodAPIKeyAuth');
         return true;
     }
 }
開發者ID:BIGGANI,項目名稱:zpanelx,代碼行數:15,代碼來源:xmws.class.php

示例12: getZpanelUpdates

 public static function getZpanelUpdates()
 {
     if (ctrl_options::GetSystemOption('dbversion') < ctrl_options::GetSystemOption('latestzpversion')) {
         $msg = ui_language::translate("There are currently new updates for your ZPanel installation, please download the latest release") . " (<strong>" . ctrl_options::GetSystemOption('latestzpversion') . "</strong>) from <a href=\"http://www.zpanelcp.com/\">http://www.zpanelcp.com/</a>.";
     } elseif (ctrl_options::GetSystemOption('dbversion') == ctrl_options::GetSystemOption('latestzpversion')) {
         $msg = "Congratulations, You are running the most recent version of ZPanel (<strong>" . ctrl_options::GetSystemOption('latestzpversion') . "</strong>)!";
     } else {
         $msg = "You appear to be running a BETA release, unless you are testing or developing we recommend you download and use the latest stable release (<strong>" . ctrl_options::GetSystemOption('latestzpversion') . "</strong>).";
     }
     return $msg;
 }
開發者ID:BIGGANI,項目名稱:zpanelx,代碼行數:11,代碼來源:controller.ext.php

示例13: CheckZPanelLatestVersion

function CheckZPanelLatestVersion()
{
    // Grab the latest version of ZPanel from the ZPanel API servers and cache it into the database.
    $live_version = ws_generic::ReadURLRequestResult(ctrl_options::GetSystemOption('update_url'));
    if (!$live_version) {
        return false;
    }
    $versionnumber = ws_generic::JSONToArray($live_version);
    ctrl_options::SetSystemOption('latestzpversion', $versionnumber[0]['version']);
    return true;
}
開發者ID:BIGGANI,項目名稱:zpanelx,代碼行數:11,代碼來源:OnDaemonDay.hook.php

示例14: LocalPortStatus

 /**
  * Reports on whether a TCP port is listening for connections.
  * @author Pascal peyremorte
  * @param int $port The port number of which to check (eg. 25 for SMTP).
  * @return boolean
  */
 static function LocalPortStatus($port)
 {
     $timeout = ctrl_options::GetSystemOption('servicechk_to');
     $fp = @fsockopen('127.0.0.1', $port, $errno, $errstr, $timeout);
     if ($fp !== false) {
         fclose($fp);
         #do not leave the port open.
         return true;
     }
     return false;
 }
開發者ID:Boter,項目名稱:madmin-core,代碼行數:17,代碼來源:monitoring.class.php

示例15: Template

 public static function Template()
 {
     global $controller;
     if (!$controller->GetControllerRequest('URL', 'module')) {
         $line = "";
         $modcats = ui_moduleloader::GetModuleCats();
         foreach ($modcats as $modcat) {
             $mods = ui_moduleloader::GetModuleList($modcat['mc_id_pk'], "modadmin");
             if ($mods) {
                 $line .= "<table class=\"zcat\">";
                 $line .= "<tr>";
                 $line .= "<th align=\"left\">";
                 $line .= "<a name=\"" . str_replace(" ", "_", strtolower($modcat['mc_name_vc'])) . "\"></a>";
                 $line .= "" . ui_language::translate($modcat['mc_name_vc']) . "";
                 $line .= "<a href=\"#\" class=\"zcat\" id=\"zcat_" . str_replace(" ", "_", strtolower($modcat['mc_name_vc'])) . "_a\"></a>";
                 $line .= "</th>";
                 $line .= "</tr>";
                 $line .= "<tr>";
                 $line .= "<td align=\"left\">";
                 $line .= "<div class=\"zcat_" . str_replace(" ", "_", strtolower($modcat['mc_name_vc'])) . "\" id=\"zcat_" . str_replace(" ", "_", strtolower($modcat['mc_name_vc'])) . "\">";
                 $line .= "<table class=\"zcatcontent\" align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                 $line .= "<tr>";
                 $line .= "<td>";
                 $line .= "<table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                 $line .= "<tr>";
                 $icons_per_row = ctrl_options::GetSystemOption('module_icons_pr');
                 $num_icons = 0;
                 foreach ($mods as $mod) {
                     //$translatename = '<: '.$mod['mo_name_vc'].' :>';
                     //$translatename = $mod['mo_name_vc'];
                     $translatename = ui_language::translate($mod['mo_name_vc']);
                     $cleanname = str_replace(" ", "ZP(br)", $translatename);
                     if ($num_icons == $icons_per_row) {
                         $line .= "</tr><tr>";
                         $num_icons = 0;
                     }
                     $line .= "<td style=\"text-align:center;\" align=\"left\">";
                     $line .= "<a href=\"?module=" . $mod['mo_folder_vc'] . "\" title=\"<: " . $mod['mo_desc_tx'] . " :>\">";
                     $line .= "<img src=\"modules/" . $mod['mo_folder_vc'] . "/assets/icon.png\" border=\"0\" />";
                     $line .= "</a>";
                     $line .= "<br />";
                     $line .= "<a href=\"?module=" . $mod['mo_folder_vc'] . "\">" . $cleanname . "</a>";
                     $line .= "</td>";
                     $num_icons++;
                 }
                 $line .= "</tr></table></td></tr></table></div></td></tr></table><br>";
             }
         }
         return $line;
     }
 }
開發者ID:TGates71,項目名稱:Sentora-Windows-Upgrade,代碼行數:51,代碼來源:modulelist.class.php


注:本文中的ctrl_options::GetSystemOption方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。