Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable12] Make sure the mountPoint property is public before using it #79

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.2.2
## 1.2.5 - 2017-09-22

### Fixed
- Make sure the mountPoint property is public before using it [#79](https://github.com/nextcloud/files_accesscontrol/pull/79)

- Add support for changelog
## 1.2.4 - 2017-05-22

### Fixed
- Chinese language file parse error [#63](https://github.com/nextcloud/files_accesscontrol/pull/63)

## 1.2.1
## 1.2.3 - 2017-05-08

### Fixed
- Move to "Files" category in the app store

## 1.2.2 - 2017-04-26

### Added
- Add support for changelog

- Added sample screenshots
## 1.2.1 - 2017-05-22

### Added
- Added sample screenshots
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>Nextcloud's File Access Control app enables administrators to create and manage a set of rule groups. Each of the rule groups consists of one or more rules. If all rules of a group hold true, the group matches the request and access is being denied. The rules criteria range from IP address, to user groups, collaborative tags and some more.</description>
<licence>AGPL</licence>
<author>Morris Jobke</author>
<version>1.2.4</version>
<version>1.2.5</version>
<namespace>FilesAccessControl</namespace>

<category>files</category>
Expand Down
15 changes: 13 additions & 2 deletions lib/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,19 @@ public function checkFileAccess(IStorage $storage, $path) {
*/
protected function isBlockablePath(IStorage $storage, $path) {
if (property_exists($storage, 'mountPoint')) {
/** @var StorageWrapper $storage */
$fullPath = $storage->mountPoint . $path;
$hasMountPoint = $storage instanceof StorageWrapper;
if (!$hasMountPoint) {
$ref = new \ReflectionClass($storage);
$prop = $ref->getProperty('mountPoint');
$hasMountPoint = $prop->isPublic();
}

if ($hasMountPoint) {
/** @var StorageWrapper $storage */
$fullPath = $storage->mountPoint . $path;
} else {
$fullPath = $path;
}
} else {
$fullPath = $path;
}
Expand Down