2) { $status = 0; } } else { switch ($status_str) { case 'private': $status = 2; break; case 'shared': $status = 1; break; default: $status = 0; break; } } } if (isset($_REQUEST['shared']) && (trim($_REQUEST['shared']) == 'no')) { $status = 2; } // Error out if there's no address or description if (is_null($url)) { header('HTTP/1.0 400 Bad Request'); $msg = 'URL missing'; } else if (is_null($description)) { header('HTTP/1.0 400 Bad Request'); $msg = 'Description missing'; } else { // We're good with info; now insert it! if ($bookmarkservice->bookmarkExists($url, $userservice->getCurrentUserId())) { $msg = 'something went wrong'; } else { $added = $bookmarkservice->addBookmark( $url, $description, $extended, '', $status, $tags, null, $dt, true ); $msg = 'done'; } } // Set up the XML file and output the result. echo '\r\n"; echo ''; ?>