77 lines
1.7 KiB
PHP
77 lines
1.7 KiB
PHP
<?php
|
|
|
|
/*
|
|
*
|
|
* This class is part of the Application core logic, since it handles customer packages.
|
|
* TODO: Finish default packages
|
|
*/
|
|
class Package extends Application
|
|
{
|
|
|
|
const PACKAGE_STARTER = "P_STARTER";
|
|
|
|
const PACKAGE_SMALLCOMPANY = "P_SCOMPANY";
|
|
|
|
const PACKAGE_PROFESSIONAL = "P_PROFESSIONAL";
|
|
|
|
const PACKAGE_ENTERPRISE = "P_ENTERPRISE";
|
|
|
|
const PACKAGE_UNLIMITED = "P_UNLIMITED";
|
|
|
|
|
|
// TODO: These values are subject to change, they should be pulled from config
|
|
private $allowedPackages =
|
|
[
|
|
"P_STARTER" => 0,
|
|
"P_SMALLCOMPANY" => 152017738012172,
|
|
"P_PROFESSIONAL" => 152017787812438,
|
|
"P_ENTERPRISE" => 152017803412693,
|
|
"P_UNLIMITED" => 152017828912823
|
|
];
|
|
|
|
|
|
private $AdminID;
|
|
|
|
|
|
public function __construct()
|
|
{
|
|
$this->AdminID = $AdminID;
|
|
|
|
}
|
|
|
|
|
|
public function getDefaultOptionsArray()
|
|
{
|
|
return
|
|
[
|
|
|
|
"desc" => "Automatically created by Spacejewel Billing System",
|
|
"dir",
|
|
"unix",
|
|
"webmin",
|
|
"web",
|
|
"dns",
|
|
"mail",
|
|
"ssl",
|
|
"spam",
|
|
"virus",
|
|
"limits-from-plan" // apply limits from chosen plan.
|
|
|
|
];
|
|
|
|
}
|
|
|
|
// return features for each $package in an array format
|
|
public function selectPackage($package)
|
|
{
|
|
if (array_key_exists($package, $this->allowedPackages))
|
|
{
|
|
return
|
|
[
|
|
"--plan" => $this->allowedPackages[$package]
|
|
|
|
];
|
|
}
|
|
}
|
|
|
|
} |