Skip to content
Permalink
Browse files

Fixed issues with group permissions on downloading attachments

  • Loading branch information...
thorsten committed Feb 23, 2019
1 parent 61a9fcd commit 96c583e1ed16cba7b9fae52d0f256e6d6065ace2
Showing with 10 additions and 5 deletions.
  1. +7 −2 phpmyfaq/attachment.php
  2. +1 −1 phpmyfaq/inc/PMF/Init.php
  3. +1 −1 phpmyfaq/inc/PMF/Perm/Medium.php
  4. +1 −1 phpmyfaq/inc/PMF/User.php
@@ -50,8 +50,13 @@
// Check on group permissions
if ($user->perm instanceof PMF_Perm_Medium) {
if (count($groupPermission) && in_array($groupPermission[0], $user->perm->getUserGroups($user->getUserId()))) {
$groupPermission = true;
if (count($groupPermission)) {
foreach ($user->perm->getUserGroups($user->getUserId()) as $userGroups) {
if (in_array($userGroups, $groupPermission)) {
$groupPermission = true;
break;
}
}
} else {
$groupPermission = false;
}
@@ -145,7 +145,7 @@ private static function _basicFilenameClean($filename)
private static function _cleanFilenames()
{
reset($_FILES);
while (list($key, $value) = each($_FILES)) {
foreach ($_FILES as $key => $value) {
if (is_array($_FILES[$key]['name'])) {
reset($_FILES[$key]['name']);
// We have a multiple upload with the same name for <input />
@@ -636,7 +636,7 @@ public function getUserGroups($userId)
$res = $this->config->getDb()->query($select);
$result = array(-1);
while ($row = $this->config->getDb()->fetchArray($res)) {
$result[] = $row['group_id'];
$result[] = (int)$row['group_id'];
}
return $result;
@@ -204,7 +204,7 @@ public function __construct(PMF_Configuration $config)
}
// additionally, set given $auth objects
if (count($auth) > 0) {
if (count($this->authContainer) > 0) {
foreach ($auth as $name => $authObject) {
if (!$authObject instanceof PMF_Auth_Driver && !$this->addAuth($authObject, $name)) {
break;

0 comments on commit 96c583e

Please sign in to comment.
You can’t perform that action at this time.