diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-02-23 14:06:46 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-02-23 14:06:46 +0000 |
commit | 2003152c8dd9c760135ec831b49e41adcfd02142 (patch) | |
tree | 0158f5c8fcbf1687321b309cbbe82ce429349d46 /phpBB/includes/auth.php | |
parent | 6accc46024d436e69802793956653412cde8f404 (diff) | |
download | forums-2003152c8dd9c760135ec831b49e41adcfd02142.tar forums-2003152c8dd9c760135ec831b49e41adcfd02142.tar.gz forums-2003152c8dd9c760135ec831b49e41adcfd02142.tar.bz2 forums-2003152c8dd9c760135ec831b49e41adcfd02142.tar.xz forums-2003152c8dd9c760135ec831b49e41adcfd02142.zip |
- Remove left join for query used to retrieve already assigned users and groups within permission panel - #20235
- also test the serialize/unserialize approach for cached roles
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8390 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r-- | phpBB/includes/auth.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 03f2a92ef8..8dd15fea64 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -453,10 +453,15 @@ class auth $this->role_cache = array(); while ($row = $db->sql_fetchrow($result)) { - $this->role_cache[$row['role_id']][$row['auth_option_id']] = (bool) $row['auth_setting']; + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting']; } $db->sql_freeresult($result); + foreach ($this->role_cache as $role_id => $role_options) + { + $this->role_cache[$role_id] = serialize($role_options); + } + $cache->put('_role_cache', $this->role_cache); // Now empty user permissions @@ -747,10 +752,15 @@ class auth while ($row = $db->sql_fetchrow($result)) { - $this->role_cache[$row['role_id']][$row['auth_option_id']] = (bool) $row['auth_setting']; + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting']; } $db->sql_freeresult($result); + foreach ($this->role_cache as $role_id => $role_options) + { + $this->role_cache[$role_id] = serialize($role_options); + } + $cache->put('_role_cache', $this->role_cache); } @@ -767,7 +777,7 @@ class auth // If a role is assigned, assign all options included within this role. Else, only set this one option. if ($row['auth_role_id']) { - $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? $this->role_cache[$row['auth_role_id']] : $hold_ary[$row['forum_id']] + $this->role_cache[$row['auth_role_id']]; + $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? unserialize($this->role_cache[$row['auth_role_id']]) : $hold_ary[$row['forum_id']] + unserialize($this->role_cache[$row['auth_role_id']]); } else { @@ -792,7 +802,7 @@ class auth } else { - foreach ($this->role_cache[$row['auth_role_id']] as $option_id => $setting) + foreach (unserialize($this->role_cache[$row['auth_role_id']]) as $option_id => $setting) { $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $option_id, $setting); } |