diff options
author | Mark Pemberton <mpemberton5@gmail.com> | 2011-05-13 14:26:51 -0400 |
---|---|---|
committer | Mark Pemberton <mpemberton5@gmail.com> | 2011-05-13 14:26:51 -0400 |
commit | ec345f7a1343769abdf3f5920a0732b24726b733 (patch) | |
tree | 1a65f2f0bea89b16f5c8e93264b67e2927570677 /src/SemanticScuttle/Model | |
parent | 803b83fb7d051593066b5224a59fbf3ec6efc824 (diff) | |
download | semanticscuttle-ec345f7a1343769abdf3f5920a0732b24726b733.tar.gz semanticscuttle-ec345f7a1343769abdf3f5920a0732b24726b733.tar.bz2 |
new privatekey2 branch with privatekey changes
Diffstat (limited to 'src/SemanticScuttle/Model')
-rw-r--r-- | src/SemanticScuttle/Model/User.php | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/SemanticScuttle/Model/User.php b/src/SemanticScuttle/Model/User.php index 500f5b1..3aa617b 100644 --- a/src/SemanticScuttle/Model/User.php +++ b/src/SemanticScuttle/Model/User.php @@ -35,6 +35,7 @@ class SemanticScuttle_Model_User var $content; var $datetime; var $isAdmin; + var $privateKey; /** * Create a new user object @@ -69,6 +70,29 @@ class SemanticScuttle_Model_User } /** + * Returns private key + * + * @param boolean return sanitized value which basically drops + * leading dash if exists + * + * @return string private key + */ + public function getPrivateKey($sanitized = false) + { + // Look for value only if not already set + if (!isset($this->privateKey)) { + $us = SemanticScuttle_Service_Factory::get('User'); + $user = $us->getUser($this->id); + $this->privateKey = $user['privateKey']; + } + if ($sanitized == true) { + return substr($this->privateKey, -32); + } else { + return $this->privateKey; + } + } + + /** * Returns full user name as specified in the profile. * * @return string Full name @@ -182,4 +206,4 @@ class SemanticScuttle_Model_User } } -?>
\ No newline at end of file +?> |