mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-21 20:34:57 +09:00
Finish tests-fixes
This commit is contained in:
commit
3eea68ce96
2 files changed
+17
-3
No files matched your search
@@ -44,6 +44,9 @@ class Box_Crypt implements \Box\InjectionAwareInterface
|
||||
|
||||
public function decrypt($text, $pass = null)
|
||||
{
|
||||
if (is_null($text)){
|
||||
return false;
|
||||
}
|
||||
$key = $this->_getSalt($pass);
|
||||
$mode = MCRYPT_MODE_CBC;
|
||||
$ciphertext_dec = base64_decode($text);
|
||||
|
||||
@@ -39,14 +39,14 @@ class Model_ProductDomainTable extends Model_ProductTable
|
||||
|
||||
if($this->isActionNameSet($item, 'register') &&
|
||||
$this->isFreeDomainSet($item) &&
|
||||
$this->domainMatch($item, $config) )
|
||||
$this->registerDomainMatch($item, $config) )
|
||||
{
|
||||
return $this->getProductPrice($product, $config);
|
||||
}
|
||||
|
||||
if($this->isActionNameSet($item, 'transfer') &&
|
||||
$this->isFreeTransferSet($item) &&
|
||||
$this->domainMatch($item, $config) ) {
|
||||
$this->transferDomainMatch($item, $config) ) {
|
||||
return $this->getProductPrice($product, $config);
|
||||
}
|
||||
}
|
||||
@@ -64,11 +64,22 @@ class Model_ProductDomainTable extends Model_ProductTable
|
||||
return isset($item['config']['free_domain']) && $item['config']['free_domain'];
|
||||
}
|
||||
|
||||
private function domainMatch($item, $config)
|
||||
private function registerDomainMatch($item, $config)
|
||||
{
|
||||
if (!isset($item['config']['domain']['register_sld'])){
|
||||
return false;
|
||||
}
|
||||
return $item['config']['domain']['register_sld'] == $config['register_sld'] && $item['config']['domain']['register_tld'] == $config['register_tld'];
|
||||
}
|
||||
|
||||
private function transferDomainMatch($item, $config)
|
||||
{
|
||||
if (!isset($item['config']['domain']['transfer_sld'])){
|
||||
return false;
|
||||
}
|
||||
return $item['config']['domain']['transfer_sld'] == $config['transfer_sld'] && $item['config']['domain']['transfer_tld'] == $config['transfer_tld'];
|
||||
}
|
||||
|
||||
private function isFreeTransferSet($item)
|
||||
{
|
||||
return isset($item['config']['free_transfer']) && $item['config']['free_transfer'];
|
||||
|
||||
Reference in new issue
Block a user