当前位置: 首页>>代码示例>>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;未经允许,请勿转载。