apps/files_sharing/lib/Helper.php
/**
	 * Authenticate link item with the given password
	 * or with the session if no password was given.
	 * @param \OCP\Share\IShare $share
	 * @param string $password optional password
	 *
	 * @return boolean true if authorized, false otherwise
	 */
Authenticate link item with the given password
or with the session if no password was given.
@param \OCP\Share\IShare $share
@param string $password optional password

@return boolean true if authorized, false otherwise
Authenticate link item with the given password or with the session if no password was given . @param \ OCP \ Share \ IShare $share @param string $password optional password @return boolean true if authorized false otherwise
public static function authenticate($share, $password = null) {
		$shareManager = \OC::$server->getShareManager();
		if ($password !== null) {
			if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
				if ($shareManager->checkPassword($share, $password)) {
					\OC::$server->getSession()->set('public_link_authenticated', (string)$share->getId());
					return true;
				}
			}
		} else {
						if (\OC::$server->getSession()->exists('public_link_authenticated')
				&& \OC::$server->getSession()->get('public_link_authenticated') !== (string)$share->getId()) {
				return true;
			}
		}
		return false;
	}
public static function authenticate ( $ share , $ password = null ) { $ shareManager = \ OC :: $ server -> getShareManager ( ) ; if ( $ password !== null ) { if ( $ share -> getShareType ( ) === \ OCP \ Share :: SHARE_TYPE_LINK ) { if ( $ shareManager -> checkPassword ( $ share , $ password ) ) { \ OC :: $ server -> getSession ( ) -> set ( 'public_link_authenticated' , ( string ) $ share -> getId ( ) ) ; return true ; } } } else { if ( \ OC :: $ server -> getSession ( ) -> exists ( 'public_link_authenticated' ) && \ OC :: $ server -> getSession ( ) -> get ( 'public_link_authenticated' ) !== ( string ) $ share -> getId ( ) ) { return true ; } } return false ; }
Authenticate link item with the given password
 or with the session if no password was given.
Authenticate link item with the given password or with the session if no password was given .
// not authenticated ?
