aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/SemanticScuttle/Model')
-rw-r--r--src/SemanticScuttle/Model/Bookmark.php17
-rw-r--r--src/SemanticScuttle/Model/User.php26
2 files changed, 42 insertions, 1 deletions
diff --git a/src/SemanticScuttle/Model/Bookmark.php b/src/SemanticScuttle/Model/Bookmark.php
index 8bda0b3..1330642 100644
--- a/src/SemanticScuttle/Model/Bookmark.php
+++ b/src/SemanticScuttle/Model/Bookmark.php
@@ -24,6 +24,23 @@
class SemanticScuttle_Model_Bookmark
{
/**
+ * Status "public" / visible for all
+ */
+ const SPUBLIC = 0;
+
+ /**
+ * Status "shared" / visible for people on your watchlist
+ */
+ const SWATCHLIST = 1;
+
+ /**
+ * Status "private" / visible for yourself only
+ */
+ const SPRIVATE = 2;
+
+
+
+ /**
* Checks if the given URL is valid and may be used with this
* SemanticScuttle installation.
*
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
+?>