spacejewel-ipn-communication/source/controllers/Package/Package.php

77 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2018-06-07 10:56:13 +00:00
<?php
/*
*
* This class is part of the Application core logic, since it handles customer packages.
2019-01-30 13:39:28 +00:00
* TODO: Finish default packages
2018-06-07 10:56:13 +00:00
*/
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";
2019-01-30 13:39:28 +00:00
// TODO: These values are subject to change, they should be pulled from config
2018-06-07 10:56:13 +00:00
private $allowedPackages =
[
2019-01-30 13:39:28 +00:00
"P_STARTER" => 0,
"P_SMALLCOMPANY" => 152017738012172,
"P_PROFESSIONAL" => 152017787812438,
"P_ENTERPRISE" => 152017803412693,
"P_UNLIMITED" => 152017828912823
2018-06-07 10:56:13 +00:00
];
private $AdminID;
public function __construct()
{
$this->AdminID = $AdminID;
}
public function getDefaultOptionsArray()
{
return
[
2019-01-30 13:39:28 +00:00
"desc" => "Automatically created by Spacejewel Billing System",
2018-06-07 10:56:13 +00:00
"dir",
"unix",
"webmin",
"web",
"dns",
"mail",
"ssl",
"spam",
"virus",
2019-01-30 13:39:28 +00:00
"limits-from-plan" // apply limits from chosen plan.
2018-06-07 10:56:13 +00:00
];
}
2019-01-30 13:39:28 +00:00
// 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]
];
}
}
2018-06-07 10:56:13 +00:00
}