VirtFusion WHMCS 开机模块

此模块要求 VirtFusion v1.7.3 或更高版本,因为它是基于该版本开发的。请参阅官方文档。

安装

  1. 发布页 下载最新版本.
  2. 解压缩压缩包的内容,并将 modules 文件夹 上传到你的 WHMCS 安装目录中.

❗ 注意事项 ❗

你必须在 WHMCS 中创建 两个自定义字段 才能让此模块正常工作。
你需要在每一个要使用此模块的产品上配置以下自定义字段。

字段名字段类型描述验证选项仅管理员必须字段显示在订单显示在发票
Initial Operating SystemText BoxSet to whatever you wantLeave BlankLeave Blank
Initial SSH KeyText BoxSet to whatever you wantLeave BlankLeave Blank

你可以运行以下 SQL 查询 来创建这些自定义字段:

-- Insert records for Initial Operating System if they don't already exist
INSERT INTO tblcustomfields
(type, relid, fieldname, fieldtype, description, fieldoptions, regexpr, adminonly, required, showorder, showinvoice,
 sortorder, created_at, updated_at)
SELECT 'product',
       id,
       'Initial Operating System',
       'text',
       '',
       '',
       '',
       '',
       '',
       'on',
       '',
       0,
       UTC_TIMESTAMP(),
       UTC_TIMESTAMP()
FROM tblproducts
WHERE servertype = 'VirtFusionDirect'
  AND NOT EXISTS (SELECT 1
                  FROM tblcustomfields
                  WHERE fieldname = 'Initial Operating System'
                    AND relid = tblproducts.id);

-- Insert records for Initial SSH Key if they don't already exist
INSERT INTO tblcustomfields
(type, relid, fieldname, fieldtype, description, fieldoptions, regexpr, adminonly, required, showorder, showinvoice,
 sortorder, created_at, updated_at)
SELECT 'product',
       id,
       'Initial SSH Key',
       'text',
       '',
       '',
       '',
       '',
       '',
       'on',
       '',
       0,
       UTC_TIMESTAMP(),
       UTC_TIMESTAMP()
FROM tblproducts
WHERE servertype = 'VirtFusionDirect'
  AND NOT EXISTS (SELECT 1
                  FROM tblcustomfields
                  WHERE fieldname = 'Initial SSH Key'
                    AND relid = tblproducts.id);

What does this module change?

This module changes the following things:

  • Adds configurable options to the product configuration page to allow the user to select the operating system and add an ssh key to the initial deployment.

TODO

  • Add post checkout checks to ensure the user has selected an operating system and added a ssh key.

关于Zeno Chen

本人涉及的领域较多,杂而不精 程序设计语言: Perl, Java, PHP, Python; 数据库系统: MySQL,Oracle; 偶尔做做电路板的开发,主攻STM32单片机
此条目发表在Linux分类目录。将固定链接加入收藏夹。