|
|
@@ -440,12 +440,14 @@ class Producer extends ActiveRecordCommon |
|
|
|
*/ |
|
|
|
public function getSecretKeyPayplug() |
|
|
|
{ |
|
|
|
$handle = fopen($this->getFilenameSecretKeyPayplug(), "r") ; |
|
|
|
$filesize = filesize($this->getFilenameSecretKeyPayplug()) ; |
|
|
|
if($handle && $filesize) { |
|
|
|
$secretKey = fread($handle, $filesize); |
|
|
|
fclose($handle); |
|
|
|
return $secretKey ; |
|
|
|
if(file_exists($this->getFilenameSecretKeyPayplug())) { |
|
|
|
$handle = fopen($this->getFilenameSecretKeyPayplug(), "r") ; |
|
|
|
$filesize = filesize($this->getFilenameSecretKeyPayplug()) ; |
|
|
|
if($handle && $filesize) { |
|
|
|
$secretKey = fread($handle, $filesize); |
|
|
|
fclose($handle); |
|
|
|
return $secretKey ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return '' ; |
|
|
@@ -454,18 +456,20 @@ class Producer extends ActiveRecordCommon |
|
|
|
public function getApiKeyMailjet($type = 'private') |
|
|
|
{ |
|
|
|
$filename = '../../common/config/mailjet/api.key' ; |
|
|
|
$handle = fopen($filename, "r") ; |
|
|
|
$filesize = filesize($filename) ; |
|
|
|
if($handle && $filesize) { |
|
|
|
$apiKeys = fread($handle, $filesize); |
|
|
|
fclose($handle); |
|
|
|
$apiKeysArray = explode(':', $apiKeys) ; |
|
|
|
if(count($apiKeysArray) == 2) { |
|
|
|
if($type == 'private') { |
|
|
|
return $apiKeysArray[1] ; |
|
|
|
} |
|
|
|
else { |
|
|
|
return $apiKeysArray[0] ; |
|
|
|
if(file_exists($filename)) { |
|
|
|
$handle = fopen($filename, "r") ; |
|
|
|
$filesize = filesize($filename) ; |
|
|
|
if($handle && $filesize) { |
|
|
|
$apiKeys = fread($handle, $filesize); |
|
|
|
fclose($handle); |
|
|
|
$apiKeysArray = explode(':', $apiKeys) ; |
|
|
|
if(count($apiKeysArray) == 2) { |
|
|
|
if($type == 'private') { |
|
|
|
return $apiKeysArray[1] ; |
|
|
|
} |
|
|
|
else { |
|
|
|
return $apiKeysArray[0] ; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |