mirror of
https://github.com/nextcloud/passman.git
synced 2024-12-29 11:32:47 +08:00
Fix travis errors in share controller
This commit is contained in:
parent
a63d32d1c8
commit
bbcee22431
2 changed files with 5 additions and 5 deletions
|
@ -196,7 +196,7 @@ class ShareController extends ApiController {
|
||||||
$usersTmp = $this->userManager->searchDisplayName($search, $this->limit, $this->offset);
|
$usersTmp = $this->userManager->searchDisplayName($search, $this->limit, $this->offset);
|
||||||
|
|
||||||
foreach ($usersTmp as $user) {
|
foreach ($usersTmp as $user) {
|
||||||
if ($this->userId->getUID() != $user->getUID() && count($this->vaultService->getByUser($user->getUID())) >= 1) {
|
if ($this->userId->getUID() !== $user->getUID() && count($this->vaultService->getByUser($user->getUID())) >= 1) {
|
||||||
$users[] = array(
|
$users[] = array(
|
||||||
'text' => $user->getDisplayName(),
|
'text' => $user->getDisplayName(),
|
||||||
'uid' => $user->getUID(),
|
'uid' => $user->getUID(),
|
||||||
|
@ -416,7 +416,7 @@ class ShareController extends ApiController {
|
||||||
$views = $acl->getExpireViews();
|
$views = $acl->getExpireViews();
|
||||||
if ($views === 0) {
|
if ($views === 0) {
|
||||||
return new NotFoundJSONResponse();
|
return new NotFoundJSONResponse();
|
||||||
} else if ($views != -1) {
|
} else if ($views !== -1) {
|
||||||
$views--;
|
$views--;
|
||||||
$acl->setExpireViews($views);
|
$acl->setExpireViews($views);
|
||||||
$this->shareService->updateCredentialACL($acl);
|
$this->shareService->updateCredentialACL($acl);
|
||||||
|
@ -441,7 +441,7 @@ class ShareController extends ApiController {
|
||||||
$pending = $this->shareService->getCredentialPendingAclList($item_guid);
|
$pending = $this->shareService->getCredentialPendingAclList($item_guid);
|
||||||
try {
|
try {
|
||||||
$credential = $this->credentialService->getCredentialByGUID($item_guid);
|
$credential = $this->credentialService->getCredentialByGUID($item_guid);
|
||||||
if ($credential->getUserId() == $this->userId->getUID()) {
|
if ($credential->getUserId() === $this->userId->getUID()) {
|
||||||
foreach ($pending as &$item) {
|
foreach ($pending as &$item) {
|
||||||
$item = $item->asACLJson();
|
$item = $item->asACLJson();
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ class ShareController extends ApiController {
|
||||||
} catch (DoesNotExistException $exception) {
|
} catch (DoesNotExistException $exception) {
|
||||||
return new NotFoundJSONResponse();
|
return new NotFoundJSONResponse();
|
||||||
}
|
}
|
||||||
if ($this->userId->getUID() == $credential->getUserId()) {
|
if ($this->userId->getUID() === $credential->getUserId()) {
|
||||||
$acl = null;
|
$acl = null;
|
||||||
try {
|
try {
|
||||||
$acl = $this->shareService->getACL($user_id, $item_guid);
|
$acl = $this->shareService->getACL($user_id, $item_guid);
|
||||||
|
|
|
@ -47,7 +47,7 @@ class VaultMapper extends Mapper {
|
||||||
/**
|
/**
|
||||||
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
|
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
|
||||||
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result
|
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result
|
||||||
* @return Vault
|
* @return Vault[]
|
||||||
*/
|
*/
|
||||||
public function findVaultsFromUser($userId){
|
public function findVaultsFromUser($userId){
|
||||||
$sql = 'SELECT * FROM `*PREFIX*passman_vaults` ' .
|
$sql = 'SELECT * FROM `*PREFIX*passman_vaults` ' .
|
||||||
|
|
Loading…
Reference in a new issue