diff options
Diffstat (limited to 'apps/bookmarks/ajax/addBookmark.php')
-rw-r--r-- | apps/bookmarks/ajax/addBookmark.php | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php index 7cf5baa4a6e..9b0beb388a0 100644 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -26,14 +26,8 @@ $RUNTIME_NOSETUPFS=true; require_once('../../../lib/base.php'); -// We send json data -header( "Content-Type: application/jsonrequest" ); - // Check if we are a user -if( !OC_User::isLoggedIn()){ - echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); - exit(); -} +OC_JSON::checkLoggedIn(); $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ @@ -76,6 +70,6 @@ if($b_id !== false) { $query->execute($params); } - echo json_encode( array( 'status' => 'success', 'data' => $b_id)); + OC_JSON::success(array('data' => $b_id)); } |