summaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Model/User.php
diff options
context:
space:
mode:
authorMark Pemberton <mpemberton5@gmail.com>2011-05-13 14:26:51 -0400
committerMark Pemberton <mpemberton5@gmail.com>2011-05-13 14:26:51 -0400
commitec345f7a1343769abdf3f5920a0732b24726b733 (patch)
tree1a65f2f0bea89b16f5c8e93264b67e2927570677 /src/SemanticScuttle/Model/User.php
parent803b83fb7d051593066b5224a59fbf3ec6efc824 (diff)
downloadsemanticscuttle-ec345f7a1343769abdf3f5920a0732b24726b733.tar.gz
semanticscuttle-ec345f7a1343769abdf3f5920a0732b24726b733.tar.bz2
new privatekey2 branch with privatekey changes
Diffstat (limited to 'src/SemanticScuttle/Model/User.php')
-rw-r--r--src/SemanticScuttle/Model/User.php26
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
+?>