summaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Model/User.php
diff options
context:
space:
mode:
authorYalçın Can <ylcncn@gmail.com>2011-07-27 14:23:37 +0300
committerYalçın Can <ylcncn@gmail.com>2011-07-27 14:23:37 +0300
commitefd842174fdd37f8eb2c460c7adb21954bcfbe9d (patch)
treea2ab3cc25db92b901b69ce1bc0ad1dedb5d498ef /src/SemanticScuttle/Model/User.php
parent8cd40b3d76e191b2fbe95b044f69aed07cc27664 (diff)
parent81aa17b8523d95310c90366d9af09767db0c84f2 (diff)
downloadsemanticscuttle-efd842174fdd37f8eb2c460c7adb21954bcfbe9d.tar.gz
semanticscuttle-efd842174fdd37f8eb2c460c7adb21954bcfbe9d.tar.bz2
Merge remote-tracking branch 'upstream/master'
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
+?>