if (!$website) {
$website = $config['website'];
}
+
// If there was an error connecting
if (!$res) {
$this->connectError = mysqli_connect_error();
$settings = $this->bandwidthGetWebsiteSettingsFromName($website);
// Save them in class parameters
- $this->website = $config['website'];
+ $this->website = $website;
$this->siteId = $settings['websitepk'];
$this->target = $settings['target'];
$this->disk_target = $settings['disk_target'];
COALESCE ( SUM(B.total)/1000000, 0 ) as data_total,
COALESCE ( MAX(R.diskusage)/1000000, 0 ) as storage
FROM bytes B, rollup R
+
WHERE B.websitefk = ".$this->siteId."
AND R.websitefk = ".$this->siteId."
AND B.time BETWEEN '$yesterday' AND '$today'
{
return ($this->connected && (strpos(GLM_SERVERSTATS_SITE_BASE_URL, '192.168.44.80') !== false || strpos(GLM_SERVERSTATS_SITE_BASE_URL, 'www.gaslightmedia.com') !== false));
+ return;
}
"Reply-To: $from"
];
wp_mail( $to, $subject, $msg, $header );
+ echo "Sent";
}
-
-
-
}
array(
'target' => FILTER_VALIDATE_FLOAT,
'disk_target' => FILTER_VALIDATE_FLOAT,
- 'glm_contact' => FILTER_VALIDATE_EMAIL,
- 'cust_contact' => FILTER_VALIDATE_EMAIL
+ 'glm_contact' => FILTER_SANITIZE_STRING,
+ 'cust_contact' => FILTER_SANITIZE_STRING
)
);
$sql = "
public function __construct()
{
- // Connect to Bandwidth Database selected in the Configure page
- $this->bandwidthDataConnect();
-
// Use default website unless another is specified by an admin user.
$websiteIn = filter_input( INPUT_GET, 'website', FILTER_SANITIZE_STRING);
if (current_user_can('administrator') && $websiteIn) {
- $this->website = trim($websiteIn);
- $this->siteId = $this->bandwidthGetWebsiteID($this->website);
+ $this->website = $websiteIn;
}
+ // Connect to Bandwidth Database selected in the Configure page
+ $this->bandwidthDataConnect($this->website);
+
}
/*