mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11088] Pass required objects in as arguments
PHPBB3-11088
This commit is contained in:
parent
5fc6752178
commit
a5783211c9
1 changed files with 4 additions and 4 deletions
|
@ -822,14 +822,14 @@ function _add_modules($modules_to_install)
|
||||||
* Add a new permission, optionally copy permission setting from another
|
* Add a new permission, optionally copy permission setting from another
|
||||||
*
|
*
|
||||||
* @param auth_admin $auth_admin auth_admin object
|
* @param auth_admin $auth_admin auth_admin object
|
||||||
|
* @param dbal $db Database object
|
||||||
* @param string $permission_name Name of the permission to add
|
* @param string $permission_name Name of the permission to add
|
||||||
* @param bool $is_global True is global, false is local
|
* @param bool $is_global True is global, false is local
|
||||||
* @param string $copy_from Optional permission name from which to copy
|
* @param string $copy_from Optional permission name from which to copy
|
||||||
* @return bool true on success, false on failure
|
* @return bool true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function _add_permission($permission_name, $is_global = true, $copy_from = '')
|
function _add_permission(auth_admin $auth_admin, dbal $db, $permission_name, $is_global = true, $copy_from = '')
|
||||||
{
|
{
|
||||||
global $db, $auth_admin;
|
|
||||||
// Only add a permission that don't already exist
|
// Only add a permission that don't already exist
|
||||||
if (!empty($auth_admin->acl_options['id'][$permission_name]))
|
if (!empty($auth_admin->acl_options['id'][$permission_name]))
|
||||||
{
|
{
|
||||||
|
@ -2921,8 +2921,8 @@ function change_database_data(&$no_updates, $version)
|
||||||
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
|
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
|
||||||
$auth_admin = new auth_admin();
|
$auth_admin = new auth_admin();
|
||||||
|
|
||||||
_add_permission('u_chgprofileinfo', true, 'u_sig');
|
_add_permission($auth_admin, $db, 'u_chgprofileinfo', true, 'u_sig');
|
||||||
_add_permission('a_extensions', true, 'a_styles');
|
_add_permission($auth_admin, $db, 'a_extensions', true, 'a_styles');
|
||||||
|
|
||||||
// Update the auth setting for the module
|
// Update the auth setting for the module
|
||||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||||
|
|
Loading…
Add table
Reference in a new issue