diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-30 19:51:56 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-30 19:51:56 +0000 |
commit | 12c75a0991a59eecd274eb2b03476e80ae608eaa (patch) | |
tree | ca3acbedd1a8c67f3abb02587dcc2badd46f0189 /phpBB/includes | |
parent | c44f6ca080c944b57dc912de8708e5239c1543a2 (diff) | |
download | forums-12c75a0991a59eecd274eb2b03476e80ae608eaa.tar forums-12c75a0991a59eecd274eb2b03476e80ae608eaa.tar.gz forums-12c75a0991a59eecd274eb2b03476e80ae608eaa.tar.bz2 forums-12c75a0991a59eecd274eb2b03476e80ae608eaa.tar.xz forums-12c75a0991a59eecd274eb2b03476e80ae608eaa.zip |
- temporarily disable x-sendfile support (we need to look into methods of checking if it is enabled/disabled or introducing a switch)
- finally allow custom permission settings files (in acp/ as well as in mods/)
git-svn-id: file:///svn/phpbb/trunk@6539 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_permission_roles.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_permissions.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 39 | ||||
-rw-r--r-- | phpBB/includes/utf/utf_tools.php | 15 |
5 files changed, 49 insertions, 11 deletions
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 99c0181f0a..004d9f55af 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -26,7 +26,7 @@ class acp_permission_roles $auth_admin = new auth_admin(); $user->add_lang('acp/permissions'); - $user->add_lang('acp/permissions_phpbb'); + add_permission_language(); $this->tpl_name = 'acp_permission_roles'; diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 5fcf692735..5354d70f72 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -27,7 +27,7 @@ class acp_permissions $auth_admin = new auth_admin(); $user->add_lang('acp/permissions'); - $user->add_lang('acp/permissions_phpbb'); + add_permission_language(); $this->tpl_name = 'acp_permissions'; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 485bff7bc8..7728df6275 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1959,7 +1959,7 @@ class acp_users $auth_admin = new auth_admin(); $user->add_lang('acp/permissions'); - $user->add_lang('acp/permissions_phpbb'); + add_permission_language(); // Select auth options $sql = 'SELECT auth_option, is_local, is_global diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ceb14d42e1..70c5b2bae3 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2608,9 +2608,46 @@ function tidy_database() { global $db; + set_config('database_last_gc', time(), true); +} +/** +* Add permission language - this will make sure custom files will be included +*/ +function add_permission_language() +{ + global $user, $phpEx; - set_config('database_last_gc', time(), true); + // First of all, our own file. + $user->add_lang('acp/permissions_phpbb'); + + $files_to_add = array(); + + // Now search in acp and mods folder for permissions_ files. + foreach (array('acp/', 'mods/') as $path) + { + $dh = opendir($user->lang_path . $path); + + if ($dh !== false) + { + while (($file = readdir($dh)) !== false) + { + if (strpos($file, 'permissions_') === 0 && strpos($file, 'permissions_phpbb') === false && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) + { + $files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1)); + } + } + closedir($dh); + } + } + + if (!sizeof($files_to_add)) + { + return false; + } + + $user->add_lang($files_to_add); + return true; } ?>
\ No newline at end of file diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 1f9a698163..24aeb35d02 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -111,16 +111,13 @@ if (extension_loaded('mbstring')) * * Notes: * - offset for mb_strrpos was added in 5.2.0, we emulate if it is lower - * - * @author Harry Fuecks - * @param string haystack - * @param string needle - * @param integer (optional) offset (from left) - * @return mixed integer position or FALSE on failure - * @ignore */ if (version_compare(phpversion(), '5.2.0', '>=')) { + /** + * UTF-8 aware alternative to strrpos + * @ignore + */ function utf8_strrpos($str, $needle, $offset = null) { // Emulate behaviour of strrpos rather than raising warning @@ -134,6 +131,10 @@ if (extension_loaded('mbstring')) } else { + /** + * UTF-8 aware alternative to strrpos + * @ignore + */ function utf8_strrpos($str, $needle, $offset = null) { // offset for mb_strrpos was added in 5.2.0 |