Merge pull request #18356 from nextcloud/backport/17935/stable16

[stable16] adding share type circles
This commit is contained in:
Roeland Jago Douma 2019-12-12 13:09:14 +01:00 committed by GitHub
commit d41f36dad5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -97,7 +97,10 @@ class PublicAuth extends AbstractBasic {
// check if the share is password protected
if ($share->getPassword() !== null) {
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK || $share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK
|| $share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL
|| $share->getShareType() === \OCP\Share::SHARE_TYPE_CIRCLE) {
if ($this->shareManager->checkPassword($share, $password)) {
return true;
} else if ($this->session->exists('public_link_authenticated')

View file

@ -1329,7 +1329,8 @@ class Manager implements IManager {
*/
public function checkPassword(\OCP\Share\IShare $share, $password) {
$passwordProtected = $share->getShareType() !== \OCP\Share::SHARE_TYPE_LINK
|| $share->getShareType() !== \OCP\Share::SHARE_TYPE_EMAIL;
|| $share->getShareType() !== \OCP\Share::SHARE_TYPE_EMAIL
|| $share->getShareType() !== \OCP\Share::SHARE_TYPE_CIRCLE;
if (!$passwordProtected) {
//TODO maybe exception?
return false;