Browse Source

adding share type circles

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Maxence Lange 4 years ago
parent
commit
b10ab5a11e
2 changed files with 6 additions and 2 deletions
  1. 4 1
      apps/dav/lib/Connector/PublicAuth.php
  2. 2 1
      lib/private/Share20/Manager.php

+ 4 - 1
apps/dav/lib/Connector/PublicAuth.php

@@ -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')

+ 2 - 1
lib/private/Share20/Manager.php

@@ -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;