mirror of
https://github.com/owncloud/bookmarks.git
synced 2025-02-12 09:54:27 +01:00
fix and add phpdoc
This commit is contained in:
parent
1b93f9fe2d
commit
07a05d4472
@ -85,8 +85,8 @@ class Bookmarks {
|
||||
|
||||
/**
|
||||
* @brief Check if an URL is bookmarked
|
||||
* @param $url Url of a possible bookmark
|
||||
* @param $userId UserId
|
||||
* @param string $url Url of a possible bookmark
|
||||
* @param string $userId UserId
|
||||
* @param IDb $db Database Interface
|
||||
* @return boolean if the url is already bookmarked
|
||||
*/
|
||||
@ -267,7 +267,7 @@ class Bookmarks {
|
||||
|
||||
/**
|
||||
* @brief Rename a tag
|
||||
* @param $userId UserId
|
||||
* @param string $userId UserId
|
||||
* @param IDb $db Database Interface
|
||||
* @param string $old Old Tag Name
|
||||
* @param string $new New Tag Name
|
||||
@ -338,7 +338,7 @@ class Bookmarks {
|
||||
|
||||
/**
|
||||
* @brief Delete a tag
|
||||
* @param $userid UserId
|
||||
* @param string $userid UserId
|
||||
* @param IDb $db Database Interface
|
||||
* @param string $old Tag Name to delete
|
||||
* @return boolean Success of operation
|
||||
|
@ -8,6 +8,7 @@ use \OCP\IDb;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
use \OC\User\Manager;
|
||||
use OCA\Bookmarks\Controller\Lib\Bookmarks;
|
||||
use OCP\Util;
|
||||
|
||||
class PublicController extends ApiController {
|
||||
|
||||
@ -23,6 +24,14 @@ class PublicController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param array $tags
|
||||
* @param string $conjunction
|
||||
* @param array $select
|
||||
* @param string $sortby
|
||||
* @return JSONResponse
|
||||
*
|
||||
* @CORS
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
@ -48,7 +57,7 @@ class PublicController extends ApiController {
|
||||
if (!$public && !$this->userManager->checkPassword($user, $password)) {
|
||||
|
||||
$msg = 'REST API accessed with wrong password';
|
||||
\OCP\Util::writeLog('bookmarks', $msg, \OCP\Util::WARN);
|
||||
Util::writeLog('bookmarks', $msg, Util::WARN);
|
||||
|
||||
return $this->newJsonErrorMessage("Wrong password for user " . $user);
|
||||
}
|
||||
@ -71,6 +80,10 @@ class PublicController extends ApiController {
|
||||
return new JSONResponse($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function newJsonErrorMessage($message) {
|
||||
$output = array();
|
||||
$output["status"] = 'error';
|
||||
|
@ -21,6 +21,9 @@ class TagsController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $old_name
|
||||
* @return JSONResponse
|
||||
*
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function deleteTag($old_name = "") {
|
||||
@ -34,6 +37,10 @@ class TagsController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $old_name
|
||||
* @param string $new_name
|
||||
* @return JSONResponse
|
||||
*
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function renameTag($old_name = "", $new_name = "") {
|
||||
|
@ -18,14 +18,29 @@ use \OCP\AppFramework\Http\TemplateResponse;
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\IDb;
|
||||
use \OCA\Bookmarks\Controller\Lib\Bookmarks;
|
||||
use OCP\IURLGenerator;
|
||||
|
||||
class WebViewController extends Controller {
|
||||
|
||||
/** @var string */
|
||||
private $userId;
|
||||
|
||||
/** @var IURLGenerator */
|
||||
private $urlgenerator;
|
||||
|
||||
/** @var IDb */
|
||||
private $db;
|
||||
|
||||
public function __construct($appName, IRequest $request, $userId, $urlgenerator, IDb $db) {
|
||||
/**
|
||||
* WebViewController constructor.
|
||||
*
|
||||
* @param string $appName
|
||||
* @param IRequest $request
|
||||
* @param $userId
|
||||
* @param IURLGenerator $urlgenerator
|
||||
* @param IDb $db
|
||||
*/
|
||||
public function __construct($appName, IRequest $request, $userId, IURLGenerator $urlgenerator, IDb $db) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->urlgenerator = $urlgenerator;
|
||||
@ -49,6 +64,10 @@ class WebViewController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param string $title
|
||||
* @return TemplateResponse
|
||||
*
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user