summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-09-28 22:14:31 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-09-28 22:14:31 +0000
commit22c9a01ee845d2b92fcab6b6cb10ac6ff0eec52e (patch)
tree5f5c876689ee1dc4d8054db29ce9946221b0045b /src
parentdf8216d607a9806b57b83eea9eb55577eae7d54f (diff)
downloadsemanticscuttle-22c9a01ee845d2b92fcab6b6cb10ac6ff0eec52e.tar.gz
semanticscuttle-22c9a01ee845d2b92fcab6b6cb10ac6ff0eec52e.tar.bz2
rewrite api/posts/delete to be more secure and add unit tests for it
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@769 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'src')
-rw-r--r--src/SemanticScuttle/Service/Bookmark.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php
index dde1df5..4e18d3f 100644
--- a/src/SemanticScuttle/Service/Bookmark.php
+++ b/src/SemanticScuttle/Service/Bookmark.php
@@ -176,7 +176,10 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
* Retrieves a bookmark with the given URL.
* DOES NOT RESPECT PRIVACY SETTINGS!
*
- * @param string $address URL to get bookmarks for
+ * @param string $address URL to get bookmarks for
+ * @param boolean $all Retrieve from all users (true)
+ * or only bookmarks owned by the current
+ * user (false)
*
* @return mixed Array with bookmark data or false in case
* of an error (i.e. not found).
@@ -184,9 +187,9 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
* @uses getBookmarkByHash()
* @see getBookmarkByShortname()
*/
- public function getBookmarkByAddress($address)
+ public function getBookmarkByAddress($address, $all = true)
{
- return $this->getBookmarkByHash($this->getHash($address));
+ return $this->getBookmarkByHash($this->getHash($address), $all);
}
@@ -195,16 +198,19 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
* Retrieves a bookmark with the given hash.
* DOES NOT RESPECT PRIVACY SETTINGS!
*
- * @param string $hash URL hash
+ * @param string $hash URL hash
+ * @param boolean $all Retrieve from all users (true)
+ * or only bookmarks owned by the current
+ * user (false)
*
* @return mixed Array with bookmark data or false in case
* of an error (i.e. not found).
*
* @see getHash()
*/
- public function getBookmarkByHash($hash)
+ public function getBookmarkByHash($hash, $all = true)
{
- return $this->_getbookmark('bHash', $hash, true);
+ return $this->_getbookmark('bHash', $hash, $all);
}