From ed9868943da1939810ae4edf5f08330c72048f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Mon, 2 Nov 2020 15:16:24 +0300 Subject: [PATCH 1/5] just a small change. --- src/bb-config-sample.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bb-config-sample.php b/src/bb-config-sample.php index 37f5565c1..fd2fda56c 100755 --- a/src/bb-config-sample.php +++ b/src/bb-config-sample.php @@ -6,7 +6,7 @@ * to "bb-config.php" and fill in the values. * Import /install/structure.sql to your database * Import /install/content.sql to your database - * Open browser http://www.youdomain.com/index.php?_url=/bb-admin to create new admin account. + * Open browser http://www.yourdomain.com/index.php?_url=/bb-admin to create new admin account. * Remove /install directory */ From 1476cbfbe7e950d8811dc7db2b25e48005a19ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Mon, 2 Nov 2020 15:55:07 +0300 Subject: [PATCH 2/5] From now on, there's no pro plan. --- src/bb-modules/Branding/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bb-modules/Branding/manifest.json b/src/bb-modules/Branding/manifest.json index a621c2a8b..39acb03e1 100644 --- a/src/bb-modules/Branding/manifest.json +++ b/src/bb-modules/Branding/manifest.json @@ -2,10 +2,10 @@ "id": "branding", "type": "mod", "name": "Branding", - "description": "BoxBilling branding module. Can be deactivated by PRO license owners only.", + "description": "Branding module of BoxBilling. This extension includes the footer reference to BoxBilling's official website.", "homepage_url": "http://github.com/boxbilling/", "author": "BoxBilling", "author_url": "http://extensions.boxbilling.com/", "license": "http://www.boxbilling.com/license.txt", "version": "1.0.0" -} \ No newline at end of file +} From 877c9bd08957e84c850a2270ec55f9c3e153c067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Mon, 2 Nov 2020 16:03:00 +0300 Subject: [PATCH 3/5] Remove the "BoxBilling license product" extension We no longer have a pro plan. We can't let people resell something that no longer exists. --- .../Serviceboxbillinglicense/Api/Admin.php | 138 ---------- .../Serviceboxbillinglicense/Api/Client.php | 62 ----- .../Serviceboxbillinglicense/Service.php | 235 ------------------ .../ServiceBoxbilling.php | 134 ---------- .../mod_serviceboxbillinglicense_manage.phtml | 85 ------- ...od_serviceboxbillinglicense_settings.phtml | 75 ------ .../mod_serviceboxbillinglicense_manage.phtml | 46 ---- .../mod_serviceboxbillinglicense_order.phtml | 1 - .../Serviceboxbillinglicense/icon.png | Bin 2648 -> 0 bytes .../Serviceboxbillinglicense/manifest.json | 12 - 10 files changed, 788 deletions(-) delete mode 100644 src/bb-modules/Serviceboxbillinglicense/Api/Admin.php delete mode 100644 src/bb-modules/Serviceboxbillinglicense/Api/Client.php delete mode 100644 src/bb-modules/Serviceboxbillinglicense/Service.php delete mode 100644 src/bb-modules/Serviceboxbillinglicense/ServiceBoxbilling.php delete mode 100644 src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_manage.phtml delete mode 100644 src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_settings.phtml delete mode 100644 src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_manage.phtml delete mode 100644 src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_order.phtml delete mode 100644 src/bb-modules/Serviceboxbillinglicense/icon.png delete mode 100644 src/bb-modules/Serviceboxbillinglicense/manifest.json diff --git a/src/bb-modules/Serviceboxbillinglicense/Api/Admin.php b/src/bb-modules/Serviceboxbillinglicense/Api/Admin.php deleted file mode 100644 index 6eb57ca20..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/Api/Admin.php +++ /dev/null @@ -1,138 +0,0 @@ -di['db']->findOne('client_order', - "id=:id - AND service_type = 'boxbillinglicense' - ", - array('id'=>$data['order_id'])); - - if(!$order) { - throw new \Box_Exception('BoxBilling license order not found'); - } - - $s = $this->di['db']->findOne('service_boxbillinglicense', - 'id=:id', - array('id'=>$order->service_id)); - if(!$s) { - throw new \Box_Exception('Order is not activated'); - } - return array($order, $s); - } - - /** - * Update module configuration - * - * @param int $order_id - order id - * @return bool - */ - public function config_update($data) - { - $this->getService()->setModuleConfig($data); - $this->di['logger']->info('Updated configuration information.'); - return true; - } - - /** - * Get module configuration - * - * @param int $order_id - order id - * @return bool - */ - public function config_get($data) - { - return $this->getService()->getModuleConfig($data); - } - - /** - * Get detailed license order info - * - * @param int $order_id - order id - * - * @return array - */ - public function order_info($data) - { - list(, $service) = $this->_getService($data); - return $this->getService()->licenseDetails($service); - } - - /** - * Reset license information. Usually used when moving BoxBilling to - * new server. - * - * @param int $order_id - order id - * - * @return bool - */ - public function order_reset($data) - { - list(, $service) = $this->_getService($data); - $this->getService()->licenseReset($service); - return true; - } - - /** - * Convenience method to become partner. After you become BoxBilling - * partner you are able to sell licenses. - * - * @return bool - */ - public function become_partner() - { - return $this->getService()->becomePartner(); - } - - /** - * Test connection to BoxBilling server. Used to test your configuration. - * - * @return bool - */ - public function test_connection() - { - $this->getService()->testApiConnection(); - return true; - } - - /** - * Update existing order service - * This method used to change service data if order setup fails - * or have changed on remote server - * - * @param int $order_id - order id - * - * @return boolean - */ - public function update($data) - { - list(, $service) = $this->_getService($data); - - $service->oid = $this->di['array_get']($data, 'oid', $service->oid); - $service->updated_at = date('Y-m-d H:i:s'); - $this->di['db']->store($service); - - $this->di['logger']->info('Updated BoxBilling license %s details', $service->id); - return true; - } -} \ No newline at end of file diff --git a/src/bb-modules/Serviceboxbillinglicense/Api/Client.php b/src/bb-modules/Serviceboxbillinglicense/Api/Client.php deleted file mode 100644 index c1c3b8ac1..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/Api/Client.php +++ /dev/null @@ -1,62 +0,0 @@ -di['db']->findOne('client_order', - "id=:id - AND client_id = :cid - AND service_type = 'boxbillinglicense' - ", - array(':id' => $data['order_id'], ':cid' => $this->getIdentity()->id)); - - if (!$order) { - throw new \Box_Exception('BoxBilling license order not found'); - } - - $s = $this->di['db']->findOne('service_boxbillinglicense', - 'id=:id AND client_id = :cid', - array('id' => $order->service_id, 'cid' => $this->getIdentity()->id)); - if (!$s) { - throw new \Box_Exception('Order is not activated'); - } - - return array($order, $s); - } - - /** - * Reset license information. Usually used when moving BoxBilling to - * new server. - * - * @param int $order_id - order id - * @return bool - */ - public function reset($data) - { - list($order, $service) = $this->_getService($data); - $this->getService()->reset($order, $service, $data); - $this->di['logger']->info('Reset license information. Order ID #%s', $order->id); - - return true; - } -} \ No newline at end of file diff --git a/src/bb-modules/Serviceboxbillinglicense/Service.php b/src/bb-modules/Serviceboxbillinglicense/Service.php deleted file mode 100644 index 69537878b..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/Service.php +++ /dev/null @@ -1,235 +0,0 @@ -di = $di; - } - - /** - * @return mixed - */ - public function getDi() - { - return $this->di; - } - - public function install() - { - $sql=" - CREATE TABLE IF NOT EXISTS `service_boxbillinglicense` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `client_id` bigint(20) DEFAULT NULL, - `oid` varchar(255) DEFAULT NULL, - `created_at` varchar(35) DEFAULT NULL, - `updated_at` varchar(35) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `oid` (`oid`), - KEY `client_id_idx` (`client_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - "; - - $this->di['db']->exec($sql); - } - - public function uninstall() - { - - $this->di['db']->exec("DROP TABLE IF EXISTS `service_boxbillinglicense`"); - } - - public function setModuleConfig($data) - { - $this->getModuleConfig(); - - $sql=" - UPDATE extension_meta - SET meta_value = :config - WHERE extension = 'mod_serviceboxbillinglicense' - AND meta_key = 'config' - "; - $params = array( - 'config' => json_encode($data), - ); - $this->di['db']->exec($sql, $params); - } - - public function getModuleConfig() - { - $c = $this->di['db']->findOne('extension_meta', 'extension = :ext AND meta_key = :key', array('ext'=>'mod_serviceboxbillinglicense', 'key'=>'config')); - if(is_null($c)) { - $c = $this->di['db']->dispense('extension_meta'); - $c->extension = 'mod_serviceboxbillinglicense'; - $c->meta_key = 'config'; - $c->meta_value = null; - $c->created_at = date('Y-m-d H:i:s'); - $c->updated_at = date('Y-m-d H:i:s'); - $this->di['db']->store($c); - } - $config = json_decode($c->meta_value, 1); - if(!isset($config['api_key'])) { - $config['api_key'] = null; - } - return $config; - } - - /** - * @param $order - * @return void - */ - public function create($order) - { - $model = $this->di['db']->dispense('service_boxbillinglicense'); - $model->client_id = $order->client_id; - $model->created_at = date('Y-m-d H:i:s'); - $model->updated_at = date('Y-m-d H:i:s'); - $this->di['db']->store($model); - return $model; - } - - /** - * @param $order - * @return boolean - */ - public function activate($order, $model) - { - if(!is_object($model)) { - throw new \Box_Exception('Could not activate order. Service was not created', null, 7456); - } - - $result = $this->_getApi()->partner_order_create(); - - $model->oid = $result; - $model->updated_at = date('Y-m-d H:i:s'); - $this->di['db']->store($model); - - return true; - } - - /** - * Suspend VPS - * - * @param $order - * @return boolean - */ - public function suspend($order, $model) - { - if(!is_object($model)) { - throw new \Box_Exception('Could not activate order. Service was not created', null, 7456); - } - - $this->_getApi()->partner_order_suspend($model->vserverid); - $model->updated_at = date('Y-m-d H:i:s'); - $this->di['db']->store($model); - return true; - } - - /** - * @param $order - * @return boolean - */ - public function unsuspend($order, $model) - { - if(!is_object($model)) { - throw new \Box_Exception('Could not activate order. Service was not created', null, 7456); - } - - $this->_getApi()->partner_order_unsuspend($model->vserverid); - $model->updated_at = date('Y-m-d H:i:s'); - $this->di['db']->store($model); - return true; - } - - /** - * @param $order - * @return boolean - */ - public function delete($order, $model) - { - if(is_object($model)) { - $this->_getApi()->partner_order_delete($model->vserverid); - $this->di['db']->trash($model); - } - return true; - } - - public function reset($order, $model) - { - $this->_getApi()->partner_order_reset($model->f1); - return true; - } - - public function becomePartner() - { - $data = array( - 'agree'=> true, - ); - $this->_getApi()->partner_signup($data); - } - - public function licenseDetails($model) - { - $data = array( - 'order_id'=> $model->oid, - ); - try { - return $this->_getApi()->partner_order_get($data); - } catch(\Exception $e) { - error_log($e->getMessage()); - } - return array(); - } - - public function licenseReset($model) - { - $data = array( - 'order_id'=> $model->oid, - ); - return $this->_getApi()->partner_order_reset($data); - } - - public function testApiConnection() - { - try { - $this->_getApi()->client_get(); - } catch (\Exception $e) { - error_log($e); - throw new \Exception('Unable to connect to BoxBilling API. Make sure API key is valid.'); - } - return true; - } - - private function _getApi() - { - $config = $this->getModuleConfig(); - return $this->di['service_boxbilling']($config); - } - - public function toApiArray($model, $deep = false, $identity = null) - { - return array( - 'id' => $model->id, - 'oid' => $model->oid, - ); - } -} \ No newline at end of file diff --git a/src/bb-modules/Serviceboxbillinglicense/ServiceBoxbilling.php b/src/bb-modules/Serviceboxbillinglicense/ServiceBoxbilling.php deleted file mode 100644 index 1e3492e74..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/ServiceBoxbilling.php +++ /dev/null @@ -1,134 +0,0 @@ -di = $di; - } - - public function getDi() - { - return $this->di; - } - /** - * Api URL - * - * @example https://www.boxbilling.com/api - * @var string - */ - protected $_api_url = 'http://www.boxbilling.com/api'; - - /** - * Api key is found in BoxBilling profile page - * - * @example e4yny7yjy5u3yhyhepumuqaquva3y4as - * @var string - */ - protected $_api_key = NULL; - - /** - * Same service can be used to control BoxBilling as client and guest - * - * @example guest - * @example admin - * @example client - * @var string - */ - protected $_api_role = 'client'; - - /** - * Path to cookie to save session for requests. - * - * @var string - path to cookie. Must be writable - */ - protected $_cookie = NULL; - - public function __construct($options) - { - if (!extension_loaded('curl')) { - throw new \Exception('cURL extension is not enabled'); - } - - if (isset($options['api_key'])) { - $this->_api_key = $options['api_key']; - } - - if (isset($options['api_url'])) { - $this->_api_url = $options['api_url']; - } - - if (isset($options['api_role'])) { - $this->_api_role = $options['api_role']; - } - - $this->_cookie = sys_get_temp_dir() . '/bbcookie.txt'; - } - - public function __call($method, $arguments) - { - $data = array(); - if (isset($arguments[0]) && is_array($arguments[0])) { - $data = $arguments[0]; - } - - $module = substr($method, 0, strpos($method, '_')); - $m = substr($method, strpos($method, '_') + 1); - - $url = $this->_api_url . '/' . $this->_api_role . '/' . $module . '/' . $m; - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - curl_setopt($ch, CURLOPT_USERPWD, $this->_api_role . ":" . $this->_api_key); - curl_setopt($ch, CURLOPT_COOKIEJAR, $this->_cookie); - curl_setopt($ch, CURLOPT_COOKIEFILE, $this->_cookie); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - - $result = curl_exec($ch); - - if ($result === false) { - $e = new \Exception(sprintf('Curl Error: "%s"', curl_error($ch))); - curl_close($ch); - throw $e; - } - - curl_close($ch); - - $json = json_decode($result, 1); - - if (!is_array($json)) { - throw new \Exception(sprintf('BoxBilling API: Invalid Response "%s"', $result)); - } - - if (isset($json['error']) && !empty($json['error'])) { - throw new \Exception($json['error']['message'], $json['error']['code']); - } - - if (!isset($json['result'])) { - throw new \Exception(sprintf('BoxBilling API: Invalid Response "%s"', $result)); - } - - return $json['result']; - } - -} \ No newline at end of file diff --git a/src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_manage.phtml b/src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_manage.phtml deleted file mode 100644 index c1a3605e2..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_manage.phtml +++ /dev/null @@ -1,85 +0,0 @@ -
-

{% trans 'BoxBilling license management' %}

-
- -
-
-
- -
- -
-
-
- - - -
-
- -{% set info = admin.serviceboxbillinglicense_order_info({"order_id":order.id}) %} - -{% if info %} - -
-

{% trans 'License details' %}

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% trans 'Order status' %}:{{ info.status|title }}
{% trans 'License key' %}:{{ info.license_key }}
{% trans 'Created at' %}:{{ info.created_at|bb_date }}
{% trans 'Updated at' %}:{{ info.updated_at|bb_date }}
{% trans 'Expires at' %}:{{ info.expires_at|bb_date }}
{% trans 'Valid IPs' %}:{% for v in info.ips %}{{ v }}{{constant("PHP_EOL")}}{%else%}All IPs{% endfor %}
{% trans 'Valid hostnames' %}:{% for v in info.hosts %}{{ v }}{{constant("PHP_EOL")}}{%else%}All hostnames{% endfor %}
{% trans 'Valid versions' %}:{% for v in info.versions %}{{ v }}{{constant("PHP_EOL")}}{%else%}Any version{% endfor %}
{% trans 'Valid install paths' %}:{% for v in info.paths %}{{ v }}{{constant("PHP_EOL")}}{%else%}Any install path{% endfor %}
-
- Reset -
-
- -{% else %} - -
-
-

{% trans 'INFORMATION' %}: {% trans 'Order is not activated or not found' %}

-
-
-{% endif %} diff --git a/src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_settings.phtml b/src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_settings.phtml deleted file mode 100644 index 6e9524cd3..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/html_admin/mod_serviceboxbillinglicense_settings.phtml +++ /dev/null @@ -1,75 +0,0 @@ -{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% set active_menu = 'system' %} -{% block meta_title %}{% trans 'BoxBilling license' %}{% endblock %} - -{% block breadcrumbs %} - -{% endblock %} - - -{% block content %} - -
-
-
{% trans 'BoxBilling license' %}
-
- -
-

{% trans '1. Configure API' %}

-
- - {% set params = admin.serviceboxbillinglicense_config_get %} -
-
-
- -
- - - -
-
-
-
-
- -
-

{% trans '2. Become partner' %}

-

Click here to become partner

-

Go to partnership program page for more information.

-
- -
-

{% trans '3. Create license product' %}

-

Create BoxBilling license product

-

You can sell licenses for any price you want or even give it for free. All money collected from your clients stays for you.

-

BoxBilling will start charging you only for active licenses after 14 days. This gives you ability to make revenue before you even spend money.

-

Thats it. Remember the more you sell the lower the price you receive.

-
-
- -{% endblock %} - -{% block js %} -{% autoescape "js" %} - -{% endautoescape %} -{% endblock %} \ No newline at end of file diff --git a/src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_manage.phtml b/src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_manage.phtml deleted file mode 100644 index ed48a0af7..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_manage.phtml +++ /dev/null @@ -1,46 +0,0 @@ -{% if order.status == 'active' %} -{% set info = admin.serviceboxbillinglicense_order_info({"order_id":order.id}) %} - -
-
-
-
-

{{ order.title }}

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% trans 'License key' %}:{{ info.license_key }}
{% trans 'Valid IPs' %}:{% for v in info.ips %}{{ v }}{{constant("PHP_EOL")}}{%else%}All IPs{% endfor %}
{% trans 'Valid hostnames' %}:{% for v in info.hosts %}{{ v }}{{constant("PHP_EOL")}}{%else%}All hostnames{% endfor %}
{% trans 'Valid versions' %}:{% for v in info.versions %}{{ v }}{{constant("PHP_EOL")}}{%else%}Any version{% endfor %}
{% trans 'Valid install paths' %}:{% for v in info.paths %}{{ v }}{{constant("PHP_EOL")}}{%else%}Any install path{% endfor %}
- {% trans 'Reset' %} -
-
-
-
-
-{% endif %} \ No newline at end of file diff --git a/src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_order.phtml b/src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_order.phtml deleted file mode 100644 index d74e57261..000000000 --- a/src/bb-modules/Serviceboxbillinglicense/html_client/mod_serviceboxbillinglicense_order.phtml +++ /dev/null @@ -1 +0,0 @@ -{% include "mod_order_product.phtml" %} \ No newline at end of file diff --git a/src/bb-modules/Serviceboxbillinglicense/icon.png b/src/bb-modules/Serviceboxbillinglicense/icon.png deleted file mode 100644 index 38b2cff321bcb51d2f0493aa8f7959776a89aa7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2648 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 sm0fQc*A=) Date: Mon, 2 Nov 2020 16:06:22 +0300 Subject: [PATCH 4/5] Delete tests\bb-modules\Serviceboxbillinglicense We no longer need this. --- .../Serviceboxbillinglicense/ServiceTest.php | 120 ------------------ 1 file changed, 120 deletions(-) delete mode 100644 tests/bb-modules/Serviceboxbillinglicense/ServiceTest.php diff --git a/tests/bb-modules/Serviceboxbillinglicense/ServiceTest.php b/tests/bb-modules/Serviceboxbillinglicense/ServiceTest.php deleted file mode 100644 index c370b4740..000000000 --- a/tests/bb-modules/Serviceboxbillinglicense/ServiceTest.php +++ /dev/null @@ -1,120 +0,0 @@ -service= new \Box\Mod\Serviceboxbillinglicense\Service(); - } - - public function testDi() - { - $di = new \Box_Di(); - $this->service->setDi($di); - $getDi = $this->service->getDi(); - $this->assertEquals($di, $getDi); - } - - public function testinstall() - { - $dbMock = $this->getMockBuilder('\Box_Database')->getMock(); - $dbMock->expects($this->atLeastOnce()) - ->method('exec'); - - $di = new \Box_Di(); - $di['db'] = $dbMock; - - $this->service->setDi($di); - $this->service->install(); - } - - public function testuninstall() - { - $uninstallSql = "DROP TABLE IF EXISTS `service_boxbillinglicense`"; - $dbMock = $this->getMockBuilder('\Box_Database')->getMock(); - $dbMock->expects($this->atLeastOnce()) - ->method('exec') - ->with($uninstallSql); - - $di = new \Box_Di(); - $di['db'] = $dbMock; - - $this->service->setDi($di); - $this->service->uninstall(); - } - - public function testsetModuleConfig() - { - $dbMock = $this->getMockBuilder('\Box_Database')->getMock(); - $dbMock->expects($this->atLeastOnce()) - ->method('exec'); - - $di = new \Box_Di(); - $di['db'] = $dbMock; - - $serviceMock = $this->getMockBuilder('\Box\Mod\Serviceboxbillinglicense\Service') - ->setMethods(array('getModuleConfig')) - ->getMock(); - $serviceMock->expects($this->atLeastOnce()) - ->method('getModuleConfig'); - - $serviceMock->setDi($di); - $serviceMock->setModuleConfig(array()); - } - - public function testgetModuleConfig() - { - $extensionMetaModel = new \Model_ExtensionMeta(); - $extensionMetaModel->loadBean(new \RedBeanPHP\OODBBean()); - $extensionMetaModel->meta_value = '{}'; - - $dbMock = $this->getMockBuilder('\Box_Database')->getMock(); - $dbMock->expects($this->atLeastOnce()) - ->method('findOne') - ->with('extension_meta') - ->willReturn($extensionMetaModel); - - $di = new \Box_Di(); - $di['db'] = $dbMock; - - $this->service->setDi($di); - $result = $this->service->getModuleConfig(); - $this->assertIsArray($result); - $this->assertArrayHasKey('api_key', $result); - } - - public function testgetModuleConfig_CreateDatabaseRecord() - { - $extensionMetaModel = new \Model_ExtensionMeta(); - $extensionMetaModel->loadBean(new \RedBeanPHP\OODBBean()); - - $dbMock = $this->getMockBuilder('\Box_Database')->getMock(); - $dbMock->expects($this->atLeastOnce()) - ->method('findOne') - ->with('extension_meta'); - $dbMock->expects($this->atLeastOnce()) - ->method('dispense') - ->with('extension_meta') - ->willReturn($extensionMetaModel); - $dbMock->expects($this->atLeastOnce()) - ->method('store') - ->with($extensionMetaModel); - - $di = new \Box_Di(); - $di['db'] = $dbMock; - - $this->service->setDi($di); - $result = $this->service->getModuleConfig(); - $this->assertIsArray($result); - $this->assertArrayHasKey('api_key', $result); - } -} From 389e6ea76b2f4e450461936b9676ccf8448ed4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Mon, 2 Nov 2020 16:23:13 +0300 Subject: [PATCH 5/5] Remove all references to Google Sites, and load the logo from the local storage. --- src/bb-load.php | 2 +- src/install/content.sql | 2 +- src/install/content_test.sql | 2 +- src/install/layout.phtml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bb-load.php b/src/bb-load.php index 88896d125..d74d75e39 100644 --- a/src/bb-load.php +++ b/src/bb-load.php @@ -53,7 +53,7 @@ function handler_exception($e) - BoxBilling + BoxBilling "; $page = str_replace(PHP_EOL, "", $page); print $page; diff --git a/src/install/content.sql b/src/install/content.sql index b04caa21a..1b0e03c37 100644 --- a/src/install/content.sql +++ b/src/install/content.sql @@ -363,7 +363,7 @@ VALUES (2,'company_name','Company Name',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (3,'company_email','company@email.com',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (4,'company_signature','BoxBilling.com - Client Management, Invoice and Support Software',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), - (5,'company_logo','https://sites.google.com/site/boxbilling/_/rsrc/1308483006796/home/logo_boxbilling.png',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), + (5,'company_logo','/bb-themes/boxbilling/assets/images/logo.png',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (6,'company_address_1','Demo address line 1',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (7,'company_address_2','Demo address line 2',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (8,'company_address_3','Demo address line 3',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), diff --git a/src/install/content_test.sql b/src/install/content_test.sql index bbbe71d11..ea9004111 100644 --- a/src/install/content_test.sql +++ b/src/install/content_test.sql @@ -572,7 +572,7 @@ VALUES (2,'company_name','Demo BoxBilling.com',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (3,'company_email','my@mycompany.com',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (4,'company_signature','BoxBilling.com - Client Management, Invoice and Support Software',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), - (5,'company_logo','https://sites.google.com/site/boxbilling/_/rsrc/1308483006796/home/logo_boxbilling.png',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), + (5,'company_logo','/bb-themes/boxbilling/assets/images/logo.png',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (6,'company_address_1','Demo address line 1',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (7,'company_address_2','Demo address line 2',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), (8,'company_address_3','Demo address line 3',0,NULL,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00'), diff --git a/src/install/layout.phtml b/src/install/layout.phtml index 05649f8fb..5782d6513 100644 --- a/src/install/layout.phtml +++ b/src/install/layout.phtml @@ -10,7 +10,7 @@