diff --git a/apps/files_sharing/lib/connector/publicauth.php b/apps/files_sharing/lib/connector/publicauth.php index b1c269867f59..f604b66603d7 100644 --- a/apps/files_sharing/lib/connector/publicauth.php +++ b/apps/files_sharing/lib/connector/publicauth.php @@ -82,10 +82,13 @@ protected function validateUserPass($username, $password) { } return true; + } else if (\OC::$server->getSession()->exists('public_link_authenticated') + || \OC::$server->getSession()->get('public_link_authenticated') === $linkItem['id']) { + return true; } else { return false; } - } elseif ($linkItem['share_type'] == \OCP\Share::SHARE_TYPE_REMOTE) { + } else if ($linkItem['share_type'] == \OCP\Share::SHARE_TYPE_REMOTE) { return true; } else { return false;