apps/files_sharing/lib/ShareBackend/File.php
/**
	 * resolve reshares to return the correct source item
	 * @param array $source
	 * @return array source item
	 */
resolve reshares to return the correct source item
@param array $source
@return array source item
resolve reshares to return the correct source item @param array $source @return array source item
protected static function resolveReshares($source) {
		if (isset($source['parent'])) {
			$parent = $source['parent'];
			while (isset($parent)) {
				$query = \OCP\DB::prepare('SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1);
				$item = $query->execute(array($parent))->fetchRow();
				if (isset($item['parent'])) {
					$parent = $item['parent'];
				} else {
					$fileOwner = $item['uid_owner'];
					break;
				}
			}
		} else {
			$fileOwner = $source['uid_owner'];
		}
		if (isset($fileOwner)) {
			$source['fileOwner'] = $fileOwner;
		} else {
			\OCP\Util::writeLog('files_sharing', "No owner found for reshare", \OCP\Util::ERROR);
		}
		return $source;
	}
protected static function resolveReshares ( $ source ) { if ( isset ( $ source [ 'parent' ] ) ) { $ parent = $ source [ 'parent' ] ; while ( isset ( $ parent ) ) { $ query = \ OCP \ DB :: prepare ( 'SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?' , 1 ) ; $ item = $ query -> execute ( array ( $ parent ) ) -> fetchRow ( ) ; if ( isset ( $ item [ 'parent' ] ) ) { $ parent = $ item [ 'parent' ] ; } else { $ fileOwner = $ item [ 'uid_owner' ] ; break ; } } } else { $ fileOwner = $ source [ 'uid_owner' ] ; } if ( isset ( $ fileOwner ) ) { $ source [ 'fileOwner' ] = $ fileOwner ; } else { \ OCP \ Util :: writeLog ( 'files_sharing' , " No owner found for reshare " , \ OCP \ Util :: ERROR ) ; } return $ source ; }
resolve reshares to return the correct source item
 @param array $source
 @return array source item
resolve reshares to return the correct source item @param array $source @return array source item