示例#1
0
 public function updateAddonSettings($addonId, $settings, $type)
 {
     $addon = monitisSqlHelper::objQuery('SELECT * FROM mod_monitis_addon WHERE addon_id=' . $addonId);
     if ($addon && count($addon) > 0) {
         $value = array('settings' => $settings, 'type' => $type);
         $where = array('addon_id' => $addonId);
         update_query('mod_monitis_addon', $value, $where);
         return 'update';
     } else {
         $value = array('addon_id' => $addonId, 'type' => $type, 'settings' => $settings, 'status' => 'active');
         insert_query('mod_monitis_addon', $value);
         return 'create';
     }
 }
示例#2
0
    static function checkAdminName()
    {
        $admin = monitisSqlHelper::objQuery('SELECT value, tbladmins.id, tbladmins.firstname, tbladmins.lastname 
			FROM tbladdonmodules
			LEFT JOIN tbladmins ON (tbladmins.username = tbladdonmodules.value AND tbladmins.username=tbladdonmodules.value)
			WHERE tbladdonmodules.module="monitis_addon" AND tbladdonmodules.setting="adminuser" && tbladmins.id > 0 ');
        $username = '';
        if (!$admin) {
            $vals = monitisSqlHelper::objQuery('SELECT tbladmins.username FROM tbladmins 
			LEFT JOIN tbladminroles on (tbladminroles.id=tbladmins.roleid) ORDER BY tbladmins.id');
            $username = $vals['username'];
        } else {
            $username = $admin['value'];
        }
        return $username;
    }
示例#3
0
 static function setupDB()
 {
     $row = monitisSqlHelper::objQuery('SELECT * FROM ' . MONITIS_SETTING_TABLE . ' WHERE client_id=' . MONITIS_CLIENT_ID);
     if (!$row) {
         $default_settings = json_decode(self::$default_settings, true);
         $default_settings["order_behavior"] = self::setupBehavior(MONITIS_ORDER_BEHAVIOR);
         $default_settings["user_behavior"] = self::setupBehavior(MONITIS_USER_STATUS_BEHAVIOR);
         $values = array('client_id' => MONITIS_CLIENT_ID, 'apiKey' => self::$apiKey, 'secretKey' => self::$secretKey, 'settings' => json_encode($default_settings));
         self::$settings = $default_settings;
         insert_query(MONITIS_SETTING_TABLE, $values);
     } else {
     }
     //return true;
 }
示例#4
0
    static function configOptionProduct($optionid, $configid, $serviceid)
    {
        $sql = 'SELECT tblhostingconfigoptions.configid as productid, tblhostingconfigoptions.optionid as option_id, 
			mod_monitis_options.type as monitor_type, mod_monitis_options.settings,
			tblhosting.id as serviceid, tblhosting.userid, tblhosting.orderid, tblhosting.domain, tblhosting.dedicatedip, tblhosting.domainstatus,
			tblhosting.server as serverid, tblorders.ordernum, tblorders.status,
			tblclients.firstname as firstName, tblclients.lastname as lastName, tblclients.email,
			CONCAT( tblclients.firstname, " ", tblclients.lastname) as username,
			CONCAT("option") as producttype
		FROM tblhostingconfigoptions
			RIGHT JOIN mod_monitis_options
				ON mod_monitis_options.option_id = tblhostingconfigoptions.optionid
			LEFT JOIN tblhosting
				ON tblhosting.id = tblhostingconfigoptions.relid
			LEFT JOIN tblorders
				ON tblorders.id = tblhosting.orderid
			LEFT JOIN tblclients
				ON tblclients.id = tblhosting.userid
		WHERE tblhostingconfigoptions.optionid=' . $optionid . ' AND tblhostingconfigoptions.configid=' . $configid . ' AND tblhostingconfigoptions.relid=' . $serviceid;
        $product = monitisSqlHelper::objQuery($sql);
        if ($product) {
            $product['web_site'] = self::url_IP($product, $product['monitor_type']);
        }
        return $product;
    }
示例#5
0
 static function serverInfo($server_id)
 {
     return monitisSqlHelper::objQuery('SELECT id, name, ipaddress, hostname FROM tblservers WHERE disabled=0 AND id=' . $server_id);
 }
示例#6
0
 static function whmcsLinkUser($userid)
 {
     return monitisSqlHelper::objQuery('SELECT * FROM ' . MONITIS_USER_TABLE . ' WHERE user_id=' . $userid);
 }
示例#7
0
    private function userById($userid)
    {
        return monitisSqlHelper::objQuery('SELECT id as user_id, firstname, lastname, email
			FROM tblclients 
			WHERE id=' . $userid);
    }
示例#8
0
 private function whmcsInfo(&$info, $monitorId, $type)
 {
     $table = MONITIS_INTERNAL_TABLE;
     if ($type == 'external') {
         $table = MONITIS_EXTERNAL_TABLE;
     }
     $mon = monitisSqlHelper::objQuery('SELECT available, publickey FROM ' . $table . ' WHERE monitor_id=' . $monitorId);
     $info['available'] = $mon['available'];
     $info['publickey'] = $mon['publickey'];
     return $info;
 }