projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2289184
)
Changed DataObjects/Core_setting.php
author
Edward
<edward@roojs.com>
Mon, 31 Dec 2018 04:29:07 +0000
(12:29 +0800)
committer
Edward
<edward@roojs.com>
Mon, 31 Dec 2018 04:29:07 +0000
(12:29 +0800)
DataObjects/Core_setting.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_setting.php
b/DataObjects/Core_setting.php
index
05816c4
..
9125688
100644
(file)
--- a/
DataObjects/Core_setting.php
+++ b/
DataObjects/Core_setting.php
@@
-124,6
+124,31
@@
class Pman_Core_DataObjects_Core_setting extends DB_DataObject
return $ciphertext;
}
return $ciphertext;
}
+ function decrypt($v)
+ {
+ $dir = $this->getKeyDirectory();
+
+ if(!$dir) {
+ return false;
+ }
+
+ $key_dir = "{$dir}/pri.key";
+
+ if(!file_exists($key_dir)) {
+ return false;
+ }
+
+ $pri_key = file_get_contents($key_dir);
+
+ if(!$pri_key) {
+ return false;
+ }
+
+ openssl_private_decrypt($v, $plaintext, $pri_key);
+
+ return $plaintext;
+ }
+
function getDecryptVal()
{
$dir = $this->getKeyDirectory();
function getDecryptVal()
{
$dir = $this->getKeyDirectory();