mirror of
https://github.com/nextcloud/server.git
synced 2026-04-23 23:27:46 -04:00
Use proper methods for checkPasswordProtectedShare
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
c5c23b30b9
commit
3e13e94254
3 changed files with 2 additions and 13 deletions
|
|
@ -283,7 +283,7 @@ class Share extends Constants {
|
|||
}
|
||||
|
||||
// password protected shares need to be authenticated
|
||||
if ($checkPasswordProtection && !\OCP\Share::checkPasswordProtectedShare($row)) {
|
||||
if ($checkPasswordProtection && !\OC\Share\Share::checkPasswordProtectedShare($row)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -235,15 +235,4 @@ class Share extends \OC\Share\Constants {
|
|||
public static function getBackend($itemType) {
|
||||
return \OC\Share\Share::getBackend($itemType);
|
||||
}
|
||||
|
||||
/**
|
||||
* In case a password protected link is not yet authenticated this function will return false
|
||||
*
|
||||
* @param array $linkItem
|
||||
* @return bool
|
||||
* @since 7.0.0
|
||||
*/
|
||||
public static function checkPasswordProtectedShare(array $linkItem) {
|
||||
return \OC\Share\Share::checkPasswordProtectedShare($linkItem);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ class ShareTest extends \Test\TestCase {
|
|||
*/
|
||||
public function testCheckPasswordProtectedShare($expected, $item) {
|
||||
\OC::$server->getSession()->set('public_link_authenticated', '100');
|
||||
$result = \OCP\Share::checkPasswordProtectedShare($item);
|
||||
$result = \OC\Share\Share::checkPasswordProtectedShare($item);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue