diff options
Diffstat (limited to 'paste/include/storage/StorageEngine.php')
-rw-r--r-- | paste/include/storage/StorageEngine.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/paste/include/storage/StorageEngine.php b/paste/include/storage/StorageEngine.php index db6e34b..09e1676 100644 --- a/paste/include/storage/StorageEngine.php +++ b/paste/include/storage/StorageEngine.php @@ -38,11 +38,17 @@ abstract class StorageEngine abstract public function getContent($pid); abstract public function delContent($pid); - public function generateToken($name) + public function generateToken($name, $remote = '') { global $config; - $ipAddr = $_SERVER["REMOTE_ADDR"]; + if (! empty($remote)) { + $ipAddr = $remote; + } + else { + $ipAddr = $_SERVER["REMOTE_ADDR"]; + } + return sha1($name . $ipAddr . $config['token_salt']); } } |